@magiclabs.ai/magicbook-client 0.7.29 → 0.7.31-canary
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 +439 -457
- package/index.cjs.map +1 -1
- package/index.d.cts +24 -0
- package/index.d.ts +24 -0
- package/index.iife.js +429 -456
- package/index.iife.min.js +1 -1
- package/index.js +445 -457
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// ../../core/data/design-request.ts
|
|
2
8
|
var states = [
|
|
3
9
|
"new",
|
|
@@ -219,6 +225,14 @@ var styles = {
|
|
|
219
225
|
6166: { slug: "disney-mickey-and-friends-sfly" },
|
|
220
226
|
6169: { slug: "through-the-years-sfly" },
|
|
221
227
|
6172: { slug: "modern-editorial-moments-sfly" },
|
|
228
|
+
6173: { slug: "disneys-happily-ever-after-sfly" },
|
|
229
|
+
6176: { slug: "disney-mickey-and-friends-christmas-sfly" },
|
|
230
|
+
6177: { slug: "timeless-love-story-sfly" },
|
|
231
|
+
6178: { slug: "tiny-moments-sfly" },
|
|
232
|
+
6179: { slug: "travel-archives-sfly" },
|
|
233
|
+
6180: { slug: "illustrated-with-love-sfly" },
|
|
234
|
+
6183: { slug: "modern-school-yearbook-sfly" },
|
|
235
|
+
6186: { slug: "professional-portfolio-sfly" },
|
|
222
236
|
//snapfish styles
|
|
223
237
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
224
238
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -1597,10 +1611,123 @@ function getStyleIdBySlug(slug) {
|
|
|
1597
1611
|
return slug;
|
|
1598
1612
|
}
|
|
1599
1613
|
|
|
1600
|
-
// ../../node_modules/.pnpm/zod@3.
|
|
1614
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
|
|
1615
|
+
var external_exports = {};
|
|
1616
|
+
__export(external_exports, {
|
|
1617
|
+
BRAND: () => BRAND,
|
|
1618
|
+
DIRTY: () => DIRTY,
|
|
1619
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
1620
|
+
INVALID: () => INVALID,
|
|
1621
|
+
NEVER: () => NEVER,
|
|
1622
|
+
OK: () => OK,
|
|
1623
|
+
ParseStatus: () => ParseStatus,
|
|
1624
|
+
Schema: () => ZodType,
|
|
1625
|
+
ZodAny: () => ZodAny,
|
|
1626
|
+
ZodArray: () => ZodArray,
|
|
1627
|
+
ZodBigInt: () => ZodBigInt,
|
|
1628
|
+
ZodBoolean: () => ZodBoolean,
|
|
1629
|
+
ZodBranded: () => ZodBranded,
|
|
1630
|
+
ZodCatch: () => ZodCatch,
|
|
1631
|
+
ZodDate: () => ZodDate,
|
|
1632
|
+
ZodDefault: () => ZodDefault,
|
|
1633
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
1634
|
+
ZodEffects: () => ZodEffects,
|
|
1635
|
+
ZodEnum: () => ZodEnum,
|
|
1636
|
+
ZodError: () => ZodError,
|
|
1637
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1638
|
+
ZodFunction: () => ZodFunction,
|
|
1639
|
+
ZodIntersection: () => ZodIntersection,
|
|
1640
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
1641
|
+
ZodLazy: () => ZodLazy,
|
|
1642
|
+
ZodLiteral: () => ZodLiteral,
|
|
1643
|
+
ZodMap: () => ZodMap,
|
|
1644
|
+
ZodNaN: () => ZodNaN,
|
|
1645
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
1646
|
+
ZodNever: () => ZodNever,
|
|
1647
|
+
ZodNull: () => ZodNull,
|
|
1648
|
+
ZodNullable: () => ZodNullable,
|
|
1649
|
+
ZodNumber: () => ZodNumber,
|
|
1650
|
+
ZodObject: () => ZodObject,
|
|
1651
|
+
ZodOptional: () => ZodOptional,
|
|
1652
|
+
ZodParsedType: () => ZodParsedType,
|
|
1653
|
+
ZodPipeline: () => ZodPipeline,
|
|
1654
|
+
ZodPromise: () => ZodPromise,
|
|
1655
|
+
ZodReadonly: () => ZodReadonly,
|
|
1656
|
+
ZodRecord: () => ZodRecord,
|
|
1657
|
+
ZodSchema: () => ZodType,
|
|
1658
|
+
ZodSet: () => ZodSet,
|
|
1659
|
+
ZodString: () => ZodString,
|
|
1660
|
+
ZodSymbol: () => ZodSymbol,
|
|
1661
|
+
ZodTransformer: () => ZodEffects,
|
|
1662
|
+
ZodTuple: () => ZodTuple,
|
|
1663
|
+
ZodType: () => ZodType,
|
|
1664
|
+
ZodUndefined: () => ZodUndefined,
|
|
1665
|
+
ZodUnion: () => ZodUnion,
|
|
1666
|
+
ZodUnknown: () => ZodUnknown,
|
|
1667
|
+
ZodVoid: () => ZodVoid,
|
|
1668
|
+
addIssueToContext: () => addIssueToContext,
|
|
1669
|
+
any: () => anyType,
|
|
1670
|
+
array: () => arrayType,
|
|
1671
|
+
bigint: () => bigIntType,
|
|
1672
|
+
boolean: () => booleanType,
|
|
1673
|
+
coerce: () => coerce,
|
|
1674
|
+
custom: () => custom,
|
|
1675
|
+
date: () => dateType,
|
|
1676
|
+
datetimeRegex: () => datetimeRegex,
|
|
1677
|
+
defaultErrorMap: () => en_default,
|
|
1678
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
1679
|
+
effect: () => effectsType,
|
|
1680
|
+
enum: () => enumType,
|
|
1681
|
+
function: () => functionType,
|
|
1682
|
+
getErrorMap: () => getErrorMap,
|
|
1683
|
+
getParsedType: () => getParsedType,
|
|
1684
|
+
instanceof: () => instanceOfType,
|
|
1685
|
+
intersection: () => intersectionType,
|
|
1686
|
+
isAborted: () => isAborted,
|
|
1687
|
+
isAsync: () => isAsync,
|
|
1688
|
+
isDirty: () => isDirty,
|
|
1689
|
+
isValid: () => isValid,
|
|
1690
|
+
late: () => late,
|
|
1691
|
+
lazy: () => lazyType,
|
|
1692
|
+
literal: () => literalType,
|
|
1693
|
+
makeIssue: () => makeIssue,
|
|
1694
|
+
map: () => mapType,
|
|
1695
|
+
nan: () => nanType,
|
|
1696
|
+
nativeEnum: () => nativeEnumType,
|
|
1697
|
+
never: () => neverType,
|
|
1698
|
+
null: () => nullType,
|
|
1699
|
+
nullable: () => nullableType,
|
|
1700
|
+
number: () => numberType,
|
|
1701
|
+
object: () => objectType,
|
|
1702
|
+
objectUtil: () => objectUtil,
|
|
1703
|
+
oboolean: () => oboolean,
|
|
1704
|
+
onumber: () => onumber,
|
|
1705
|
+
optional: () => optionalType,
|
|
1706
|
+
ostring: () => ostring,
|
|
1707
|
+
pipeline: () => pipelineType,
|
|
1708
|
+
preprocess: () => preprocessType,
|
|
1709
|
+
promise: () => promiseType,
|
|
1710
|
+
quotelessJson: () => quotelessJson,
|
|
1711
|
+
record: () => recordType,
|
|
1712
|
+
set: () => setType,
|
|
1713
|
+
setErrorMap: () => setErrorMap,
|
|
1714
|
+
strictObject: () => strictObjectType,
|
|
1715
|
+
string: () => stringType,
|
|
1716
|
+
symbol: () => symbolType,
|
|
1717
|
+
transformer: () => effectsType,
|
|
1718
|
+
tuple: () => tupleType,
|
|
1719
|
+
undefined: () => undefinedType,
|
|
1720
|
+
union: () => unionType,
|
|
1721
|
+
unknown: () => unknownType,
|
|
1722
|
+
util: () => util,
|
|
1723
|
+
void: () => voidType
|
|
1724
|
+
});
|
|
1725
|
+
|
|
1726
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
1601
1727
|
var util;
|
|
1602
1728
|
(function(util2) {
|
|
1603
|
-
util2.assertEqual = (
|
|
1729
|
+
util2.assertEqual = (_) => {
|
|
1730
|
+
};
|
|
1604
1731
|
function assertIs(_arg) {
|
|
1605
1732
|
}
|
|
1606
1733
|
util2.assertIs = assertIs;
|
|
@@ -1644,7 +1771,7 @@ var util;
|
|
|
1644
1771
|
}
|
|
1645
1772
|
return void 0;
|
|
1646
1773
|
};
|
|
1647
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1774
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
1648
1775
|
function joinValues(array, separator = " | ") {
|
|
1649
1776
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1650
1777
|
}
|
|
@@ -1696,7 +1823,7 @@ var getParsedType = (data) => {
|
|
|
1696
1823
|
case "string":
|
|
1697
1824
|
return ZodParsedType.string;
|
|
1698
1825
|
case "number":
|
|
1699
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1826
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1700
1827
|
case "boolean":
|
|
1701
1828
|
return ZodParsedType.boolean;
|
|
1702
1829
|
case "function":
|
|
@@ -1729,6 +1856,8 @@ var getParsedType = (data) => {
|
|
|
1729
1856
|
return ZodParsedType.unknown;
|
|
1730
1857
|
}
|
|
1731
1858
|
};
|
|
1859
|
+
|
|
1860
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
1732
1861
|
var ZodIssueCode = util.arrayToEnum([
|
|
1733
1862
|
"invalid_type",
|
|
1734
1863
|
"invalid_literal",
|
|
@@ -1828,8 +1957,9 @@ var ZodError = class _ZodError extends Error {
|
|
|
1828
1957
|
const formErrors = [];
|
|
1829
1958
|
for (const sub of this.issues) {
|
|
1830
1959
|
if (sub.path.length > 0) {
|
|
1831
|
-
|
|
1832
|
-
fieldErrors[
|
|
1960
|
+
const firstEl = sub.path[0];
|
|
1961
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
1962
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
1833
1963
|
} else {
|
|
1834
1964
|
formErrors.push(mapper(sub));
|
|
1835
1965
|
}
|
|
@@ -1844,6 +1974,8 @@ ZodError.create = (issues) => {
|
|
|
1844
1974
|
const error = new ZodError(issues);
|
|
1845
1975
|
return error;
|
|
1846
1976
|
};
|
|
1977
|
+
|
|
1978
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
1847
1979
|
var errorMap = (issue, _ctx) => {
|
|
1848
1980
|
let message;
|
|
1849
1981
|
switch (issue.code) {
|
|
@@ -1905,6 +2037,8 @@ var errorMap = (issue, _ctx) => {
|
|
|
1905
2037
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
1906
2038
|
else if (issue.type === "number")
|
|
1907
2039
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2040
|
+
else if (issue.type === "bigint")
|
|
2041
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
1908
2042
|
else if (issue.type === "date")
|
|
1909
2043
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
1910
2044
|
else
|
|
@@ -1942,13 +2076,18 @@ var errorMap = (issue, _ctx) => {
|
|
|
1942
2076
|
}
|
|
1943
2077
|
return { message };
|
|
1944
2078
|
};
|
|
1945
|
-
var
|
|
2079
|
+
var en_default = errorMap;
|
|
2080
|
+
|
|
2081
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
2082
|
+
var overrideErrorMap = en_default;
|
|
1946
2083
|
function setErrorMap(map) {
|
|
1947
2084
|
overrideErrorMap = map;
|
|
1948
2085
|
}
|
|
1949
2086
|
function getErrorMap() {
|
|
1950
2087
|
return overrideErrorMap;
|
|
1951
2088
|
}
|
|
2089
|
+
|
|
2090
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
1952
2091
|
var makeIssue = (params) => {
|
|
1953
2092
|
const { data, path, errorMaps, issueData } = params;
|
|
1954
2093
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -1988,7 +2127,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
1988
2127
|
// then schema-bound map if available
|
|
1989
2128
|
overrideMap,
|
|
1990
2129
|
// then global override map
|
|
1991
|
-
overrideMap ===
|
|
2130
|
+
overrideMap === en_default ? void 0 : en_default
|
|
1992
2131
|
// then global default map
|
|
1993
2132
|
].filter((x) => !!x)
|
|
1994
2133
|
});
|
|
@@ -2057,29 +2196,15 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
2057
2196
|
var isDirty = (x) => x.status === "dirty";
|
|
2058
2197
|
var isValid = (x) => x.status === "valid";
|
|
2059
2198
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
2063
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2064
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2065
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2066
|
-
}
|
|
2067
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2068
|
-
if (kind === "m")
|
|
2069
|
-
throw new TypeError("Private method is not writable");
|
|
2070
|
-
if (kind === "a" && !f)
|
|
2071
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
2072
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2073
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2074
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2075
|
-
}
|
|
2199
|
+
|
|
2200
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
2076
2201
|
var errorUtil;
|
|
2077
2202
|
(function(errorUtil2) {
|
|
2078
2203
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2079
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
2204
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
2080
2205
|
})(errorUtil || (errorUtil = {}));
|
|
2081
|
-
|
|
2082
|
-
|
|
2206
|
+
|
|
2207
|
+
// ../../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
|
|
2083
2208
|
var ParseInputLazyPath = class {
|
|
2084
2209
|
constructor(parent, value, path, key) {
|
|
2085
2210
|
this._cachedPath = [];
|
|
@@ -2090,7 +2215,7 @@ var ParseInputLazyPath = class {
|
|
|
2090
2215
|
}
|
|
2091
2216
|
get path() {
|
|
2092
2217
|
if (!this._cachedPath.length) {
|
|
2093
|
-
if (this._key
|
|
2218
|
+
if (Array.isArray(this._key)) {
|
|
2094
2219
|
this._cachedPath.push(...this._path, ...this._key);
|
|
2095
2220
|
} else {
|
|
2096
2221
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -2128,17 +2253,16 @@ function processCreateParams(params) {
|
|
|
2128
2253
|
if (errorMap2)
|
|
2129
2254
|
return { errorMap: errorMap2, description };
|
|
2130
2255
|
const customMap = (iss, ctx) => {
|
|
2131
|
-
var _a, _b;
|
|
2132
2256
|
const { message } = params;
|
|
2133
2257
|
if (iss.code === "invalid_enum_value") {
|
|
2134
|
-
return { message: message
|
|
2258
|
+
return { message: message ?? ctx.defaultError };
|
|
2135
2259
|
}
|
|
2136
2260
|
if (typeof ctx.data === "undefined") {
|
|
2137
|
-
return { message:
|
|
2261
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
2138
2262
|
}
|
|
2139
2263
|
if (iss.code !== "invalid_type")
|
|
2140
2264
|
return { message: ctx.defaultError };
|
|
2141
|
-
return { message:
|
|
2265
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
2142
2266
|
};
|
|
2143
2267
|
return { errorMap: customMap, description };
|
|
2144
2268
|
}
|
|
@@ -2190,14 +2314,13 @@ var ZodType = class {
|
|
|
2190
2314
|
throw result.error;
|
|
2191
2315
|
}
|
|
2192
2316
|
safeParse(data, params) {
|
|
2193
|
-
var _a;
|
|
2194
2317
|
const ctx = {
|
|
2195
2318
|
common: {
|
|
2196
2319
|
issues: [],
|
|
2197
|
-
async:
|
|
2198
|
-
contextualErrorMap: params
|
|
2320
|
+
async: params?.async ?? false,
|
|
2321
|
+
contextualErrorMap: params?.errorMap
|
|
2199
2322
|
},
|
|
2200
|
-
path:
|
|
2323
|
+
path: params?.path || [],
|
|
2201
2324
|
schemaErrorMap: this._def.errorMap,
|
|
2202
2325
|
parent: null,
|
|
2203
2326
|
data,
|
|
@@ -2207,7 +2330,6 @@ var ZodType = class {
|
|
|
2207
2330
|
return handleResult(ctx, result);
|
|
2208
2331
|
}
|
|
2209
2332
|
"~validate"(data) {
|
|
2210
|
-
var _a, _b;
|
|
2211
2333
|
const ctx = {
|
|
2212
2334
|
common: {
|
|
2213
2335
|
issues: [],
|
|
@@ -2228,7 +2350,7 @@ var ZodType = class {
|
|
|
2228
2350
|
issues: ctx.common.issues
|
|
2229
2351
|
};
|
|
2230
2352
|
} catch (err) {
|
|
2231
|
-
if (
|
|
2353
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
2232
2354
|
this["~standard"].async = true;
|
|
2233
2355
|
}
|
|
2234
2356
|
ctx.common = {
|
|
@@ -2253,10 +2375,10 @@ var ZodType = class {
|
|
|
2253
2375
|
const ctx = {
|
|
2254
2376
|
common: {
|
|
2255
2377
|
issues: [],
|
|
2256
|
-
contextualErrorMap: params
|
|
2378
|
+
contextualErrorMap: params?.errorMap,
|
|
2257
2379
|
async: true
|
|
2258
2380
|
},
|
|
2259
|
-
path:
|
|
2381
|
+
path: params?.path || [],
|
|
2260
2382
|
schemaErrorMap: this._def.errorMap,
|
|
2261
2383
|
parent: null,
|
|
2262
2384
|
data,
|
|
@@ -2481,16 +2603,20 @@ function isValidJWT(jwt, alg) {
|
|
|
2481
2603
|
return false;
|
|
2482
2604
|
try {
|
|
2483
2605
|
const [header] = jwt.split(".");
|
|
2606
|
+
if (!header)
|
|
2607
|
+
return false;
|
|
2484
2608
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
2485
2609
|
const decoded = JSON.parse(atob(base64));
|
|
2486
2610
|
if (typeof decoded !== "object" || decoded === null)
|
|
2487
2611
|
return false;
|
|
2488
|
-
if (
|
|
2612
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
2613
|
+
return false;
|
|
2614
|
+
if (!decoded.alg)
|
|
2489
2615
|
return false;
|
|
2490
2616
|
if (alg && decoded.alg !== alg)
|
|
2491
2617
|
return false;
|
|
2492
2618
|
return true;
|
|
2493
|
-
} catch
|
|
2619
|
+
} catch {
|
|
2494
2620
|
return false;
|
|
2495
2621
|
}
|
|
2496
2622
|
}
|
|
@@ -2649,7 +2775,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2649
2775
|
} else if (check.kind === "url") {
|
|
2650
2776
|
try {
|
|
2651
2777
|
new URL(input.data);
|
|
2652
|
-
} catch
|
|
2778
|
+
} catch {
|
|
2653
2779
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2654
2780
|
addIssueToContext(ctx, {
|
|
2655
2781
|
validation: "url",
|
|
@@ -2861,7 +2987,6 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2861
2987
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2862
2988
|
}
|
|
2863
2989
|
datetime(options) {
|
|
2864
|
-
var _a, _b;
|
|
2865
2990
|
if (typeof options === "string") {
|
|
2866
2991
|
return this._addCheck({
|
|
2867
2992
|
kind: "datetime",
|
|
@@ -2873,10 +2998,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2873
2998
|
}
|
|
2874
2999
|
return this._addCheck({
|
|
2875
3000
|
kind: "datetime",
|
|
2876
|
-
precision: typeof
|
|
2877
|
-
offset:
|
|
2878
|
-
local:
|
|
2879
|
-
...errorUtil.errToObj(options
|
|
3001
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3002
|
+
offset: options?.offset ?? false,
|
|
3003
|
+
local: options?.local ?? false,
|
|
3004
|
+
...errorUtil.errToObj(options?.message)
|
|
2880
3005
|
});
|
|
2881
3006
|
}
|
|
2882
3007
|
date(message) {
|
|
@@ -2892,8 +3017,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2892
3017
|
}
|
|
2893
3018
|
return this._addCheck({
|
|
2894
3019
|
kind: "time",
|
|
2895
|
-
precision: typeof
|
|
2896
|
-
...errorUtil.errToObj(options
|
|
3020
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3021
|
+
...errorUtil.errToObj(options?.message)
|
|
2897
3022
|
});
|
|
2898
3023
|
}
|
|
2899
3024
|
duration(message) {
|
|
@@ -2910,8 +3035,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
2910
3035
|
return this._addCheck({
|
|
2911
3036
|
kind: "includes",
|
|
2912
3037
|
value,
|
|
2913
|
-
position: options
|
|
2914
|
-
...errorUtil.errToObj(options
|
|
3038
|
+
position: options?.position,
|
|
3039
|
+
...errorUtil.errToObj(options?.message)
|
|
2915
3040
|
});
|
|
2916
3041
|
}
|
|
2917
3042
|
startsWith(value, message) {
|
|
@@ -3043,11 +3168,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
3043
3168
|
}
|
|
3044
3169
|
};
|
|
3045
3170
|
ZodString.create = (params) => {
|
|
3046
|
-
var _a;
|
|
3047
3171
|
return new ZodString({
|
|
3048
3172
|
checks: [],
|
|
3049
3173
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
3050
|
-
coerce:
|
|
3174
|
+
coerce: params?.coerce ?? false,
|
|
3051
3175
|
...processCreateParams(params)
|
|
3052
3176
|
});
|
|
3053
3177
|
};
|
|
@@ -3055,9 +3179,9 @@ function floatSafeRemainder(val, step) {
|
|
|
3055
3179
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
3056
3180
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
3057
3181
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
3058
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3059
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3060
|
-
return valInt % stepInt /
|
|
3182
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3183
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3184
|
+
return valInt % stepInt / 10 ** decCount;
|
|
3061
3185
|
}
|
|
3062
3186
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
3063
3187
|
constructor() {
|
|
@@ -3267,7 +3391,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
3267
3391
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
3268
3392
|
}
|
|
3269
3393
|
get isFinite() {
|
|
3270
|
-
let max = null
|
|
3394
|
+
let max = null;
|
|
3395
|
+
let min = null;
|
|
3271
3396
|
for (const ch of this._def.checks) {
|
|
3272
3397
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
3273
3398
|
return true;
|
|
@@ -3286,7 +3411,7 @@ ZodNumber.create = (params) => {
|
|
|
3286
3411
|
return new ZodNumber({
|
|
3287
3412
|
checks: [],
|
|
3288
3413
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
3289
|
-
coerce:
|
|
3414
|
+
coerce: params?.coerce || false,
|
|
3290
3415
|
...processCreateParams(params)
|
|
3291
3416
|
});
|
|
3292
3417
|
};
|
|
@@ -3300,7 +3425,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3300
3425
|
if (this._def.coerce) {
|
|
3301
3426
|
try {
|
|
3302
3427
|
input.data = BigInt(input.data);
|
|
3303
|
-
} catch
|
|
3428
|
+
} catch {
|
|
3304
3429
|
return this._getInvalidInput(input);
|
|
3305
3430
|
}
|
|
3306
3431
|
}
|
|
@@ -3455,11 +3580,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
3455
3580
|
}
|
|
3456
3581
|
};
|
|
3457
3582
|
ZodBigInt.create = (params) => {
|
|
3458
|
-
var _a;
|
|
3459
3583
|
return new ZodBigInt({
|
|
3460
3584
|
checks: [],
|
|
3461
3585
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3462
|
-
coerce:
|
|
3586
|
+
coerce: params?.coerce ?? false,
|
|
3463
3587
|
...processCreateParams(params)
|
|
3464
3588
|
});
|
|
3465
3589
|
};
|
|
@@ -3484,7 +3608,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
3484
3608
|
ZodBoolean.create = (params) => {
|
|
3485
3609
|
return new ZodBoolean({
|
|
3486
3610
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3487
|
-
coerce:
|
|
3611
|
+
coerce: params?.coerce || false,
|
|
3488
3612
|
...processCreateParams(params)
|
|
3489
3613
|
});
|
|
3490
3614
|
};
|
|
@@ -3503,7 +3627,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3503
3627
|
});
|
|
3504
3628
|
return INVALID;
|
|
3505
3629
|
}
|
|
3506
|
-
if (isNaN(input.data.getTime())) {
|
|
3630
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
3507
3631
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3508
3632
|
addIssueToContext(ctx2, {
|
|
3509
3633
|
code: ZodIssueCode.invalid_date
|
|
@@ -3592,7 +3716,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
3592
3716
|
ZodDate.create = (params) => {
|
|
3593
3717
|
return new ZodDate({
|
|
3594
3718
|
checks: [],
|
|
3595
|
-
coerce:
|
|
3719
|
+
coerce: params?.coerce || false,
|
|
3596
3720
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3597
3721
|
...processCreateParams(params)
|
|
3598
3722
|
});
|
|
@@ -3867,7 +3991,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3867
3991
|
return this._cached;
|
|
3868
3992
|
const shape = this._def.shape();
|
|
3869
3993
|
const keys = util.objectKeys(shape);
|
|
3870
|
-
|
|
3994
|
+
this._cached = { shape, keys };
|
|
3995
|
+
return this._cached;
|
|
3871
3996
|
}
|
|
3872
3997
|
_parse(input) {
|
|
3873
3998
|
const parsedType = this._getType(input);
|
|
@@ -3917,9 +4042,8 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3917
4042
|
});
|
|
3918
4043
|
status.dirty();
|
|
3919
4044
|
}
|
|
3920
|
-
} else if (unknownKeys === "strip")
|
|
3921
|
-
|
|
3922
|
-
else {
|
|
4045
|
+
} else if (unknownKeys === "strip") {
|
|
4046
|
+
} else {
|
|
3923
4047
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3924
4048
|
}
|
|
3925
4049
|
} else {
|
|
@@ -3966,11 +4090,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
3966
4090
|
unknownKeys: "strict",
|
|
3967
4091
|
...message !== void 0 ? {
|
|
3968
4092
|
errorMap: (issue, ctx) => {
|
|
3969
|
-
|
|
3970
|
-
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;
|
|
4093
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
3971
4094
|
if (issue.code === "unrecognized_keys")
|
|
3972
4095
|
return {
|
|
3973
|
-
message:
|
|
4096
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
3974
4097
|
};
|
|
3975
4098
|
return {
|
|
3976
4099
|
message: defaultError
|
|
@@ -4101,11 +4224,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4101
4224
|
}
|
|
4102
4225
|
pick(mask) {
|
|
4103
4226
|
const shape = {};
|
|
4104
|
-
util.objectKeys(mask)
|
|
4227
|
+
for (const key of util.objectKeys(mask)) {
|
|
4105
4228
|
if (mask[key] && this.shape[key]) {
|
|
4106
4229
|
shape[key] = this.shape[key];
|
|
4107
4230
|
}
|
|
4108
|
-
}
|
|
4231
|
+
}
|
|
4109
4232
|
return new _ZodObject({
|
|
4110
4233
|
...this._def,
|
|
4111
4234
|
shape: () => shape
|
|
@@ -4113,11 +4236,11 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4113
4236
|
}
|
|
4114
4237
|
omit(mask) {
|
|
4115
4238
|
const shape = {};
|
|
4116
|
-
util.objectKeys(this.shape)
|
|
4239
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4117
4240
|
if (!mask[key]) {
|
|
4118
4241
|
shape[key] = this.shape[key];
|
|
4119
4242
|
}
|
|
4120
|
-
}
|
|
4243
|
+
}
|
|
4121
4244
|
return new _ZodObject({
|
|
4122
4245
|
...this._def,
|
|
4123
4246
|
shape: () => shape
|
|
@@ -4131,14 +4254,14 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4131
4254
|
}
|
|
4132
4255
|
partial(mask) {
|
|
4133
4256
|
const newShape = {};
|
|
4134
|
-
util.objectKeys(this.shape)
|
|
4257
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4135
4258
|
const fieldSchema = this.shape[key];
|
|
4136
4259
|
if (mask && !mask[key]) {
|
|
4137
4260
|
newShape[key] = fieldSchema;
|
|
4138
4261
|
} else {
|
|
4139
4262
|
newShape[key] = fieldSchema.optional();
|
|
4140
4263
|
}
|
|
4141
|
-
}
|
|
4264
|
+
}
|
|
4142
4265
|
return new _ZodObject({
|
|
4143
4266
|
...this._def,
|
|
4144
4267
|
shape: () => newShape
|
|
@@ -4146,7 +4269,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4146
4269
|
}
|
|
4147
4270
|
required(mask) {
|
|
4148
4271
|
const newShape = {};
|
|
4149
|
-
util.objectKeys(this.shape)
|
|
4272
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4150
4273
|
if (mask && !mask[key]) {
|
|
4151
4274
|
newShape[key] = this.shape[key];
|
|
4152
4275
|
} else {
|
|
@@ -4157,7 +4280,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
4157
4280
|
}
|
|
4158
4281
|
newShape[key] = newField;
|
|
4159
4282
|
}
|
|
4160
|
-
}
|
|
4283
|
+
}
|
|
4161
4284
|
return new _ZodObject({
|
|
4162
4285
|
...this._def,
|
|
4163
4286
|
shape: () => newShape
|
|
@@ -4773,12 +4896,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4773
4896
|
return makeIssue({
|
|
4774
4897
|
data: args,
|
|
4775
4898
|
path: ctx.path,
|
|
4776
|
-
errorMaps: [
|
|
4777
|
-
ctx.common.contextualErrorMap,
|
|
4778
|
-
ctx.schemaErrorMap,
|
|
4779
|
-
getErrorMap(),
|
|
4780
|
-
errorMap
|
|
4781
|
-
].filter((x) => !!x),
|
|
4899
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4782
4900
|
issueData: {
|
|
4783
4901
|
code: ZodIssueCode.invalid_arguments,
|
|
4784
4902
|
argumentsError: error
|
|
@@ -4789,12 +4907,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
4789
4907
|
return makeIssue({
|
|
4790
4908
|
data: returns,
|
|
4791
4909
|
path: ctx.path,
|
|
4792
|
-
errorMaps: [
|
|
4793
|
-
ctx.common.contextualErrorMap,
|
|
4794
|
-
ctx.schemaErrorMap,
|
|
4795
|
-
getErrorMap(),
|
|
4796
|
-
errorMap
|
|
4797
|
-
].filter((x) => !!x),
|
|
4910
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4798
4911
|
issueData: {
|
|
4799
4912
|
code: ZodIssueCode.invalid_return_type,
|
|
4800
4913
|
returnTypeError: error
|
|
@@ -4918,10 +5031,6 @@ function createZodEnum(values, params) {
|
|
|
4918
5031
|
});
|
|
4919
5032
|
}
|
|
4920
5033
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4921
|
-
constructor() {
|
|
4922
|
-
super(...arguments);
|
|
4923
|
-
_ZodEnum_cache.set(this, void 0);
|
|
4924
|
-
}
|
|
4925
5034
|
_parse(input) {
|
|
4926
5035
|
if (typeof input.data !== "string") {
|
|
4927
5036
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -4933,10 +5042,10 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4933
5042
|
});
|
|
4934
5043
|
return INVALID;
|
|
4935
5044
|
}
|
|
4936
|
-
if (!
|
|
4937
|
-
|
|
5045
|
+
if (!this._cache) {
|
|
5046
|
+
this._cache = new Set(this._def.values);
|
|
4938
5047
|
}
|
|
4939
|
-
if (!
|
|
5048
|
+
if (!this._cache.has(input.data)) {
|
|
4940
5049
|
const ctx = this._getOrReturnCtx(input);
|
|
4941
5050
|
const expectedValues = this._def.values;
|
|
4942
5051
|
addIssueToContext(ctx, {
|
|
@@ -4985,13 +5094,8 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
4985
5094
|
});
|
|
4986
5095
|
}
|
|
4987
5096
|
};
|
|
4988
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
4989
5097
|
ZodEnum.create = createZodEnum;
|
|
4990
5098
|
var ZodNativeEnum = class extends ZodType {
|
|
4991
|
-
constructor() {
|
|
4992
|
-
super(...arguments);
|
|
4993
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
4994
|
-
}
|
|
4995
5099
|
_parse(input) {
|
|
4996
5100
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
4997
5101
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5004,10 +5108,10 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
5004
5108
|
});
|
|
5005
5109
|
return INVALID;
|
|
5006
5110
|
}
|
|
5007
|
-
if (!
|
|
5008
|
-
|
|
5111
|
+
if (!this._cache) {
|
|
5112
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
5009
5113
|
}
|
|
5010
|
-
if (!
|
|
5114
|
+
if (!this._cache.has(input.data)) {
|
|
5011
5115
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
5012
5116
|
addIssueToContext(ctx, {
|
|
5013
5117
|
received: ctx.data,
|
|
@@ -5022,7 +5126,6 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
5022
5126
|
return this._def.values;
|
|
5023
5127
|
}
|
|
5024
5128
|
};
|
|
5025
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5026
5129
|
ZodNativeEnum.create = (values, params) => {
|
|
5027
5130
|
return new ZodNativeEnum({
|
|
5028
5131
|
values,
|
|
@@ -5163,7 +5266,7 @@ var ZodEffects = class extends ZodType {
|
|
|
5163
5266
|
parent: ctx
|
|
5164
5267
|
});
|
|
5165
5268
|
if (!isValid(base))
|
|
5166
|
-
return
|
|
5269
|
+
return INVALID;
|
|
5167
5270
|
const result = effect.transform(base.value, checkCtx);
|
|
5168
5271
|
if (result instanceof Promise) {
|
|
5169
5272
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -5172,8 +5275,11 @@ var ZodEffects = class extends ZodType {
|
|
|
5172
5275
|
} else {
|
|
5173
5276
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
5174
5277
|
if (!isValid(base))
|
|
5175
|
-
return
|
|
5176
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5278
|
+
return INVALID;
|
|
5279
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5280
|
+
status: status.value,
|
|
5281
|
+
value: result
|
|
5282
|
+
}));
|
|
5177
5283
|
});
|
|
5178
5284
|
}
|
|
5179
5285
|
}
|
|
@@ -5433,21 +5539,19 @@ function cleanParams(params, data) {
|
|
|
5433
5539
|
function custom(check, _params = {}, fatal) {
|
|
5434
5540
|
if (check)
|
|
5435
5541
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5436
|
-
var _a, _b;
|
|
5437
5542
|
const r = check(data);
|
|
5438
5543
|
if (r instanceof Promise) {
|
|
5439
5544
|
return r.then((r2) => {
|
|
5440
|
-
var _a2, _b2;
|
|
5441
5545
|
if (!r2) {
|
|
5442
5546
|
const params = cleanParams(_params, data);
|
|
5443
|
-
const _fatal =
|
|
5547
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5444
5548
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5445
5549
|
}
|
|
5446
5550
|
});
|
|
5447
5551
|
}
|
|
5448
5552
|
if (!r) {
|
|
5449
5553
|
const params = cleanParams(_params, data);
|
|
5450
|
-
const _fatal =
|
|
5554
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5451
5555
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5452
5556
|
}
|
|
5453
5557
|
return;
|
|
@@ -5547,122 +5651,6 @@ var coerce = {
|
|
|
5547
5651
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5548
5652
|
};
|
|
5549
5653
|
var NEVER = INVALID;
|
|
5550
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
5551
|
-
__proto__: null,
|
|
5552
|
-
defaultErrorMap: errorMap,
|
|
5553
|
-
setErrorMap,
|
|
5554
|
-
getErrorMap,
|
|
5555
|
-
makeIssue,
|
|
5556
|
-
EMPTY_PATH,
|
|
5557
|
-
addIssueToContext,
|
|
5558
|
-
ParseStatus,
|
|
5559
|
-
INVALID,
|
|
5560
|
-
DIRTY,
|
|
5561
|
-
OK,
|
|
5562
|
-
isAborted,
|
|
5563
|
-
isDirty,
|
|
5564
|
-
isValid,
|
|
5565
|
-
isAsync,
|
|
5566
|
-
get util() {
|
|
5567
|
-
return util;
|
|
5568
|
-
},
|
|
5569
|
-
get objectUtil() {
|
|
5570
|
-
return objectUtil;
|
|
5571
|
-
},
|
|
5572
|
-
ZodParsedType,
|
|
5573
|
-
getParsedType,
|
|
5574
|
-
ZodType,
|
|
5575
|
-
datetimeRegex,
|
|
5576
|
-
ZodString,
|
|
5577
|
-
ZodNumber,
|
|
5578
|
-
ZodBigInt,
|
|
5579
|
-
ZodBoolean,
|
|
5580
|
-
ZodDate,
|
|
5581
|
-
ZodSymbol,
|
|
5582
|
-
ZodUndefined,
|
|
5583
|
-
ZodNull,
|
|
5584
|
-
ZodAny,
|
|
5585
|
-
ZodUnknown,
|
|
5586
|
-
ZodNever,
|
|
5587
|
-
ZodVoid,
|
|
5588
|
-
ZodArray,
|
|
5589
|
-
ZodObject,
|
|
5590
|
-
ZodUnion,
|
|
5591
|
-
ZodDiscriminatedUnion,
|
|
5592
|
-
ZodIntersection,
|
|
5593
|
-
ZodTuple,
|
|
5594
|
-
ZodRecord,
|
|
5595
|
-
ZodMap,
|
|
5596
|
-
ZodSet,
|
|
5597
|
-
ZodFunction,
|
|
5598
|
-
ZodLazy,
|
|
5599
|
-
ZodLiteral,
|
|
5600
|
-
ZodEnum,
|
|
5601
|
-
ZodNativeEnum,
|
|
5602
|
-
ZodPromise,
|
|
5603
|
-
ZodEffects,
|
|
5604
|
-
ZodTransformer: ZodEffects,
|
|
5605
|
-
ZodOptional,
|
|
5606
|
-
ZodNullable,
|
|
5607
|
-
ZodDefault,
|
|
5608
|
-
ZodCatch,
|
|
5609
|
-
ZodNaN,
|
|
5610
|
-
BRAND,
|
|
5611
|
-
ZodBranded,
|
|
5612
|
-
ZodPipeline,
|
|
5613
|
-
ZodReadonly,
|
|
5614
|
-
custom,
|
|
5615
|
-
Schema: ZodType,
|
|
5616
|
-
ZodSchema: ZodType,
|
|
5617
|
-
late,
|
|
5618
|
-
get ZodFirstPartyTypeKind() {
|
|
5619
|
-
return ZodFirstPartyTypeKind;
|
|
5620
|
-
},
|
|
5621
|
-
coerce,
|
|
5622
|
-
any: anyType,
|
|
5623
|
-
array: arrayType,
|
|
5624
|
-
bigint: bigIntType,
|
|
5625
|
-
boolean: booleanType,
|
|
5626
|
-
date: dateType,
|
|
5627
|
-
discriminatedUnion: discriminatedUnionType,
|
|
5628
|
-
effect: effectsType,
|
|
5629
|
-
"enum": enumType,
|
|
5630
|
-
"function": functionType,
|
|
5631
|
-
"instanceof": instanceOfType,
|
|
5632
|
-
intersection: intersectionType,
|
|
5633
|
-
lazy: lazyType,
|
|
5634
|
-
literal: literalType,
|
|
5635
|
-
map: mapType,
|
|
5636
|
-
nan: nanType,
|
|
5637
|
-
nativeEnum: nativeEnumType,
|
|
5638
|
-
never: neverType,
|
|
5639
|
-
"null": nullType,
|
|
5640
|
-
nullable: nullableType,
|
|
5641
|
-
number: numberType,
|
|
5642
|
-
object: objectType,
|
|
5643
|
-
oboolean,
|
|
5644
|
-
onumber,
|
|
5645
|
-
optional: optionalType,
|
|
5646
|
-
ostring,
|
|
5647
|
-
pipeline: pipelineType,
|
|
5648
|
-
preprocess: preprocessType,
|
|
5649
|
-
promise: promiseType,
|
|
5650
|
-
record: recordType,
|
|
5651
|
-
set: setType,
|
|
5652
|
-
strictObject: strictObjectType,
|
|
5653
|
-
string: stringType,
|
|
5654
|
-
symbol: symbolType,
|
|
5655
|
-
transformer: effectsType,
|
|
5656
|
-
tuple: tupleType,
|
|
5657
|
-
"undefined": undefinedType,
|
|
5658
|
-
union: unionType,
|
|
5659
|
-
unknown: unknownType,
|
|
5660
|
-
"void": voidType,
|
|
5661
|
-
NEVER,
|
|
5662
|
-
ZodIssueCode,
|
|
5663
|
-
quotelessJson,
|
|
5664
|
-
ZodError
|
|
5665
|
-
});
|
|
5666
5654
|
|
|
5667
5655
|
// ../../core/models/book.ts
|
|
5668
5656
|
var BookDesignRequest = class {
|
|
@@ -5687,29 +5675,29 @@ var BookDesignRequest = class {
|
|
|
5687
5675
|
this.text_sticker_level = props.text_sticker_level;
|
|
5688
5676
|
}
|
|
5689
5677
|
};
|
|
5690
|
-
var bookDesignRequestSchema =
|
|
5691
|
-
occasion:
|
|
5692
|
-
style:
|
|
5693
|
-
book_size:
|
|
5694
|
-
cover_type:
|
|
5695
|
-
page_type:
|
|
5696
|
-
image_density:
|
|
5697
|
-
image_filtering_level:
|
|
5698
|
-
embellishment_level:
|
|
5699
|
-
text_sticker_level:
|
|
5678
|
+
var bookDesignRequestSchema = external_exports.object({
|
|
5679
|
+
occasion: external_exports.enum(occasions),
|
|
5680
|
+
style: external_exports.string(),
|
|
5681
|
+
book_size: external_exports.enum(bookSizes),
|
|
5682
|
+
cover_type: external_exports.enum(coverTypes),
|
|
5683
|
+
page_type: external_exports.enum(pageTypes),
|
|
5684
|
+
image_density: external_exports.enum(imageDensities),
|
|
5685
|
+
image_filtering_level: external_exports.enum(imageFilteringLevels),
|
|
5686
|
+
embellishment_level: external_exports.enum(embellishmentLevels),
|
|
5687
|
+
text_sticker_level: external_exports.enum(textStickerLevels)
|
|
5700
5688
|
});
|
|
5701
|
-
var bookPropsSchema =
|
|
5702
|
-
id:
|
|
5703
|
-
title:
|
|
5704
|
-
subtitle:
|
|
5689
|
+
var bookPropsSchema = external_exports.object({
|
|
5690
|
+
id: external_exports.string().optional(),
|
|
5691
|
+
title: external_exports.string(),
|
|
5692
|
+
subtitle: external_exports.string().optional(),
|
|
5705
5693
|
design_request: bookDesignRequestSchema,
|
|
5706
|
-
sku:
|
|
5707
|
-
state:
|
|
5708
|
-
guid:
|
|
5709
|
-
cancelled_at:
|
|
5710
|
-
mb_client_timeout:
|
|
5711
|
-
user_id:
|
|
5712
|
-
revision:
|
|
5694
|
+
sku: external_exports.string().optional(),
|
|
5695
|
+
state: external_exports.enum(states).optional(),
|
|
5696
|
+
guid: external_exports.string().optional(),
|
|
5697
|
+
cancelled_at: external_exports.string().optional(),
|
|
5698
|
+
mb_client_timeout: external_exports.number().optional(),
|
|
5699
|
+
user_id: external_exports.string().optional(),
|
|
5700
|
+
revision: external_exports.number().optional()
|
|
5713
5701
|
});
|
|
5714
5702
|
var Book = class {
|
|
5715
5703
|
id;
|
|
@@ -5790,18 +5778,18 @@ var Images = class {
|
|
|
5790
5778
|
}
|
|
5791
5779
|
}
|
|
5792
5780
|
};
|
|
5793
|
-
var imageServerSchema =
|
|
5794
|
-
id:
|
|
5795
|
-
handle:
|
|
5796
|
-
url:
|
|
5797
|
-
width:
|
|
5798
|
-
height:
|
|
5799
|
-
orientation:
|
|
5800
|
-
taken_at:
|
|
5801
|
-
camera_make:
|
|
5802
|
-
camera:
|
|
5803
|
-
filename:
|
|
5804
|
-
metadata:
|
|
5781
|
+
var imageServerSchema = external_exports.object({
|
|
5782
|
+
id: external_exports.string().optional(),
|
|
5783
|
+
handle: external_exports.string(),
|
|
5784
|
+
url: external_exports.string(),
|
|
5785
|
+
width: external_exports.number(),
|
|
5786
|
+
height: external_exports.number(),
|
|
5787
|
+
orientation: external_exports.number(),
|
|
5788
|
+
taken_at: external_exports.string(),
|
|
5789
|
+
camera_make: external_exports.string().optional(),
|
|
5790
|
+
camera: external_exports.string().optional(),
|
|
5791
|
+
filename: external_exports.string(),
|
|
5792
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5805
5793
|
});
|
|
5806
5794
|
var ImageServer = class {
|
|
5807
5795
|
id;
|
|
@@ -5846,34 +5834,34 @@ function imageServerToImage(imageServer) {
|
|
|
5846
5834
|
}
|
|
5847
5835
|
|
|
5848
5836
|
// ../../core/models/design-request/design-options.ts
|
|
5849
|
-
var imageDensityOptionSchema =
|
|
5850
|
-
maxPageCount:
|
|
5851
|
-
minPageCount:
|
|
5852
|
-
maxImageCount:
|
|
5853
|
-
avgImageCount:
|
|
5854
|
-
minImageCount:
|
|
5837
|
+
var imageDensityOptionSchema = external_exports.object({
|
|
5838
|
+
maxPageCount: external_exports.number(),
|
|
5839
|
+
minPageCount: external_exports.number(),
|
|
5840
|
+
maxImageCount: external_exports.number(),
|
|
5841
|
+
avgImageCount: external_exports.number(),
|
|
5842
|
+
minImageCount: external_exports.number()
|
|
5855
5843
|
});
|
|
5856
|
-
var imageDensityOptionsSchema =
|
|
5844
|
+
var imageDensityOptionsSchema = external_exports.object({
|
|
5857
5845
|
high: imageDensityOptionSchema,
|
|
5858
5846
|
medium: imageDensityOptionSchema,
|
|
5859
5847
|
low: imageDensityOptionSchema
|
|
5860
5848
|
});
|
|
5861
|
-
var designOptionsSchema =
|
|
5849
|
+
var designOptionsSchema = external_exports.object({
|
|
5862
5850
|
densities: imageDensityOptionsSchema
|
|
5863
5851
|
});
|
|
5864
|
-
var imageDensityOptionServerSchema =
|
|
5865
|
-
max_page_count:
|
|
5866
|
-
min_page_count:
|
|
5867
|
-
max_image_count:
|
|
5868
|
-
avg_image_count:
|
|
5869
|
-
min_image_count:
|
|
5852
|
+
var imageDensityOptionServerSchema = external_exports.object({
|
|
5853
|
+
max_page_count: external_exports.number(),
|
|
5854
|
+
min_page_count: external_exports.number(),
|
|
5855
|
+
max_image_count: external_exports.number(),
|
|
5856
|
+
avg_image_count: external_exports.number(),
|
|
5857
|
+
min_image_count: external_exports.number()
|
|
5870
5858
|
});
|
|
5871
|
-
var imageDensityOptionsServerSchema =
|
|
5859
|
+
var imageDensityOptionsServerSchema = external_exports.object({
|
|
5872
5860
|
high: imageDensityOptionServerSchema,
|
|
5873
5861
|
medium: imageDensityOptionServerSchema,
|
|
5874
5862
|
low: imageDensityOptionServerSchema
|
|
5875
5863
|
});
|
|
5876
|
-
var designOptionsServerSchema =
|
|
5864
|
+
var designOptionsServerSchema = external_exports.object({
|
|
5877
5865
|
densities: imageDensityOptionsServerSchema
|
|
5878
5866
|
});
|
|
5879
5867
|
|
|
@@ -6171,9 +6159,9 @@ var DesignOptionsEndpoints = class {
|
|
|
6171
6159
|
};
|
|
6172
6160
|
|
|
6173
6161
|
// ../../core/models/event.ts
|
|
6174
|
-
var eventContextSchema =
|
|
6175
|
-
var eventSchema =
|
|
6176
|
-
name:
|
|
6162
|
+
var eventContextSchema = external_exports.record(external_exports.string(), external_exports.unknown()).optional();
|
|
6163
|
+
var eventSchema = external_exports.object({
|
|
6164
|
+
name: external_exports.string(),
|
|
6177
6165
|
context: eventContextSchema
|
|
6178
6166
|
});
|
|
6179
6167
|
|
|
@@ -6263,7 +6251,7 @@ var ImagesEndpoints = class {
|
|
|
6263
6251
|
const res = await this.engineAPI.fetcher.call({
|
|
6264
6252
|
path: `/v1/images/book/${bookId}`
|
|
6265
6253
|
});
|
|
6266
|
-
return
|
|
6254
|
+
return external_exports.array(imageServerSchema).parse(res);
|
|
6267
6255
|
});
|
|
6268
6256
|
}
|
|
6269
6257
|
retrieve(imageId, bookId) {
|
|
@@ -6311,119 +6299,119 @@ var ImagesEndpoints = class {
|
|
|
6311
6299
|
};
|
|
6312
6300
|
|
|
6313
6301
|
// ../../core/models/spread.ts
|
|
6314
|
-
var spreadServerSchema =
|
|
6315
|
-
id:
|
|
6316
|
-
book_id:
|
|
6317
|
-
state:
|
|
6318
|
-
spread_type:
|
|
6319
|
-
width:
|
|
6320
|
-
height:
|
|
6321
|
-
sequence:
|
|
6322
|
-
wells:
|
|
6323
|
-
background:
|
|
6324
|
-
laid_out_at:
|
|
6325
|
-
embellished_at:
|
|
6326
|
-
polished_at:
|
|
6327
|
-
metadata:
|
|
6328
|
-
url:
|
|
6302
|
+
var spreadServerSchema = external_exports.object({
|
|
6303
|
+
id: external_exports.string(),
|
|
6304
|
+
book_id: external_exports.string(),
|
|
6305
|
+
state: external_exports.string(),
|
|
6306
|
+
spread_type: external_exports.string(),
|
|
6307
|
+
width: external_exports.number(),
|
|
6308
|
+
height: external_exports.number(),
|
|
6309
|
+
sequence: external_exports.number(),
|
|
6310
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6311
|
+
background: external_exports.unknown(),
|
|
6312
|
+
laid_out_at: external_exports.string().nullable(),
|
|
6313
|
+
embellished_at: external_exports.string().nullable(),
|
|
6314
|
+
polished_at: external_exports.string().nullable(),
|
|
6315
|
+
metadata: external_exports.unknown(),
|
|
6316
|
+
url: external_exports.string().nullable().optional()
|
|
6329
6317
|
});
|
|
6330
|
-
var spreadSchema =
|
|
6331
|
-
id:
|
|
6332
|
-
bookId:
|
|
6333
|
-
state:
|
|
6334
|
-
spreadType:
|
|
6335
|
-
width:
|
|
6336
|
-
height:
|
|
6337
|
-
sequence:
|
|
6338
|
-
wells:
|
|
6339
|
-
background:
|
|
6340
|
-
laidOutAt:
|
|
6341
|
-
embellishedAt:
|
|
6342
|
-
polishedAt:
|
|
6343
|
-
metadata:
|
|
6344
|
-
url:
|
|
6318
|
+
var spreadSchema = external_exports.object({
|
|
6319
|
+
id: external_exports.string(),
|
|
6320
|
+
bookId: external_exports.string(),
|
|
6321
|
+
state: external_exports.string(),
|
|
6322
|
+
spreadType: external_exports.string(),
|
|
6323
|
+
width: external_exports.number(),
|
|
6324
|
+
height: external_exports.number(),
|
|
6325
|
+
sequence: external_exports.number(),
|
|
6326
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6327
|
+
background: external_exports.unknown(),
|
|
6328
|
+
laidOutAt: external_exports.string().nullable(),
|
|
6329
|
+
embellishedAt: external_exports.string().nullable(),
|
|
6330
|
+
polishedAt: external_exports.string().nullable(),
|
|
6331
|
+
metadata: external_exports.unknown(),
|
|
6332
|
+
url: external_exports.string().nullable().optional()
|
|
6345
6333
|
});
|
|
6346
6334
|
|
|
6347
6335
|
// ../../core/models/galleon.ts
|
|
6348
|
-
var imageAssignmentSchema =
|
|
6349
|
-
photoRefId:
|
|
6350
|
-
finalCrop:
|
|
6336
|
+
var imageAssignmentSchema = external_exports.object({
|
|
6337
|
+
photoRefId: external_exports.string(),
|
|
6338
|
+
finalCrop: external_exports.array(external_exports.number())
|
|
6351
6339
|
});
|
|
6352
|
-
var positionSchema =
|
|
6353
|
-
x:
|
|
6354
|
-
y:
|
|
6355
|
-
width:
|
|
6356
|
-
height:
|
|
6357
|
-
rotation:
|
|
6340
|
+
var positionSchema = external_exports.object({
|
|
6341
|
+
x: external_exports.number(),
|
|
6342
|
+
y: external_exports.number(),
|
|
6343
|
+
width: external_exports.number().optional(),
|
|
6344
|
+
height: external_exports.number().optional(),
|
|
6345
|
+
rotation: external_exports.number()
|
|
6358
6346
|
});
|
|
6359
|
-
var photoMetadataSchema =
|
|
6360
|
-
id:
|
|
6361
|
-
llx:
|
|
6362
|
-
lly:
|
|
6363
|
-
urx:
|
|
6364
|
-
ury:
|
|
6365
|
-
data:
|
|
6366
|
-
title:
|
|
6367
|
-
width:
|
|
6368
|
-
effect:
|
|
6369
|
-
height:
|
|
6370
|
-
source:
|
|
6371
|
-
rotation:
|
|
6372
|
-
uploadTime:
|
|
6347
|
+
var photoMetadataSchema = external_exports.object({
|
|
6348
|
+
id: external_exports.string(),
|
|
6349
|
+
llx: external_exports.number(),
|
|
6350
|
+
lly: external_exports.number(),
|
|
6351
|
+
urx: external_exports.number(),
|
|
6352
|
+
ury: external_exports.number(),
|
|
6353
|
+
data: external_exports.string().nullable(),
|
|
6354
|
+
title: external_exports.string(),
|
|
6355
|
+
width: external_exports.number(),
|
|
6356
|
+
effect: external_exports.string(),
|
|
6357
|
+
height: external_exports.number(),
|
|
6358
|
+
source: external_exports.string(),
|
|
6359
|
+
rotation: external_exports.number(),
|
|
6360
|
+
uploadTime: external_exports.string()
|
|
6373
6361
|
});
|
|
6374
|
-
var propertySchema =
|
|
6375
|
-
key:
|
|
6376
|
-
value:
|
|
6362
|
+
var propertySchema = external_exports.object({
|
|
6363
|
+
key: external_exports.string(),
|
|
6364
|
+
value: external_exports.any()
|
|
6377
6365
|
});
|
|
6378
|
-
var assetSchema =
|
|
6379
|
-
type:
|
|
6366
|
+
var assetSchema = external_exports.object({
|
|
6367
|
+
type: external_exports.string(),
|
|
6380
6368
|
imageAssignment: imageAssignmentSchema.optional(),
|
|
6381
6369
|
position: positionSchema,
|
|
6382
|
-
seqNum:
|
|
6383
|
-
z:
|
|
6384
|
-
id:
|
|
6385
|
-
horizJustification:
|
|
6386
|
-
vertJustification:
|
|
6387
|
-
text:
|
|
6388
|
-
fontId:
|
|
6389
|
-
fontSize:
|
|
6390
|
-
fontColor:
|
|
6391
|
-
frame:
|
|
6370
|
+
seqNum: external_exports.number(),
|
|
6371
|
+
z: external_exports.number(),
|
|
6372
|
+
id: external_exports.string().optional(),
|
|
6373
|
+
horizJustification: external_exports.string().optional(),
|
|
6374
|
+
vertJustification: external_exports.string().optional().nullable(),
|
|
6375
|
+
text: external_exports.string().optional(),
|
|
6376
|
+
fontId: external_exports.string().optional(),
|
|
6377
|
+
fontSize: external_exports.number().optional(),
|
|
6378
|
+
fontColor: external_exports.string().optional(),
|
|
6379
|
+
frame: external_exports.string().optional()
|
|
6392
6380
|
});
|
|
6393
|
-
var photoStripSchema =
|
|
6394
|
-
url:
|
|
6395
|
-
encryptId:
|
|
6396
|
-
photoRefId:
|
|
6397
|
-
photoId:
|
|
6381
|
+
var photoStripSchema = external_exports.object({
|
|
6382
|
+
url: external_exports.string(),
|
|
6383
|
+
encryptId: external_exports.string(),
|
|
6384
|
+
photoRefId: external_exports.string(),
|
|
6385
|
+
photoId: external_exports.string(),
|
|
6398
6386
|
photoMetadata: photoMetadataSchema
|
|
6399
6387
|
});
|
|
6400
|
-
var reportingDataSchema =
|
|
6401
|
-
properties:
|
|
6388
|
+
var reportingDataSchema = external_exports.object({
|
|
6389
|
+
properties: external_exports.array(propertySchema)
|
|
6402
6390
|
});
|
|
6403
|
-
var sflyCanvasSchema =
|
|
6404
|
-
backgroundId:
|
|
6405
|
-
assets:
|
|
6391
|
+
var sflyCanvasSchema = external_exports.object({
|
|
6392
|
+
backgroundId: external_exports.string().nullable(),
|
|
6393
|
+
assets: external_exports.array(assetSchema).optional()
|
|
6406
6394
|
});
|
|
6407
|
-
var snapCanvasSchema =
|
|
6408
|
-
surfaceNumber:
|
|
6409
|
-
surfaceData:
|
|
6410
|
-
version:
|
|
6395
|
+
var snapCanvasSchema = external_exports.object({
|
|
6396
|
+
surfaceNumber: external_exports.number(),
|
|
6397
|
+
surfaceData: external_exports.record(external_exports.any()),
|
|
6398
|
+
version: external_exports.string()
|
|
6411
6399
|
});
|
|
6412
|
-
var pageSchema =
|
|
6413
|
-
pageNum:
|
|
6414
|
-
type:
|
|
6400
|
+
var pageSchema = external_exports.object({
|
|
6401
|
+
pageNum: external_exports.number(),
|
|
6402
|
+
type: external_exports.string(),
|
|
6415
6403
|
canvas: sflyCanvasSchema
|
|
6416
6404
|
});
|
|
6417
|
-
var magicShopBookSchema =
|
|
6418
|
-
pages:
|
|
6419
|
-
photoStrip:
|
|
6405
|
+
var magicShopBookSchema = external_exports.object({
|
|
6406
|
+
pages: external_exports.array(pageSchema),
|
|
6407
|
+
photoStrip: external_exports.array(photoStripSchema)
|
|
6420
6408
|
});
|
|
6421
|
-
var bookCreationRequestSchema =
|
|
6422
|
-
title:
|
|
6423
|
-
binding:
|
|
6424
|
-
coverSpecId:
|
|
6425
|
-
styleId:
|
|
6426
|
-
userId:
|
|
6409
|
+
var bookCreationRequestSchema = external_exports.object({
|
|
6410
|
+
title: external_exports.string(),
|
|
6411
|
+
binding: external_exports.string(),
|
|
6412
|
+
coverSpecId: external_exports.string(),
|
|
6413
|
+
styleId: external_exports.number(),
|
|
6414
|
+
userId: external_exports.string(),
|
|
6427
6415
|
magicShopBook: magicShopBookSchema,
|
|
6428
6416
|
reportingData: reportingDataSchema
|
|
6429
6417
|
});
|
|
@@ -6440,7 +6428,7 @@ var SpreadsEndpoints = class {
|
|
|
6440
6428
|
const res = await this.engineAPI.fetcher.call({
|
|
6441
6429
|
path: `/v1/spreads/book/${bookId}`
|
|
6442
6430
|
});
|
|
6443
|
-
return
|
|
6431
|
+
return external_exports.array(spreadServerSchema).parse(res);
|
|
6444
6432
|
});
|
|
6445
6433
|
}
|
|
6446
6434
|
create(bookId, spread) {
|
|
@@ -6506,98 +6494,98 @@ var SpreadsEndpoints = class {
|
|
|
6506
6494
|
})
|
|
6507
6495
|
}
|
|
6508
6496
|
});
|
|
6509
|
-
return
|
|
6497
|
+
return external_exports.array(surfaceCategoryName ? snapCanvasSchema : sflyCanvasSchema).parse(res);
|
|
6510
6498
|
});
|
|
6511
6499
|
}
|
|
6512
6500
|
};
|
|
6513
6501
|
|
|
6514
6502
|
// ../../core/models/storyboard-item.ts
|
|
6515
|
-
var StoryboardItemImageFaceServerSchema =
|
|
6516
|
-
score:
|
|
6517
|
-
bounding_box:
|
|
6518
|
-
x:
|
|
6519
|
-
y:
|
|
6520
|
-
width:
|
|
6521
|
-
height:
|
|
6503
|
+
var StoryboardItemImageFaceServerSchema = external_exports.object({
|
|
6504
|
+
score: external_exports.number(),
|
|
6505
|
+
bounding_box: external_exports.object({
|
|
6506
|
+
x: external_exports.number(),
|
|
6507
|
+
y: external_exports.number(),
|
|
6508
|
+
width: external_exports.number(),
|
|
6509
|
+
height: external_exports.number()
|
|
6522
6510
|
}),
|
|
6523
|
-
size:
|
|
6524
|
-
eyes_open_score:
|
|
6525
|
-
smile_score:
|
|
6526
|
-
facing_camera_score:
|
|
6511
|
+
size: external_exports.number(),
|
|
6512
|
+
eyes_open_score: external_exports.number(),
|
|
6513
|
+
smile_score: external_exports.number(),
|
|
6514
|
+
facing_camera_score: external_exports.number()
|
|
6527
6515
|
});
|
|
6528
|
-
var StoryboardItemImageFaceSchema =
|
|
6529
|
-
score:
|
|
6530
|
-
boundingBox:
|
|
6531
|
-
x:
|
|
6532
|
-
y:
|
|
6533
|
-
width:
|
|
6534
|
-
height:
|
|
6516
|
+
var StoryboardItemImageFaceSchema = external_exports.object({
|
|
6517
|
+
score: external_exports.number(),
|
|
6518
|
+
boundingBox: external_exports.object({
|
|
6519
|
+
x: external_exports.number(),
|
|
6520
|
+
y: external_exports.number(),
|
|
6521
|
+
width: external_exports.number(),
|
|
6522
|
+
height: external_exports.number()
|
|
6535
6523
|
}),
|
|
6536
|
-
size:
|
|
6537
|
-
eyesOpenScore:
|
|
6538
|
-
smileScore:
|
|
6539
|
-
facingCameraScore:
|
|
6524
|
+
size: external_exports.number(),
|
|
6525
|
+
eyesOpenScore: external_exports.number(),
|
|
6526
|
+
smileScore: external_exports.number(),
|
|
6527
|
+
facingCameraScore: external_exports.number()
|
|
6540
6528
|
});
|
|
6541
|
-
var StoryboardItemImageServerSchema =
|
|
6542
|
-
id:
|
|
6543
|
-
url:
|
|
6544
|
-
category:
|
|
6545
|
-
aesthetic_score:
|
|
6546
|
-
faces:
|
|
6547
|
-
roi:
|
|
6548
|
-
x:
|
|
6549
|
-
y:
|
|
6550
|
-
width:
|
|
6551
|
-
height:
|
|
6529
|
+
var StoryboardItemImageServerSchema = external_exports.object({
|
|
6530
|
+
id: external_exports.string(),
|
|
6531
|
+
url: external_exports.string(),
|
|
6532
|
+
category: external_exports.string(),
|
|
6533
|
+
aesthetic_score: external_exports.number(),
|
|
6534
|
+
faces: external_exports.array(StoryboardItemImageFaceServerSchema),
|
|
6535
|
+
roi: external_exports.object({
|
|
6536
|
+
x: external_exports.number(),
|
|
6537
|
+
y: external_exports.number(),
|
|
6538
|
+
width: external_exports.number(),
|
|
6539
|
+
height: external_exports.number()
|
|
6552
6540
|
}),
|
|
6553
|
-
taken_at:
|
|
6554
|
-
width:
|
|
6555
|
-
height:
|
|
6541
|
+
taken_at: external_exports.number(),
|
|
6542
|
+
width: external_exports.number(),
|
|
6543
|
+
height: external_exports.number()
|
|
6556
6544
|
});
|
|
6557
|
-
var StoryboardItemImageSchema =
|
|
6558
|
-
id:
|
|
6559
|
-
url:
|
|
6560
|
-
category:
|
|
6561
|
-
aestheticScore:
|
|
6562
|
-
faces:
|
|
6563
|
-
roi:
|
|
6564
|
-
x:
|
|
6565
|
-
y:
|
|
6566
|
-
width:
|
|
6567
|
-
height:
|
|
6545
|
+
var StoryboardItemImageSchema = external_exports.object({
|
|
6546
|
+
id: external_exports.string(),
|
|
6547
|
+
url: external_exports.string(),
|
|
6548
|
+
category: external_exports.string(),
|
|
6549
|
+
aestheticScore: external_exports.number(),
|
|
6550
|
+
faces: external_exports.array(StoryboardItemImageFaceSchema),
|
|
6551
|
+
roi: external_exports.object({
|
|
6552
|
+
x: external_exports.number(),
|
|
6553
|
+
y: external_exports.number(),
|
|
6554
|
+
width: external_exports.number(),
|
|
6555
|
+
height: external_exports.number()
|
|
6568
6556
|
}),
|
|
6569
|
-
takenAt:
|
|
6570
|
-
width:
|
|
6571
|
-
height:
|
|
6557
|
+
takenAt: external_exports.number(),
|
|
6558
|
+
width: external_exports.number(),
|
|
6559
|
+
height: external_exports.number()
|
|
6572
6560
|
});
|
|
6573
|
-
var StoryboardItemServerSchema =
|
|
6574
|
-
id:
|
|
6575
|
-
sequence:
|
|
6576
|
-
book_id:
|
|
6577
|
-
similarity:
|
|
6578
|
-
duplicate:
|
|
6579
|
-
selected:
|
|
6580
|
-
surface_weight:
|
|
6581
|
-
front_cover:
|
|
6582
|
-
back_cover:
|
|
6583
|
-
scene:
|
|
6584
|
-
subscene:
|
|
6585
|
-
spine_break:
|
|
6561
|
+
var StoryboardItemServerSchema = external_exports.object({
|
|
6562
|
+
id: external_exports.string(),
|
|
6563
|
+
sequence: external_exports.number(),
|
|
6564
|
+
book_id: external_exports.string(),
|
|
6565
|
+
similarity: external_exports.number(),
|
|
6566
|
+
duplicate: external_exports.boolean(),
|
|
6567
|
+
selected: external_exports.boolean(),
|
|
6568
|
+
surface_weight: external_exports.number(),
|
|
6569
|
+
front_cover: external_exports.boolean().optional(),
|
|
6570
|
+
back_cover: external_exports.boolean().optional(),
|
|
6571
|
+
scene: external_exports.number(),
|
|
6572
|
+
subscene: external_exports.number(),
|
|
6573
|
+
spine_break: external_exports.boolean().optional(),
|
|
6586
6574
|
image: StoryboardItemImageServerSchema
|
|
6587
6575
|
});
|
|
6588
|
-
var StoryboardItemSchema =
|
|
6589
|
-
id:
|
|
6590
|
-
sequence:
|
|
6591
|
-
bookId:
|
|
6592
|
-
similarity:
|
|
6593
|
-
duplicate:
|
|
6594
|
-
selected:
|
|
6595
|
-
surfaceWeight:
|
|
6596
|
-
frontCover:
|
|
6597
|
-
backCover:
|
|
6598
|
-
scene:
|
|
6599
|
-
subscene:
|
|
6600
|
-
spineBreak:
|
|
6576
|
+
var StoryboardItemSchema = external_exports.object({
|
|
6577
|
+
id: external_exports.string(),
|
|
6578
|
+
sequence: external_exports.number(),
|
|
6579
|
+
bookId: external_exports.string(),
|
|
6580
|
+
similarity: external_exports.number(),
|
|
6581
|
+
duplicate: external_exports.boolean(),
|
|
6582
|
+
selected: external_exports.boolean(),
|
|
6583
|
+
surfaceWeight: external_exports.number(),
|
|
6584
|
+
frontCover: external_exports.boolean().optional(),
|
|
6585
|
+
backCover: external_exports.boolean().optional(),
|
|
6586
|
+
scene: external_exports.number(),
|
|
6587
|
+
subscene: external_exports.number(),
|
|
6588
|
+
spineBreak: external_exports.boolean().optional(),
|
|
6601
6589
|
image: StoryboardItemImageSchema
|
|
6602
6590
|
});
|
|
6603
6591
|
|
|
@@ -6613,7 +6601,7 @@ var StoryboardItemsEndpoints = class {
|
|
|
6613
6601
|
const res = await this.engineAPI.fetcher.call({
|
|
6614
6602
|
path: `/v1/storyboarditems/book/${bookId}`
|
|
6615
6603
|
});
|
|
6616
|
-
return
|
|
6604
|
+
return external_exports.array(StoryboardItemServerSchema).parse(res);
|
|
6617
6605
|
});
|
|
6618
6606
|
}
|
|
6619
6607
|
};
|