@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.iife.js
CHANGED
|
@@ -71,6 +71,11 @@ var MagicLabs = (() => {
|
|
|
71
71
|
textStickerLevels: () => textStickerLevels,
|
|
72
72
|
timeoutEventDetail: () => timeoutEventDetail
|
|
73
73
|
});
|
|
74
|
+
var __defProp2 = Object.defineProperty;
|
|
75
|
+
var __export2 = (target, all) => {
|
|
76
|
+
for (var name in all)
|
|
77
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
78
|
+
};
|
|
74
79
|
var states = [
|
|
75
80
|
"new",
|
|
76
81
|
"ingesting",
|
|
@@ -291,6 +296,14 @@ var MagicLabs = (() => {
|
|
|
291
296
|
6166: { slug: "disney-mickey-and-friends-sfly" },
|
|
292
297
|
6169: { slug: "through-the-years-sfly" },
|
|
293
298
|
6172: { slug: "modern-editorial-moments-sfly" },
|
|
299
|
+
6173: { slug: "disneys-happily-ever-after-sfly" },
|
|
300
|
+
6176: { slug: "disney-mickey-and-friends-christmas-sfly" },
|
|
301
|
+
6177: { slug: "timeless-love-story-sfly" },
|
|
302
|
+
6178: { slug: "tiny-moments-sfly" },
|
|
303
|
+
6179: { slug: "travel-archives-sfly" },
|
|
304
|
+
6180: { slug: "illustrated-with-love-sfly" },
|
|
305
|
+
6183: { slug: "modern-school-yearbook-sfly" },
|
|
306
|
+
6186: { slug: "professional-portfolio-sfly" },
|
|
294
307
|
//snapfish styles
|
|
295
308
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
296
309
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -1666,9 +1679,120 @@ var MagicLabs = (() => {
|
|
|
1666
1679
|
}
|
|
1667
1680
|
return slug;
|
|
1668
1681
|
}
|
|
1682
|
+
var external_exports = {};
|
|
1683
|
+
__export2(external_exports, {
|
|
1684
|
+
BRAND: () => BRAND,
|
|
1685
|
+
DIRTY: () => DIRTY,
|
|
1686
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
1687
|
+
INVALID: () => INVALID,
|
|
1688
|
+
NEVER: () => NEVER,
|
|
1689
|
+
OK: () => OK,
|
|
1690
|
+
ParseStatus: () => ParseStatus,
|
|
1691
|
+
Schema: () => ZodType,
|
|
1692
|
+
ZodAny: () => ZodAny,
|
|
1693
|
+
ZodArray: () => ZodArray,
|
|
1694
|
+
ZodBigInt: () => ZodBigInt,
|
|
1695
|
+
ZodBoolean: () => ZodBoolean,
|
|
1696
|
+
ZodBranded: () => ZodBranded,
|
|
1697
|
+
ZodCatch: () => ZodCatch,
|
|
1698
|
+
ZodDate: () => ZodDate,
|
|
1699
|
+
ZodDefault: () => ZodDefault,
|
|
1700
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
1701
|
+
ZodEffects: () => ZodEffects,
|
|
1702
|
+
ZodEnum: () => ZodEnum,
|
|
1703
|
+
ZodError: () => ZodError,
|
|
1704
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1705
|
+
ZodFunction: () => ZodFunction,
|
|
1706
|
+
ZodIntersection: () => ZodIntersection,
|
|
1707
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
1708
|
+
ZodLazy: () => ZodLazy,
|
|
1709
|
+
ZodLiteral: () => ZodLiteral,
|
|
1710
|
+
ZodMap: () => ZodMap,
|
|
1711
|
+
ZodNaN: () => ZodNaN,
|
|
1712
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
1713
|
+
ZodNever: () => ZodNever,
|
|
1714
|
+
ZodNull: () => ZodNull,
|
|
1715
|
+
ZodNullable: () => ZodNullable,
|
|
1716
|
+
ZodNumber: () => ZodNumber,
|
|
1717
|
+
ZodObject: () => ZodObject,
|
|
1718
|
+
ZodOptional: () => ZodOptional,
|
|
1719
|
+
ZodParsedType: () => ZodParsedType,
|
|
1720
|
+
ZodPipeline: () => ZodPipeline,
|
|
1721
|
+
ZodPromise: () => ZodPromise,
|
|
1722
|
+
ZodReadonly: () => ZodReadonly,
|
|
1723
|
+
ZodRecord: () => ZodRecord,
|
|
1724
|
+
ZodSchema: () => ZodType,
|
|
1725
|
+
ZodSet: () => ZodSet,
|
|
1726
|
+
ZodString: () => ZodString,
|
|
1727
|
+
ZodSymbol: () => ZodSymbol,
|
|
1728
|
+
ZodTransformer: () => ZodEffects,
|
|
1729
|
+
ZodTuple: () => ZodTuple,
|
|
1730
|
+
ZodType: () => ZodType,
|
|
1731
|
+
ZodUndefined: () => ZodUndefined,
|
|
1732
|
+
ZodUnion: () => ZodUnion,
|
|
1733
|
+
ZodUnknown: () => ZodUnknown,
|
|
1734
|
+
ZodVoid: () => ZodVoid,
|
|
1735
|
+
addIssueToContext: () => addIssueToContext,
|
|
1736
|
+
any: () => anyType,
|
|
1737
|
+
array: () => arrayType,
|
|
1738
|
+
bigint: () => bigIntType,
|
|
1739
|
+
boolean: () => booleanType,
|
|
1740
|
+
coerce: () => coerce,
|
|
1741
|
+
custom: () => custom,
|
|
1742
|
+
date: () => dateType,
|
|
1743
|
+
datetimeRegex: () => datetimeRegex,
|
|
1744
|
+
defaultErrorMap: () => en_default,
|
|
1745
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
1746
|
+
effect: () => effectsType,
|
|
1747
|
+
enum: () => enumType,
|
|
1748
|
+
function: () => functionType,
|
|
1749
|
+
getErrorMap: () => getErrorMap,
|
|
1750
|
+
getParsedType: () => getParsedType,
|
|
1751
|
+
instanceof: () => instanceOfType,
|
|
1752
|
+
intersection: () => intersectionType,
|
|
1753
|
+
isAborted: () => isAborted,
|
|
1754
|
+
isAsync: () => isAsync,
|
|
1755
|
+
isDirty: () => isDirty,
|
|
1756
|
+
isValid: () => isValid,
|
|
1757
|
+
late: () => late,
|
|
1758
|
+
lazy: () => lazyType,
|
|
1759
|
+
literal: () => literalType,
|
|
1760
|
+
makeIssue: () => makeIssue,
|
|
1761
|
+
map: () => mapType,
|
|
1762
|
+
nan: () => nanType,
|
|
1763
|
+
nativeEnum: () => nativeEnumType,
|
|
1764
|
+
never: () => neverType,
|
|
1765
|
+
null: () => nullType,
|
|
1766
|
+
nullable: () => nullableType,
|
|
1767
|
+
number: () => numberType,
|
|
1768
|
+
object: () => objectType,
|
|
1769
|
+
objectUtil: () => objectUtil,
|
|
1770
|
+
oboolean: () => oboolean,
|
|
1771
|
+
onumber: () => onumber,
|
|
1772
|
+
optional: () => optionalType,
|
|
1773
|
+
ostring: () => ostring,
|
|
1774
|
+
pipeline: () => pipelineType,
|
|
1775
|
+
preprocess: () => preprocessType,
|
|
1776
|
+
promise: () => promiseType,
|
|
1777
|
+
quotelessJson: () => quotelessJson,
|
|
1778
|
+
record: () => recordType,
|
|
1779
|
+
set: () => setType,
|
|
1780
|
+
setErrorMap: () => setErrorMap,
|
|
1781
|
+
strictObject: () => strictObjectType,
|
|
1782
|
+
string: () => stringType,
|
|
1783
|
+
symbol: () => symbolType,
|
|
1784
|
+
transformer: () => effectsType,
|
|
1785
|
+
tuple: () => tupleType,
|
|
1786
|
+
undefined: () => undefinedType,
|
|
1787
|
+
union: () => unionType,
|
|
1788
|
+
unknown: () => unknownType,
|
|
1789
|
+
util: () => util,
|
|
1790
|
+
void: () => voidType
|
|
1791
|
+
});
|
|
1669
1792
|
var util;
|
|
1670
1793
|
(function(util2) {
|
|
1671
|
-
util2.assertEqual = (
|
|
1794
|
+
util2.assertEqual = (_) => {
|
|
1795
|
+
};
|
|
1672
1796
|
function assertIs(_arg) {
|
|
1673
1797
|
}
|
|
1674
1798
|
util2.assertIs = assertIs;
|
|
@@ -1712,7 +1836,7 @@ var MagicLabs = (() => {
|
|
|
1712
1836
|
}
|
|
1713
1837
|
return void 0;
|
|
1714
1838
|
};
|
|
1715
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1839
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
1716
1840
|
function joinValues(array, separator = " | ") {
|
|
1717
1841
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1718
1842
|
}
|
|
@@ -1764,7 +1888,7 @@ var MagicLabs = (() => {
|
|
|
1764
1888
|
case "string":
|
|
1765
1889
|
return ZodParsedType.string;
|
|
1766
1890
|
case "number":
|
|
1767
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1891
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1768
1892
|
case "boolean":
|
|
1769
1893
|
return ZodParsedType.boolean;
|
|
1770
1894
|
case "function":
|
|
@@ -1896,8 +2020,9 @@ var MagicLabs = (() => {
|
|
|
1896
2020
|
const formErrors = [];
|
|
1897
2021
|
for (const sub of this.issues) {
|
|
1898
2022
|
if (sub.path.length > 0) {
|
|
1899
|
-
|
|
1900
|
-
fieldErrors[
|
|
2023
|
+
const firstEl = sub.path[0];
|
|
2024
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
2025
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
1901
2026
|
} else {
|
|
1902
2027
|
formErrors.push(mapper(sub));
|
|
1903
2028
|
}
|
|
@@ -1973,6 +2098,8 @@ var MagicLabs = (() => {
|
|
|
1973
2098
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
1974
2099
|
else if (issue.type === "number")
|
|
1975
2100
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2101
|
+
else if (issue.type === "bigint")
|
|
2102
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
1976
2103
|
else if (issue.type === "date")
|
|
1977
2104
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
1978
2105
|
else
|
|
@@ -2010,7 +2137,8 @@ var MagicLabs = (() => {
|
|
|
2010
2137
|
}
|
|
2011
2138
|
return { message };
|
|
2012
2139
|
};
|
|
2013
|
-
var
|
|
2140
|
+
var en_default = errorMap;
|
|
2141
|
+
var overrideErrorMap = en_default;
|
|
2014
2142
|
function setErrorMap(map) {
|
|
2015
2143
|
overrideErrorMap = map;
|
|
2016
2144
|
}
|
|
@@ -2056,7 +2184,7 @@ var MagicLabs = (() => {
|
|
|
2056
2184
|
// then schema-bound map if available
|
|
2057
2185
|
overrideMap,
|
|
2058
2186
|
// then global override map
|
|
2059
|
-
overrideMap ===
|
|
2187
|
+
overrideMap === en_default ? void 0 : en_default
|
|
2060
2188
|
// then global default map
|
|
2061
2189
|
].filter((x) => !!x)
|
|
2062
2190
|
});
|
|
@@ -2125,29 +2253,11 @@ var MagicLabs = (() => {
|
|
|
2125
2253
|
var isDirty = (x) => x.status === "dirty";
|
|
2126
2254
|
var isValid = (x) => x.status === "valid";
|
|
2127
2255
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
2128
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2129
|
-
if (kind === "a" && !f)
|
|
2130
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
2131
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2132
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2133
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2134
|
-
}
|
|
2135
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2136
|
-
if (kind === "m")
|
|
2137
|
-
throw new TypeError("Private method is not writable");
|
|
2138
|
-
if (kind === "a" && !f)
|
|
2139
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
2140
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
2141
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2142
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
2143
|
-
}
|
|
2144
2256
|
var errorUtil;
|
|
2145
2257
|
(function(errorUtil2) {
|
|
2146
2258
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2147
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
2259
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
2148
2260
|
})(errorUtil || (errorUtil = {}));
|
|
2149
|
-
var _ZodEnum_cache;
|
|
2150
|
-
var _ZodNativeEnum_cache;
|
|
2151
2261
|
var ParseInputLazyPath = class {
|
|
2152
2262
|
constructor(parent, value, path, key) {
|
|
2153
2263
|
this._cachedPath = [];
|
|
@@ -2158,7 +2268,7 @@ var MagicLabs = (() => {
|
|
|
2158
2268
|
}
|
|
2159
2269
|
get path() {
|
|
2160
2270
|
if (!this._cachedPath.length) {
|
|
2161
|
-
if (this._key
|
|
2271
|
+
if (Array.isArray(this._key)) {
|
|
2162
2272
|
this._cachedPath.push(...this._path, ...this._key);
|
|
2163
2273
|
} else {
|
|
2164
2274
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -2196,17 +2306,16 @@ var MagicLabs = (() => {
|
|
|
2196
2306
|
if (errorMap2)
|
|
2197
2307
|
return { errorMap: errorMap2, description };
|
|
2198
2308
|
const customMap = (iss, ctx) => {
|
|
2199
|
-
var _a, _b;
|
|
2200
2309
|
const { message } = params;
|
|
2201
2310
|
if (iss.code === "invalid_enum_value") {
|
|
2202
|
-
return { message: message
|
|
2311
|
+
return { message: message ?? ctx.defaultError };
|
|
2203
2312
|
}
|
|
2204
2313
|
if (typeof ctx.data === "undefined") {
|
|
2205
|
-
return { message:
|
|
2314
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
2206
2315
|
}
|
|
2207
2316
|
if (iss.code !== "invalid_type")
|
|
2208
2317
|
return { message: ctx.defaultError };
|
|
2209
|
-
return { message:
|
|
2318
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
2210
2319
|
};
|
|
2211
2320
|
return { errorMap: customMap, description };
|
|
2212
2321
|
}
|
|
@@ -2258,14 +2367,13 @@ var MagicLabs = (() => {
|
|
|
2258
2367
|
throw result.error;
|
|
2259
2368
|
}
|
|
2260
2369
|
safeParse(data, params) {
|
|
2261
|
-
var _a;
|
|
2262
2370
|
const ctx = {
|
|
2263
2371
|
common: {
|
|
2264
2372
|
issues: [],
|
|
2265
|
-
async:
|
|
2266
|
-
contextualErrorMap: params
|
|
2373
|
+
async: params?.async ?? false,
|
|
2374
|
+
contextualErrorMap: params?.errorMap
|
|
2267
2375
|
},
|
|
2268
|
-
path:
|
|
2376
|
+
path: params?.path || [],
|
|
2269
2377
|
schemaErrorMap: this._def.errorMap,
|
|
2270
2378
|
parent: null,
|
|
2271
2379
|
data,
|
|
@@ -2275,7 +2383,6 @@ var MagicLabs = (() => {
|
|
|
2275
2383
|
return handleResult(ctx, result);
|
|
2276
2384
|
}
|
|
2277
2385
|
"~validate"(data) {
|
|
2278
|
-
var _a, _b;
|
|
2279
2386
|
const ctx = {
|
|
2280
2387
|
common: {
|
|
2281
2388
|
issues: [],
|
|
@@ -2296,7 +2403,7 @@ var MagicLabs = (() => {
|
|
|
2296
2403
|
issues: ctx.common.issues
|
|
2297
2404
|
};
|
|
2298
2405
|
} catch (err) {
|
|
2299
|
-
if (
|
|
2406
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
2300
2407
|
this["~standard"].async = true;
|
|
2301
2408
|
}
|
|
2302
2409
|
ctx.common = {
|
|
@@ -2321,10 +2428,10 @@ var MagicLabs = (() => {
|
|
|
2321
2428
|
const ctx = {
|
|
2322
2429
|
common: {
|
|
2323
2430
|
issues: [],
|
|
2324
|
-
contextualErrorMap: params
|
|
2431
|
+
contextualErrorMap: params?.errorMap,
|
|
2325
2432
|
async: true
|
|
2326
2433
|
},
|
|
2327
|
-
path:
|
|
2434
|
+
path: params?.path || [],
|
|
2328
2435
|
schemaErrorMap: this._def.errorMap,
|
|
2329
2436
|
parent: null,
|
|
2330
2437
|
data,
|
|
@@ -2549,16 +2656,20 @@ var MagicLabs = (() => {
|
|
|
2549
2656
|
return false;
|
|
2550
2657
|
try {
|
|
2551
2658
|
const [header] = jwt.split(".");
|
|
2659
|
+
if (!header)
|
|
2660
|
+
return false;
|
|
2552
2661
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
2553
2662
|
const decoded = JSON.parse(atob(base64));
|
|
2554
2663
|
if (typeof decoded !== "object" || decoded === null)
|
|
2555
2664
|
return false;
|
|
2556
|
-
if (
|
|
2665
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
2666
|
+
return false;
|
|
2667
|
+
if (!decoded.alg)
|
|
2557
2668
|
return false;
|
|
2558
2669
|
if (alg && decoded.alg !== alg)
|
|
2559
2670
|
return false;
|
|
2560
2671
|
return true;
|
|
2561
|
-
} catch
|
|
2672
|
+
} catch {
|
|
2562
2673
|
return false;
|
|
2563
2674
|
}
|
|
2564
2675
|
}
|
|
@@ -2717,7 +2828,7 @@ var MagicLabs = (() => {
|
|
|
2717
2828
|
} else if (check.kind === "url") {
|
|
2718
2829
|
try {
|
|
2719
2830
|
new URL(input.data);
|
|
2720
|
-
} catch
|
|
2831
|
+
} catch {
|
|
2721
2832
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2722
2833
|
addIssueToContext(ctx, {
|
|
2723
2834
|
validation: "url",
|
|
@@ -2929,7 +3040,6 @@ var MagicLabs = (() => {
|
|
|
2929
3040
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2930
3041
|
}
|
|
2931
3042
|
datetime(options) {
|
|
2932
|
-
var _a, _b;
|
|
2933
3043
|
if (typeof options === "string") {
|
|
2934
3044
|
return this._addCheck({
|
|
2935
3045
|
kind: "datetime",
|
|
@@ -2941,10 +3051,10 @@ var MagicLabs = (() => {
|
|
|
2941
3051
|
}
|
|
2942
3052
|
return this._addCheck({
|
|
2943
3053
|
kind: "datetime",
|
|
2944
|
-
precision: typeof
|
|
2945
|
-
offset:
|
|
2946
|
-
local:
|
|
2947
|
-
...errorUtil.errToObj(options
|
|
3054
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3055
|
+
offset: options?.offset ?? false,
|
|
3056
|
+
local: options?.local ?? false,
|
|
3057
|
+
...errorUtil.errToObj(options?.message)
|
|
2948
3058
|
});
|
|
2949
3059
|
}
|
|
2950
3060
|
date(message) {
|
|
@@ -2960,8 +3070,8 @@ var MagicLabs = (() => {
|
|
|
2960
3070
|
}
|
|
2961
3071
|
return this._addCheck({
|
|
2962
3072
|
kind: "time",
|
|
2963
|
-
precision: typeof
|
|
2964
|
-
...errorUtil.errToObj(options
|
|
3073
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3074
|
+
...errorUtil.errToObj(options?.message)
|
|
2965
3075
|
});
|
|
2966
3076
|
}
|
|
2967
3077
|
duration(message) {
|
|
@@ -2978,8 +3088,8 @@ var MagicLabs = (() => {
|
|
|
2978
3088
|
return this._addCheck({
|
|
2979
3089
|
kind: "includes",
|
|
2980
3090
|
value,
|
|
2981
|
-
position: options
|
|
2982
|
-
...errorUtil.errToObj(options
|
|
3091
|
+
position: options?.position,
|
|
3092
|
+
...errorUtil.errToObj(options?.message)
|
|
2983
3093
|
});
|
|
2984
3094
|
}
|
|
2985
3095
|
startsWith(value, message) {
|
|
@@ -3111,11 +3221,10 @@ var MagicLabs = (() => {
|
|
|
3111
3221
|
}
|
|
3112
3222
|
};
|
|
3113
3223
|
ZodString.create = (params) => {
|
|
3114
|
-
var _a;
|
|
3115
3224
|
return new ZodString({
|
|
3116
3225
|
checks: [],
|
|
3117
3226
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
3118
|
-
coerce:
|
|
3227
|
+
coerce: params?.coerce ?? false,
|
|
3119
3228
|
...processCreateParams(params)
|
|
3120
3229
|
});
|
|
3121
3230
|
};
|
|
@@ -3123,9 +3232,9 @@ var MagicLabs = (() => {
|
|
|
3123
3232
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
3124
3233
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
3125
3234
|
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
3126
|
-
const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3127
|
-
const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3128
|
-
return valInt % stepInt /
|
|
3235
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3236
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3237
|
+
return valInt % stepInt / 10 ** decCount;
|
|
3129
3238
|
}
|
|
3130
3239
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
3131
3240
|
constructor() {
|
|
@@ -3335,7 +3444,8 @@ var MagicLabs = (() => {
|
|
|
3335
3444
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
3336
3445
|
}
|
|
3337
3446
|
get isFinite() {
|
|
3338
|
-
let max = null
|
|
3447
|
+
let max = null;
|
|
3448
|
+
let min = null;
|
|
3339
3449
|
for (const ch of this._def.checks) {
|
|
3340
3450
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
3341
3451
|
return true;
|
|
@@ -3354,7 +3464,7 @@ var MagicLabs = (() => {
|
|
|
3354
3464
|
return new ZodNumber({
|
|
3355
3465
|
checks: [],
|
|
3356
3466
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
3357
|
-
coerce:
|
|
3467
|
+
coerce: params?.coerce || false,
|
|
3358
3468
|
...processCreateParams(params)
|
|
3359
3469
|
});
|
|
3360
3470
|
};
|
|
@@ -3368,7 +3478,7 @@ var MagicLabs = (() => {
|
|
|
3368
3478
|
if (this._def.coerce) {
|
|
3369
3479
|
try {
|
|
3370
3480
|
input.data = BigInt(input.data);
|
|
3371
|
-
} catch
|
|
3481
|
+
} catch {
|
|
3372
3482
|
return this._getInvalidInput(input);
|
|
3373
3483
|
}
|
|
3374
3484
|
}
|
|
@@ -3523,11 +3633,10 @@ var MagicLabs = (() => {
|
|
|
3523
3633
|
}
|
|
3524
3634
|
};
|
|
3525
3635
|
ZodBigInt.create = (params) => {
|
|
3526
|
-
var _a;
|
|
3527
3636
|
return new ZodBigInt({
|
|
3528
3637
|
checks: [],
|
|
3529
3638
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3530
|
-
coerce:
|
|
3639
|
+
coerce: params?.coerce ?? false,
|
|
3531
3640
|
...processCreateParams(params)
|
|
3532
3641
|
});
|
|
3533
3642
|
};
|
|
@@ -3552,7 +3661,7 @@ var MagicLabs = (() => {
|
|
|
3552
3661
|
ZodBoolean.create = (params) => {
|
|
3553
3662
|
return new ZodBoolean({
|
|
3554
3663
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3555
|
-
coerce:
|
|
3664
|
+
coerce: params?.coerce || false,
|
|
3556
3665
|
...processCreateParams(params)
|
|
3557
3666
|
});
|
|
3558
3667
|
};
|
|
@@ -3571,7 +3680,7 @@ var MagicLabs = (() => {
|
|
|
3571
3680
|
});
|
|
3572
3681
|
return INVALID;
|
|
3573
3682
|
}
|
|
3574
|
-
if (isNaN(input.data.getTime())) {
|
|
3683
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
3575
3684
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3576
3685
|
addIssueToContext(ctx2, {
|
|
3577
3686
|
code: ZodIssueCode.invalid_date
|
|
@@ -3660,7 +3769,7 @@ var MagicLabs = (() => {
|
|
|
3660
3769
|
ZodDate.create = (params) => {
|
|
3661
3770
|
return new ZodDate({
|
|
3662
3771
|
checks: [],
|
|
3663
|
-
coerce:
|
|
3772
|
+
coerce: params?.coerce || false,
|
|
3664
3773
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3665
3774
|
...processCreateParams(params)
|
|
3666
3775
|
});
|
|
@@ -3935,7 +4044,8 @@ var MagicLabs = (() => {
|
|
|
3935
4044
|
return this._cached;
|
|
3936
4045
|
const shape = this._def.shape();
|
|
3937
4046
|
const keys = util.objectKeys(shape);
|
|
3938
|
-
|
|
4047
|
+
this._cached = { shape, keys };
|
|
4048
|
+
return this._cached;
|
|
3939
4049
|
}
|
|
3940
4050
|
_parse(input) {
|
|
3941
4051
|
const parsedType = this._getType(input);
|
|
@@ -3985,9 +4095,8 @@ var MagicLabs = (() => {
|
|
|
3985
4095
|
});
|
|
3986
4096
|
status.dirty();
|
|
3987
4097
|
}
|
|
3988
|
-
} else if (unknownKeys === "strip")
|
|
3989
|
-
|
|
3990
|
-
else {
|
|
4098
|
+
} else if (unknownKeys === "strip") {
|
|
4099
|
+
} else {
|
|
3991
4100
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3992
4101
|
}
|
|
3993
4102
|
} else {
|
|
@@ -4034,11 +4143,10 @@ var MagicLabs = (() => {
|
|
|
4034
4143
|
unknownKeys: "strict",
|
|
4035
4144
|
...message !== void 0 ? {
|
|
4036
4145
|
errorMap: (issue, ctx) => {
|
|
4037
|
-
|
|
4038
|
-
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;
|
|
4146
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
4039
4147
|
if (issue.code === "unrecognized_keys")
|
|
4040
4148
|
return {
|
|
4041
|
-
message:
|
|
4149
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
4042
4150
|
};
|
|
4043
4151
|
return {
|
|
4044
4152
|
message: defaultError
|
|
@@ -4169,11 +4277,11 @@ var MagicLabs = (() => {
|
|
|
4169
4277
|
}
|
|
4170
4278
|
pick(mask) {
|
|
4171
4279
|
const shape = {};
|
|
4172
|
-
util.objectKeys(mask)
|
|
4280
|
+
for (const key of util.objectKeys(mask)) {
|
|
4173
4281
|
if (mask[key] && this.shape[key]) {
|
|
4174
4282
|
shape[key] = this.shape[key];
|
|
4175
4283
|
}
|
|
4176
|
-
}
|
|
4284
|
+
}
|
|
4177
4285
|
return new _ZodObject({
|
|
4178
4286
|
...this._def,
|
|
4179
4287
|
shape: () => shape
|
|
@@ -4181,11 +4289,11 @@ var MagicLabs = (() => {
|
|
|
4181
4289
|
}
|
|
4182
4290
|
omit(mask) {
|
|
4183
4291
|
const shape = {};
|
|
4184
|
-
util.objectKeys(this.shape)
|
|
4292
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4185
4293
|
if (!mask[key]) {
|
|
4186
4294
|
shape[key] = this.shape[key];
|
|
4187
4295
|
}
|
|
4188
|
-
}
|
|
4296
|
+
}
|
|
4189
4297
|
return new _ZodObject({
|
|
4190
4298
|
...this._def,
|
|
4191
4299
|
shape: () => shape
|
|
@@ -4199,14 +4307,14 @@ var MagicLabs = (() => {
|
|
|
4199
4307
|
}
|
|
4200
4308
|
partial(mask) {
|
|
4201
4309
|
const newShape = {};
|
|
4202
|
-
util.objectKeys(this.shape)
|
|
4310
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4203
4311
|
const fieldSchema = this.shape[key];
|
|
4204
4312
|
if (mask && !mask[key]) {
|
|
4205
4313
|
newShape[key] = fieldSchema;
|
|
4206
4314
|
} else {
|
|
4207
4315
|
newShape[key] = fieldSchema.optional();
|
|
4208
4316
|
}
|
|
4209
|
-
}
|
|
4317
|
+
}
|
|
4210
4318
|
return new _ZodObject({
|
|
4211
4319
|
...this._def,
|
|
4212
4320
|
shape: () => newShape
|
|
@@ -4214,7 +4322,7 @@ var MagicLabs = (() => {
|
|
|
4214
4322
|
}
|
|
4215
4323
|
required(mask) {
|
|
4216
4324
|
const newShape = {};
|
|
4217
|
-
util.objectKeys(this.shape)
|
|
4325
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4218
4326
|
if (mask && !mask[key]) {
|
|
4219
4327
|
newShape[key] = this.shape[key];
|
|
4220
4328
|
} else {
|
|
@@ -4225,7 +4333,7 @@ var MagicLabs = (() => {
|
|
|
4225
4333
|
}
|
|
4226
4334
|
newShape[key] = newField;
|
|
4227
4335
|
}
|
|
4228
|
-
}
|
|
4336
|
+
}
|
|
4229
4337
|
return new _ZodObject({
|
|
4230
4338
|
...this._def,
|
|
4231
4339
|
shape: () => newShape
|
|
@@ -4841,12 +4949,7 @@ var MagicLabs = (() => {
|
|
|
4841
4949
|
return makeIssue({
|
|
4842
4950
|
data: args,
|
|
4843
4951
|
path: ctx.path,
|
|
4844
|
-
errorMaps: [
|
|
4845
|
-
ctx.common.contextualErrorMap,
|
|
4846
|
-
ctx.schemaErrorMap,
|
|
4847
|
-
getErrorMap(),
|
|
4848
|
-
errorMap
|
|
4849
|
-
].filter((x) => !!x),
|
|
4952
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4850
4953
|
issueData: {
|
|
4851
4954
|
code: ZodIssueCode.invalid_arguments,
|
|
4852
4955
|
argumentsError: error
|
|
@@ -4857,12 +4960,7 @@ var MagicLabs = (() => {
|
|
|
4857
4960
|
return makeIssue({
|
|
4858
4961
|
data: returns,
|
|
4859
4962
|
path: ctx.path,
|
|
4860
|
-
errorMaps: [
|
|
4861
|
-
ctx.common.contextualErrorMap,
|
|
4862
|
-
ctx.schemaErrorMap,
|
|
4863
|
-
getErrorMap(),
|
|
4864
|
-
errorMap
|
|
4865
|
-
].filter((x) => !!x),
|
|
4963
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4866
4964
|
issueData: {
|
|
4867
4965
|
code: ZodIssueCode.invalid_return_type,
|
|
4868
4966
|
returnTypeError: error
|
|
@@ -4986,10 +5084,6 @@ var MagicLabs = (() => {
|
|
|
4986
5084
|
});
|
|
4987
5085
|
}
|
|
4988
5086
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4989
|
-
constructor() {
|
|
4990
|
-
super(...arguments);
|
|
4991
|
-
_ZodEnum_cache.set(this, void 0);
|
|
4992
|
-
}
|
|
4993
5087
|
_parse(input) {
|
|
4994
5088
|
if (typeof input.data !== "string") {
|
|
4995
5089
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5001,10 +5095,10 @@ var MagicLabs = (() => {
|
|
|
5001
5095
|
});
|
|
5002
5096
|
return INVALID;
|
|
5003
5097
|
}
|
|
5004
|
-
if (!
|
|
5005
|
-
|
|
5098
|
+
if (!this._cache) {
|
|
5099
|
+
this._cache = new Set(this._def.values);
|
|
5006
5100
|
}
|
|
5007
|
-
if (!
|
|
5101
|
+
if (!this._cache.has(input.data)) {
|
|
5008
5102
|
const ctx = this._getOrReturnCtx(input);
|
|
5009
5103
|
const expectedValues = this._def.values;
|
|
5010
5104
|
addIssueToContext(ctx, {
|
|
@@ -5053,13 +5147,8 @@ var MagicLabs = (() => {
|
|
|
5053
5147
|
});
|
|
5054
5148
|
}
|
|
5055
5149
|
};
|
|
5056
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5057
5150
|
ZodEnum.create = createZodEnum;
|
|
5058
5151
|
var ZodNativeEnum = class extends ZodType {
|
|
5059
|
-
constructor() {
|
|
5060
|
-
super(...arguments);
|
|
5061
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
5062
|
-
}
|
|
5063
5152
|
_parse(input) {
|
|
5064
5153
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
5065
5154
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5072,10 +5161,10 @@ var MagicLabs = (() => {
|
|
|
5072
5161
|
});
|
|
5073
5162
|
return INVALID;
|
|
5074
5163
|
}
|
|
5075
|
-
if (!
|
|
5076
|
-
|
|
5164
|
+
if (!this._cache) {
|
|
5165
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
5077
5166
|
}
|
|
5078
|
-
if (!
|
|
5167
|
+
if (!this._cache.has(input.data)) {
|
|
5079
5168
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
5080
5169
|
addIssueToContext(ctx, {
|
|
5081
5170
|
received: ctx.data,
|
|
@@ -5090,7 +5179,6 @@ var MagicLabs = (() => {
|
|
|
5090
5179
|
return this._def.values;
|
|
5091
5180
|
}
|
|
5092
5181
|
};
|
|
5093
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5094
5182
|
ZodNativeEnum.create = (values, params) => {
|
|
5095
5183
|
return new ZodNativeEnum({
|
|
5096
5184
|
values,
|
|
@@ -5231,7 +5319,7 @@ var MagicLabs = (() => {
|
|
|
5231
5319
|
parent: ctx
|
|
5232
5320
|
});
|
|
5233
5321
|
if (!isValid(base))
|
|
5234
|
-
return
|
|
5322
|
+
return INVALID;
|
|
5235
5323
|
const result = effect.transform(base.value, checkCtx);
|
|
5236
5324
|
if (result instanceof Promise) {
|
|
5237
5325
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -5240,8 +5328,11 @@ var MagicLabs = (() => {
|
|
|
5240
5328
|
} else {
|
|
5241
5329
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
5242
5330
|
if (!isValid(base))
|
|
5243
|
-
return
|
|
5244
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5331
|
+
return INVALID;
|
|
5332
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5333
|
+
status: status.value,
|
|
5334
|
+
value: result
|
|
5335
|
+
}));
|
|
5245
5336
|
});
|
|
5246
5337
|
}
|
|
5247
5338
|
}
|
|
@@ -5501,21 +5592,19 @@ var MagicLabs = (() => {
|
|
|
5501
5592
|
function custom(check, _params = {}, fatal) {
|
|
5502
5593
|
if (check)
|
|
5503
5594
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5504
|
-
var _a, _b;
|
|
5505
5595
|
const r = check(data);
|
|
5506
5596
|
if (r instanceof Promise) {
|
|
5507
5597
|
return r.then((r2) => {
|
|
5508
|
-
var _a2, _b2;
|
|
5509
5598
|
if (!r2) {
|
|
5510
5599
|
const params = cleanParams(_params, data);
|
|
5511
|
-
const _fatal =
|
|
5600
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5512
5601
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5513
5602
|
}
|
|
5514
5603
|
});
|
|
5515
5604
|
}
|
|
5516
5605
|
if (!r) {
|
|
5517
5606
|
const params = cleanParams(_params, data);
|
|
5518
|
-
const _fatal =
|
|
5607
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5519
5608
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5520
5609
|
}
|
|
5521
5610
|
return;
|
|
@@ -5615,122 +5704,6 @@ var MagicLabs = (() => {
|
|
|
5615
5704
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5616
5705
|
};
|
|
5617
5706
|
var NEVER = INVALID;
|
|
5618
|
-
var z = /* @__PURE__ */ Object.freeze({
|
|
5619
|
-
__proto__: null,
|
|
5620
|
-
defaultErrorMap: errorMap,
|
|
5621
|
-
setErrorMap,
|
|
5622
|
-
getErrorMap,
|
|
5623
|
-
makeIssue,
|
|
5624
|
-
EMPTY_PATH,
|
|
5625
|
-
addIssueToContext,
|
|
5626
|
-
ParseStatus,
|
|
5627
|
-
INVALID,
|
|
5628
|
-
DIRTY,
|
|
5629
|
-
OK,
|
|
5630
|
-
isAborted,
|
|
5631
|
-
isDirty,
|
|
5632
|
-
isValid,
|
|
5633
|
-
isAsync,
|
|
5634
|
-
get util() {
|
|
5635
|
-
return util;
|
|
5636
|
-
},
|
|
5637
|
-
get objectUtil() {
|
|
5638
|
-
return objectUtil;
|
|
5639
|
-
},
|
|
5640
|
-
ZodParsedType,
|
|
5641
|
-
getParsedType,
|
|
5642
|
-
ZodType,
|
|
5643
|
-
datetimeRegex,
|
|
5644
|
-
ZodString,
|
|
5645
|
-
ZodNumber,
|
|
5646
|
-
ZodBigInt,
|
|
5647
|
-
ZodBoolean,
|
|
5648
|
-
ZodDate,
|
|
5649
|
-
ZodSymbol,
|
|
5650
|
-
ZodUndefined,
|
|
5651
|
-
ZodNull,
|
|
5652
|
-
ZodAny,
|
|
5653
|
-
ZodUnknown,
|
|
5654
|
-
ZodNever,
|
|
5655
|
-
ZodVoid,
|
|
5656
|
-
ZodArray,
|
|
5657
|
-
ZodObject,
|
|
5658
|
-
ZodUnion,
|
|
5659
|
-
ZodDiscriminatedUnion,
|
|
5660
|
-
ZodIntersection,
|
|
5661
|
-
ZodTuple,
|
|
5662
|
-
ZodRecord,
|
|
5663
|
-
ZodMap,
|
|
5664
|
-
ZodSet,
|
|
5665
|
-
ZodFunction,
|
|
5666
|
-
ZodLazy,
|
|
5667
|
-
ZodLiteral,
|
|
5668
|
-
ZodEnum,
|
|
5669
|
-
ZodNativeEnum,
|
|
5670
|
-
ZodPromise,
|
|
5671
|
-
ZodEffects,
|
|
5672
|
-
ZodTransformer: ZodEffects,
|
|
5673
|
-
ZodOptional,
|
|
5674
|
-
ZodNullable,
|
|
5675
|
-
ZodDefault,
|
|
5676
|
-
ZodCatch,
|
|
5677
|
-
ZodNaN,
|
|
5678
|
-
BRAND,
|
|
5679
|
-
ZodBranded,
|
|
5680
|
-
ZodPipeline,
|
|
5681
|
-
ZodReadonly,
|
|
5682
|
-
custom,
|
|
5683
|
-
Schema: ZodType,
|
|
5684
|
-
ZodSchema: ZodType,
|
|
5685
|
-
late,
|
|
5686
|
-
get ZodFirstPartyTypeKind() {
|
|
5687
|
-
return ZodFirstPartyTypeKind;
|
|
5688
|
-
},
|
|
5689
|
-
coerce,
|
|
5690
|
-
any: anyType,
|
|
5691
|
-
array: arrayType,
|
|
5692
|
-
bigint: bigIntType,
|
|
5693
|
-
boolean: booleanType,
|
|
5694
|
-
date: dateType,
|
|
5695
|
-
discriminatedUnion: discriminatedUnionType,
|
|
5696
|
-
effect: effectsType,
|
|
5697
|
-
"enum": enumType,
|
|
5698
|
-
"function": functionType,
|
|
5699
|
-
"instanceof": instanceOfType,
|
|
5700
|
-
intersection: intersectionType,
|
|
5701
|
-
lazy: lazyType,
|
|
5702
|
-
literal: literalType,
|
|
5703
|
-
map: mapType,
|
|
5704
|
-
nan: nanType,
|
|
5705
|
-
nativeEnum: nativeEnumType,
|
|
5706
|
-
never: neverType,
|
|
5707
|
-
"null": nullType,
|
|
5708
|
-
nullable: nullableType,
|
|
5709
|
-
number: numberType,
|
|
5710
|
-
object: objectType,
|
|
5711
|
-
oboolean,
|
|
5712
|
-
onumber,
|
|
5713
|
-
optional: optionalType,
|
|
5714
|
-
ostring,
|
|
5715
|
-
pipeline: pipelineType,
|
|
5716
|
-
preprocess: preprocessType,
|
|
5717
|
-
promise: promiseType,
|
|
5718
|
-
record: recordType,
|
|
5719
|
-
set: setType,
|
|
5720
|
-
strictObject: strictObjectType,
|
|
5721
|
-
string: stringType,
|
|
5722
|
-
symbol: symbolType,
|
|
5723
|
-
transformer: effectsType,
|
|
5724
|
-
tuple: tupleType,
|
|
5725
|
-
"undefined": undefinedType,
|
|
5726
|
-
union: unionType,
|
|
5727
|
-
unknown: unknownType,
|
|
5728
|
-
"void": voidType,
|
|
5729
|
-
NEVER,
|
|
5730
|
-
ZodIssueCode,
|
|
5731
|
-
quotelessJson,
|
|
5732
|
-
ZodError
|
|
5733
|
-
});
|
|
5734
5707
|
var BookDesignRequest = class {
|
|
5735
5708
|
occasion;
|
|
5736
5709
|
style;
|
|
@@ -5753,29 +5726,29 @@ var MagicLabs = (() => {
|
|
|
5753
5726
|
this.text_sticker_level = props.text_sticker_level;
|
|
5754
5727
|
}
|
|
5755
5728
|
};
|
|
5756
|
-
var bookDesignRequestSchema =
|
|
5757
|
-
occasion:
|
|
5758
|
-
style:
|
|
5759
|
-
book_size:
|
|
5760
|
-
cover_type:
|
|
5761
|
-
page_type:
|
|
5762
|
-
image_density:
|
|
5763
|
-
image_filtering_level:
|
|
5764
|
-
embellishment_level:
|
|
5765
|
-
text_sticker_level:
|
|
5729
|
+
var bookDesignRequestSchema = external_exports.object({
|
|
5730
|
+
occasion: external_exports.enum(occasions),
|
|
5731
|
+
style: external_exports.string(),
|
|
5732
|
+
book_size: external_exports.enum(bookSizes),
|
|
5733
|
+
cover_type: external_exports.enum(coverTypes),
|
|
5734
|
+
page_type: external_exports.enum(pageTypes),
|
|
5735
|
+
image_density: external_exports.enum(imageDensities),
|
|
5736
|
+
image_filtering_level: external_exports.enum(imageFilteringLevels),
|
|
5737
|
+
embellishment_level: external_exports.enum(embellishmentLevels),
|
|
5738
|
+
text_sticker_level: external_exports.enum(textStickerLevels)
|
|
5766
5739
|
});
|
|
5767
|
-
var bookPropsSchema =
|
|
5768
|
-
id:
|
|
5769
|
-
title:
|
|
5770
|
-
subtitle:
|
|
5740
|
+
var bookPropsSchema = external_exports.object({
|
|
5741
|
+
id: external_exports.string().optional(),
|
|
5742
|
+
title: external_exports.string(),
|
|
5743
|
+
subtitle: external_exports.string().optional(),
|
|
5771
5744
|
design_request: bookDesignRequestSchema,
|
|
5772
|
-
sku:
|
|
5773
|
-
state:
|
|
5774
|
-
guid:
|
|
5775
|
-
cancelled_at:
|
|
5776
|
-
mb_client_timeout:
|
|
5777
|
-
user_id:
|
|
5778
|
-
revision:
|
|
5745
|
+
sku: external_exports.string().optional(),
|
|
5746
|
+
state: external_exports.enum(states).optional(),
|
|
5747
|
+
guid: external_exports.string().optional(),
|
|
5748
|
+
cancelled_at: external_exports.string().optional(),
|
|
5749
|
+
mb_client_timeout: external_exports.number().optional(),
|
|
5750
|
+
user_id: external_exports.string().optional(),
|
|
5751
|
+
revision: external_exports.number().optional()
|
|
5779
5752
|
});
|
|
5780
5753
|
var Book = class {
|
|
5781
5754
|
id;
|
|
@@ -5854,18 +5827,18 @@ var MagicLabs = (() => {
|
|
|
5854
5827
|
}
|
|
5855
5828
|
}
|
|
5856
5829
|
};
|
|
5857
|
-
var imageServerSchema =
|
|
5858
|
-
id:
|
|
5859
|
-
handle:
|
|
5860
|
-
url:
|
|
5861
|
-
width:
|
|
5862
|
-
height:
|
|
5863
|
-
orientation:
|
|
5864
|
-
taken_at:
|
|
5865
|
-
camera_make:
|
|
5866
|
-
camera:
|
|
5867
|
-
filename:
|
|
5868
|
-
metadata:
|
|
5830
|
+
var imageServerSchema = external_exports.object({
|
|
5831
|
+
id: external_exports.string().optional(),
|
|
5832
|
+
handle: external_exports.string(),
|
|
5833
|
+
url: external_exports.string(),
|
|
5834
|
+
width: external_exports.number(),
|
|
5835
|
+
height: external_exports.number(),
|
|
5836
|
+
orientation: external_exports.number(),
|
|
5837
|
+
taken_at: external_exports.string(),
|
|
5838
|
+
camera_make: external_exports.string().optional(),
|
|
5839
|
+
camera: external_exports.string().optional(),
|
|
5840
|
+
filename: external_exports.string(),
|
|
5841
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5869
5842
|
});
|
|
5870
5843
|
var ImageServer = class {
|
|
5871
5844
|
id;
|
|
@@ -5908,34 +5881,34 @@ var MagicLabs = (() => {
|
|
|
5908
5881
|
metadata: imageServer.metadata
|
|
5909
5882
|
};
|
|
5910
5883
|
}
|
|
5911
|
-
var imageDensityOptionSchema =
|
|
5912
|
-
maxPageCount:
|
|
5913
|
-
minPageCount:
|
|
5914
|
-
maxImageCount:
|
|
5915
|
-
avgImageCount:
|
|
5916
|
-
minImageCount:
|
|
5884
|
+
var imageDensityOptionSchema = external_exports.object({
|
|
5885
|
+
maxPageCount: external_exports.number(),
|
|
5886
|
+
minPageCount: external_exports.number(),
|
|
5887
|
+
maxImageCount: external_exports.number(),
|
|
5888
|
+
avgImageCount: external_exports.number(),
|
|
5889
|
+
minImageCount: external_exports.number()
|
|
5917
5890
|
});
|
|
5918
|
-
var imageDensityOptionsSchema =
|
|
5891
|
+
var imageDensityOptionsSchema = external_exports.object({
|
|
5919
5892
|
high: imageDensityOptionSchema,
|
|
5920
5893
|
medium: imageDensityOptionSchema,
|
|
5921
5894
|
low: imageDensityOptionSchema
|
|
5922
5895
|
});
|
|
5923
|
-
var designOptionsSchema =
|
|
5896
|
+
var designOptionsSchema = external_exports.object({
|
|
5924
5897
|
densities: imageDensityOptionsSchema
|
|
5925
5898
|
});
|
|
5926
|
-
var imageDensityOptionServerSchema =
|
|
5927
|
-
max_page_count:
|
|
5928
|
-
min_page_count:
|
|
5929
|
-
max_image_count:
|
|
5930
|
-
avg_image_count:
|
|
5931
|
-
min_image_count:
|
|
5899
|
+
var imageDensityOptionServerSchema = external_exports.object({
|
|
5900
|
+
max_page_count: external_exports.number(),
|
|
5901
|
+
min_page_count: external_exports.number(),
|
|
5902
|
+
max_image_count: external_exports.number(),
|
|
5903
|
+
avg_image_count: external_exports.number(),
|
|
5904
|
+
min_image_count: external_exports.number()
|
|
5932
5905
|
});
|
|
5933
|
-
var imageDensityOptionsServerSchema =
|
|
5906
|
+
var imageDensityOptionsServerSchema = external_exports.object({
|
|
5934
5907
|
high: imageDensityOptionServerSchema,
|
|
5935
5908
|
medium: imageDensityOptionServerSchema,
|
|
5936
5909
|
low: imageDensityOptionServerSchema
|
|
5937
5910
|
});
|
|
5938
|
-
var designOptionsServerSchema =
|
|
5911
|
+
var designOptionsServerSchema = external_exports.object({
|
|
5939
5912
|
densities: imageDensityOptionsServerSchema
|
|
5940
5913
|
});
|
|
5941
5914
|
var DesignRequestOptions = {
|
|
@@ -6225,9 +6198,9 @@ var MagicLabs = (() => {
|
|
|
6225
6198
|
});
|
|
6226
6199
|
}
|
|
6227
6200
|
};
|
|
6228
|
-
var eventContextSchema =
|
|
6229
|
-
var eventSchema =
|
|
6230
|
-
name:
|
|
6201
|
+
var eventContextSchema = external_exports.record(external_exports.string(), external_exports.unknown()).optional();
|
|
6202
|
+
var eventSchema = external_exports.object({
|
|
6203
|
+
name: external_exports.string(),
|
|
6231
6204
|
context: eventContextSchema
|
|
6232
6205
|
});
|
|
6233
6206
|
var EventsEndpoints = class {
|
|
@@ -6311,7 +6284,7 @@ var MagicLabs = (() => {
|
|
|
6311
6284
|
const res = await this.engineAPI.fetcher.call({
|
|
6312
6285
|
path: `/v1/images/book/${bookId}`
|
|
6313
6286
|
});
|
|
6314
|
-
return
|
|
6287
|
+
return external_exports.array(imageServerSchema).parse(res);
|
|
6315
6288
|
});
|
|
6316
6289
|
}
|
|
6317
6290
|
retrieve(imageId, bookId) {
|
|
@@ -6357,117 +6330,117 @@ var MagicLabs = (() => {
|
|
|
6357
6330
|
});
|
|
6358
6331
|
}
|
|
6359
6332
|
};
|
|
6360
|
-
var spreadServerSchema =
|
|
6361
|
-
id:
|
|
6362
|
-
book_id:
|
|
6363
|
-
state:
|
|
6364
|
-
spread_type:
|
|
6365
|
-
width:
|
|
6366
|
-
height:
|
|
6367
|
-
sequence:
|
|
6368
|
-
wells:
|
|
6369
|
-
background:
|
|
6370
|
-
laid_out_at:
|
|
6371
|
-
embellished_at:
|
|
6372
|
-
polished_at:
|
|
6373
|
-
metadata:
|
|
6374
|
-
url:
|
|
6333
|
+
var spreadServerSchema = external_exports.object({
|
|
6334
|
+
id: external_exports.string(),
|
|
6335
|
+
book_id: external_exports.string(),
|
|
6336
|
+
state: external_exports.string(),
|
|
6337
|
+
spread_type: external_exports.string(),
|
|
6338
|
+
width: external_exports.number(),
|
|
6339
|
+
height: external_exports.number(),
|
|
6340
|
+
sequence: external_exports.number(),
|
|
6341
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6342
|
+
background: external_exports.unknown(),
|
|
6343
|
+
laid_out_at: external_exports.string().nullable(),
|
|
6344
|
+
embellished_at: external_exports.string().nullable(),
|
|
6345
|
+
polished_at: external_exports.string().nullable(),
|
|
6346
|
+
metadata: external_exports.unknown(),
|
|
6347
|
+
url: external_exports.string().nullable().optional()
|
|
6375
6348
|
});
|
|
6376
|
-
var spreadSchema =
|
|
6377
|
-
id:
|
|
6378
|
-
bookId:
|
|
6379
|
-
state:
|
|
6380
|
-
spreadType:
|
|
6381
|
-
width:
|
|
6382
|
-
height:
|
|
6383
|
-
sequence:
|
|
6384
|
-
wells:
|
|
6385
|
-
background:
|
|
6386
|
-
laidOutAt:
|
|
6387
|
-
embellishedAt:
|
|
6388
|
-
polishedAt:
|
|
6389
|
-
metadata:
|
|
6390
|
-
url:
|
|
6349
|
+
var spreadSchema = external_exports.object({
|
|
6350
|
+
id: external_exports.string(),
|
|
6351
|
+
bookId: external_exports.string(),
|
|
6352
|
+
state: external_exports.string(),
|
|
6353
|
+
spreadType: external_exports.string(),
|
|
6354
|
+
width: external_exports.number(),
|
|
6355
|
+
height: external_exports.number(),
|
|
6356
|
+
sequence: external_exports.number(),
|
|
6357
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6358
|
+
background: external_exports.unknown(),
|
|
6359
|
+
laidOutAt: external_exports.string().nullable(),
|
|
6360
|
+
embellishedAt: external_exports.string().nullable(),
|
|
6361
|
+
polishedAt: external_exports.string().nullable(),
|
|
6362
|
+
metadata: external_exports.unknown(),
|
|
6363
|
+
url: external_exports.string().nullable().optional()
|
|
6391
6364
|
});
|
|
6392
|
-
var imageAssignmentSchema =
|
|
6393
|
-
photoRefId:
|
|
6394
|
-
finalCrop:
|
|
6365
|
+
var imageAssignmentSchema = external_exports.object({
|
|
6366
|
+
photoRefId: external_exports.string(),
|
|
6367
|
+
finalCrop: external_exports.array(external_exports.number())
|
|
6395
6368
|
});
|
|
6396
|
-
var positionSchema =
|
|
6397
|
-
x:
|
|
6398
|
-
y:
|
|
6399
|
-
width:
|
|
6400
|
-
height:
|
|
6401
|
-
rotation:
|
|
6369
|
+
var positionSchema = external_exports.object({
|
|
6370
|
+
x: external_exports.number(),
|
|
6371
|
+
y: external_exports.number(),
|
|
6372
|
+
width: external_exports.number().optional(),
|
|
6373
|
+
height: external_exports.number().optional(),
|
|
6374
|
+
rotation: external_exports.number()
|
|
6402
6375
|
});
|
|
6403
|
-
var photoMetadataSchema =
|
|
6404
|
-
id:
|
|
6405
|
-
llx:
|
|
6406
|
-
lly:
|
|
6407
|
-
urx:
|
|
6408
|
-
ury:
|
|
6409
|
-
data:
|
|
6410
|
-
title:
|
|
6411
|
-
width:
|
|
6412
|
-
effect:
|
|
6413
|
-
height:
|
|
6414
|
-
source:
|
|
6415
|
-
rotation:
|
|
6416
|
-
uploadTime:
|
|
6376
|
+
var photoMetadataSchema = external_exports.object({
|
|
6377
|
+
id: external_exports.string(),
|
|
6378
|
+
llx: external_exports.number(),
|
|
6379
|
+
lly: external_exports.number(),
|
|
6380
|
+
urx: external_exports.number(),
|
|
6381
|
+
ury: external_exports.number(),
|
|
6382
|
+
data: external_exports.string().nullable(),
|
|
6383
|
+
title: external_exports.string(),
|
|
6384
|
+
width: external_exports.number(),
|
|
6385
|
+
effect: external_exports.string(),
|
|
6386
|
+
height: external_exports.number(),
|
|
6387
|
+
source: external_exports.string(),
|
|
6388
|
+
rotation: external_exports.number(),
|
|
6389
|
+
uploadTime: external_exports.string()
|
|
6417
6390
|
});
|
|
6418
|
-
var propertySchema =
|
|
6419
|
-
key:
|
|
6420
|
-
value:
|
|
6391
|
+
var propertySchema = external_exports.object({
|
|
6392
|
+
key: external_exports.string(),
|
|
6393
|
+
value: external_exports.any()
|
|
6421
6394
|
});
|
|
6422
|
-
var assetSchema =
|
|
6423
|
-
type:
|
|
6395
|
+
var assetSchema = external_exports.object({
|
|
6396
|
+
type: external_exports.string(),
|
|
6424
6397
|
imageAssignment: imageAssignmentSchema.optional(),
|
|
6425
6398
|
position: positionSchema,
|
|
6426
|
-
seqNum:
|
|
6427
|
-
z:
|
|
6428
|
-
id:
|
|
6429
|
-
horizJustification:
|
|
6430
|
-
vertJustification:
|
|
6431
|
-
text:
|
|
6432
|
-
fontId:
|
|
6433
|
-
fontSize:
|
|
6434
|
-
fontColor:
|
|
6435
|
-
frame:
|
|
6399
|
+
seqNum: external_exports.number(),
|
|
6400
|
+
z: external_exports.number(),
|
|
6401
|
+
id: external_exports.string().optional(),
|
|
6402
|
+
horizJustification: external_exports.string().optional(),
|
|
6403
|
+
vertJustification: external_exports.string().optional().nullable(),
|
|
6404
|
+
text: external_exports.string().optional(),
|
|
6405
|
+
fontId: external_exports.string().optional(),
|
|
6406
|
+
fontSize: external_exports.number().optional(),
|
|
6407
|
+
fontColor: external_exports.string().optional(),
|
|
6408
|
+
frame: external_exports.string().optional()
|
|
6436
6409
|
});
|
|
6437
|
-
var photoStripSchema =
|
|
6438
|
-
url:
|
|
6439
|
-
encryptId:
|
|
6440
|
-
photoRefId:
|
|
6441
|
-
photoId:
|
|
6410
|
+
var photoStripSchema = external_exports.object({
|
|
6411
|
+
url: external_exports.string(),
|
|
6412
|
+
encryptId: external_exports.string(),
|
|
6413
|
+
photoRefId: external_exports.string(),
|
|
6414
|
+
photoId: external_exports.string(),
|
|
6442
6415
|
photoMetadata: photoMetadataSchema
|
|
6443
6416
|
});
|
|
6444
|
-
var reportingDataSchema =
|
|
6445
|
-
properties:
|
|
6417
|
+
var reportingDataSchema = external_exports.object({
|
|
6418
|
+
properties: external_exports.array(propertySchema)
|
|
6446
6419
|
});
|
|
6447
|
-
var sflyCanvasSchema =
|
|
6448
|
-
backgroundId:
|
|
6449
|
-
assets:
|
|
6420
|
+
var sflyCanvasSchema = external_exports.object({
|
|
6421
|
+
backgroundId: external_exports.string().nullable(),
|
|
6422
|
+
assets: external_exports.array(assetSchema).optional()
|
|
6450
6423
|
});
|
|
6451
|
-
var snapCanvasSchema =
|
|
6452
|
-
surfaceNumber:
|
|
6453
|
-
surfaceData:
|
|
6454
|
-
version:
|
|
6424
|
+
var snapCanvasSchema = external_exports.object({
|
|
6425
|
+
surfaceNumber: external_exports.number(),
|
|
6426
|
+
surfaceData: external_exports.record(external_exports.any()),
|
|
6427
|
+
version: external_exports.string()
|
|
6455
6428
|
});
|
|
6456
|
-
var pageSchema =
|
|
6457
|
-
pageNum:
|
|
6458
|
-
type:
|
|
6429
|
+
var pageSchema = external_exports.object({
|
|
6430
|
+
pageNum: external_exports.number(),
|
|
6431
|
+
type: external_exports.string(),
|
|
6459
6432
|
canvas: sflyCanvasSchema
|
|
6460
6433
|
});
|
|
6461
|
-
var magicShopBookSchema =
|
|
6462
|
-
pages:
|
|
6463
|
-
photoStrip:
|
|
6434
|
+
var magicShopBookSchema = external_exports.object({
|
|
6435
|
+
pages: external_exports.array(pageSchema),
|
|
6436
|
+
photoStrip: external_exports.array(photoStripSchema)
|
|
6464
6437
|
});
|
|
6465
|
-
var bookCreationRequestSchema =
|
|
6466
|
-
title:
|
|
6467
|
-
binding:
|
|
6468
|
-
coverSpecId:
|
|
6469
|
-
styleId:
|
|
6470
|
-
userId:
|
|
6438
|
+
var bookCreationRequestSchema = external_exports.object({
|
|
6439
|
+
title: external_exports.string(),
|
|
6440
|
+
binding: external_exports.string(),
|
|
6441
|
+
coverSpecId: external_exports.string(),
|
|
6442
|
+
styleId: external_exports.number(),
|
|
6443
|
+
userId: external_exports.string(),
|
|
6471
6444
|
magicShopBook: magicShopBookSchema,
|
|
6472
6445
|
reportingData: reportingDataSchema
|
|
6473
6446
|
});
|
|
@@ -6482,7 +6455,7 @@ var MagicLabs = (() => {
|
|
|
6482
6455
|
const res = await this.engineAPI.fetcher.call({
|
|
6483
6456
|
path: `/v1/spreads/book/${bookId}`
|
|
6484
6457
|
});
|
|
6485
|
-
return
|
|
6458
|
+
return external_exports.array(spreadServerSchema).parse(res);
|
|
6486
6459
|
});
|
|
6487
6460
|
}
|
|
6488
6461
|
create(bookId, spread) {
|
|
@@ -6548,96 +6521,96 @@ var MagicLabs = (() => {
|
|
|
6548
6521
|
})
|
|
6549
6522
|
}
|
|
6550
6523
|
});
|
|
6551
|
-
return
|
|
6524
|
+
return external_exports.array(surfaceCategoryName ? snapCanvasSchema : sflyCanvasSchema).parse(res);
|
|
6552
6525
|
});
|
|
6553
6526
|
}
|
|
6554
6527
|
};
|
|
6555
|
-
var StoryboardItemImageFaceServerSchema =
|
|
6556
|
-
score:
|
|
6557
|
-
bounding_box:
|
|
6558
|
-
x:
|
|
6559
|
-
y:
|
|
6560
|
-
width:
|
|
6561
|
-
height:
|
|
6528
|
+
var StoryboardItemImageFaceServerSchema = external_exports.object({
|
|
6529
|
+
score: external_exports.number(),
|
|
6530
|
+
bounding_box: external_exports.object({
|
|
6531
|
+
x: external_exports.number(),
|
|
6532
|
+
y: external_exports.number(),
|
|
6533
|
+
width: external_exports.number(),
|
|
6534
|
+
height: external_exports.number()
|
|
6562
6535
|
}),
|
|
6563
|
-
size:
|
|
6564
|
-
eyes_open_score:
|
|
6565
|
-
smile_score:
|
|
6566
|
-
facing_camera_score:
|
|
6536
|
+
size: external_exports.number(),
|
|
6537
|
+
eyes_open_score: external_exports.number(),
|
|
6538
|
+
smile_score: external_exports.number(),
|
|
6539
|
+
facing_camera_score: external_exports.number()
|
|
6567
6540
|
});
|
|
6568
|
-
var StoryboardItemImageFaceSchema =
|
|
6569
|
-
score:
|
|
6570
|
-
boundingBox:
|
|
6571
|
-
x:
|
|
6572
|
-
y:
|
|
6573
|
-
width:
|
|
6574
|
-
height:
|
|
6541
|
+
var StoryboardItemImageFaceSchema = external_exports.object({
|
|
6542
|
+
score: external_exports.number(),
|
|
6543
|
+
boundingBox: external_exports.object({
|
|
6544
|
+
x: external_exports.number(),
|
|
6545
|
+
y: external_exports.number(),
|
|
6546
|
+
width: external_exports.number(),
|
|
6547
|
+
height: external_exports.number()
|
|
6575
6548
|
}),
|
|
6576
|
-
size:
|
|
6577
|
-
eyesOpenScore:
|
|
6578
|
-
smileScore:
|
|
6579
|
-
facingCameraScore:
|
|
6549
|
+
size: external_exports.number(),
|
|
6550
|
+
eyesOpenScore: external_exports.number(),
|
|
6551
|
+
smileScore: external_exports.number(),
|
|
6552
|
+
facingCameraScore: external_exports.number()
|
|
6580
6553
|
});
|
|
6581
|
-
var StoryboardItemImageServerSchema =
|
|
6582
|
-
id:
|
|
6583
|
-
url:
|
|
6584
|
-
category:
|
|
6585
|
-
aesthetic_score:
|
|
6586
|
-
faces:
|
|
6587
|
-
roi:
|
|
6588
|
-
x:
|
|
6589
|
-
y:
|
|
6590
|
-
width:
|
|
6591
|
-
height:
|
|
6554
|
+
var StoryboardItemImageServerSchema = external_exports.object({
|
|
6555
|
+
id: external_exports.string(),
|
|
6556
|
+
url: external_exports.string(),
|
|
6557
|
+
category: external_exports.string(),
|
|
6558
|
+
aesthetic_score: external_exports.number(),
|
|
6559
|
+
faces: external_exports.array(StoryboardItemImageFaceServerSchema),
|
|
6560
|
+
roi: external_exports.object({
|
|
6561
|
+
x: external_exports.number(),
|
|
6562
|
+
y: external_exports.number(),
|
|
6563
|
+
width: external_exports.number(),
|
|
6564
|
+
height: external_exports.number()
|
|
6592
6565
|
}),
|
|
6593
|
-
taken_at:
|
|
6594
|
-
width:
|
|
6595
|
-
height:
|
|
6566
|
+
taken_at: external_exports.number(),
|
|
6567
|
+
width: external_exports.number(),
|
|
6568
|
+
height: external_exports.number()
|
|
6596
6569
|
});
|
|
6597
|
-
var StoryboardItemImageSchema =
|
|
6598
|
-
id:
|
|
6599
|
-
url:
|
|
6600
|
-
category:
|
|
6601
|
-
aestheticScore:
|
|
6602
|
-
faces:
|
|
6603
|
-
roi:
|
|
6604
|
-
x:
|
|
6605
|
-
y:
|
|
6606
|
-
width:
|
|
6607
|
-
height:
|
|
6570
|
+
var StoryboardItemImageSchema = external_exports.object({
|
|
6571
|
+
id: external_exports.string(),
|
|
6572
|
+
url: external_exports.string(),
|
|
6573
|
+
category: external_exports.string(),
|
|
6574
|
+
aestheticScore: external_exports.number(),
|
|
6575
|
+
faces: external_exports.array(StoryboardItemImageFaceSchema),
|
|
6576
|
+
roi: external_exports.object({
|
|
6577
|
+
x: external_exports.number(),
|
|
6578
|
+
y: external_exports.number(),
|
|
6579
|
+
width: external_exports.number(),
|
|
6580
|
+
height: external_exports.number()
|
|
6608
6581
|
}),
|
|
6609
|
-
takenAt:
|
|
6610
|
-
width:
|
|
6611
|
-
height:
|
|
6582
|
+
takenAt: external_exports.number(),
|
|
6583
|
+
width: external_exports.number(),
|
|
6584
|
+
height: external_exports.number()
|
|
6612
6585
|
});
|
|
6613
|
-
var StoryboardItemServerSchema =
|
|
6614
|
-
id:
|
|
6615
|
-
sequence:
|
|
6616
|
-
book_id:
|
|
6617
|
-
similarity:
|
|
6618
|
-
duplicate:
|
|
6619
|
-
selected:
|
|
6620
|
-
surface_weight:
|
|
6621
|
-
front_cover:
|
|
6622
|
-
back_cover:
|
|
6623
|
-
scene:
|
|
6624
|
-
subscene:
|
|
6625
|
-
spine_break:
|
|
6586
|
+
var StoryboardItemServerSchema = external_exports.object({
|
|
6587
|
+
id: external_exports.string(),
|
|
6588
|
+
sequence: external_exports.number(),
|
|
6589
|
+
book_id: external_exports.string(),
|
|
6590
|
+
similarity: external_exports.number(),
|
|
6591
|
+
duplicate: external_exports.boolean(),
|
|
6592
|
+
selected: external_exports.boolean(),
|
|
6593
|
+
surface_weight: external_exports.number(),
|
|
6594
|
+
front_cover: external_exports.boolean().optional(),
|
|
6595
|
+
back_cover: external_exports.boolean().optional(),
|
|
6596
|
+
scene: external_exports.number(),
|
|
6597
|
+
subscene: external_exports.number(),
|
|
6598
|
+
spine_break: external_exports.boolean().optional(),
|
|
6626
6599
|
image: StoryboardItemImageServerSchema
|
|
6627
6600
|
});
|
|
6628
|
-
var StoryboardItemSchema =
|
|
6629
|
-
id:
|
|
6630
|
-
sequence:
|
|
6631
|
-
bookId:
|
|
6632
|
-
similarity:
|
|
6633
|
-
duplicate:
|
|
6634
|
-
selected:
|
|
6635
|
-
surfaceWeight:
|
|
6636
|
-
frontCover:
|
|
6637
|
-
backCover:
|
|
6638
|
-
scene:
|
|
6639
|
-
subscene:
|
|
6640
|
-
spineBreak:
|
|
6601
|
+
var StoryboardItemSchema = external_exports.object({
|
|
6602
|
+
id: external_exports.string(),
|
|
6603
|
+
sequence: external_exports.number(),
|
|
6604
|
+
bookId: external_exports.string(),
|
|
6605
|
+
similarity: external_exports.number(),
|
|
6606
|
+
duplicate: external_exports.boolean(),
|
|
6607
|
+
selected: external_exports.boolean(),
|
|
6608
|
+
surfaceWeight: external_exports.number(),
|
|
6609
|
+
frontCover: external_exports.boolean().optional(),
|
|
6610
|
+
backCover: external_exports.boolean().optional(),
|
|
6611
|
+
scene: external_exports.number(),
|
|
6612
|
+
subscene: external_exports.number(),
|
|
6613
|
+
spineBreak: external_exports.boolean().optional(),
|
|
6641
6614
|
image: StoryboardItemImageSchema
|
|
6642
6615
|
});
|
|
6643
6616
|
var StoryboardItemsEndpoints = class {
|
|
@@ -6651,7 +6624,7 @@ var MagicLabs = (() => {
|
|
|
6651
6624
|
const res = await this.engineAPI.fetcher.call({
|
|
6652
6625
|
path: `/v1/storyboarditems/book/${bookId}`
|
|
6653
6626
|
});
|
|
6654
|
-
return
|
|
6627
|
+
return external_exports.array(StoryboardItemServerSchema).parse(res);
|
|
6655
6628
|
});
|
|
6656
6629
|
}
|
|
6657
6630
|
};
|