@magiclabs.ai/magicbook-client 0.7.29 → 0.7.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +437 -457
- package/index.cjs.map +1 -1
- package/index.d.cts +18 -0
- package/index.d.ts +18 -0
- package/index.iife.js +427 -456
- package/index.iife.min.js +1 -1
- package/index.js +443 -457
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.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,12 @@ 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" },
|
|
294
305
|
//snapfish styles
|
|
295
306
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
296
307
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -1666,9 +1677,120 @@ var MagicLabs = (() => {
|
|
|
1666
1677
|
}
|
|
1667
1678
|
return slug;
|
|
1668
1679
|
}
|
|
1680
|
+
var external_exports = {};
|
|
1681
|
+
__export2(external_exports, {
|
|
1682
|
+
BRAND: () => BRAND,
|
|
1683
|
+
DIRTY: () => DIRTY,
|
|
1684
|
+
EMPTY_PATH: () => EMPTY_PATH,
|
|
1685
|
+
INVALID: () => INVALID,
|
|
1686
|
+
NEVER: () => NEVER,
|
|
1687
|
+
OK: () => OK,
|
|
1688
|
+
ParseStatus: () => ParseStatus,
|
|
1689
|
+
Schema: () => ZodType,
|
|
1690
|
+
ZodAny: () => ZodAny,
|
|
1691
|
+
ZodArray: () => ZodArray,
|
|
1692
|
+
ZodBigInt: () => ZodBigInt,
|
|
1693
|
+
ZodBoolean: () => ZodBoolean,
|
|
1694
|
+
ZodBranded: () => ZodBranded,
|
|
1695
|
+
ZodCatch: () => ZodCatch,
|
|
1696
|
+
ZodDate: () => ZodDate,
|
|
1697
|
+
ZodDefault: () => ZodDefault,
|
|
1698
|
+
ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
|
|
1699
|
+
ZodEffects: () => ZodEffects,
|
|
1700
|
+
ZodEnum: () => ZodEnum,
|
|
1701
|
+
ZodError: () => ZodError,
|
|
1702
|
+
ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
|
|
1703
|
+
ZodFunction: () => ZodFunction,
|
|
1704
|
+
ZodIntersection: () => ZodIntersection,
|
|
1705
|
+
ZodIssueCode: () => ZodIssueCode,
|
|
1706
|
+
ZodLazy: () => ZodLazy,
|
|
1707
|
+
ZodLiteral: () => ZodLiteral,
|
|
1708
|
+
ZodMap: () => ZodMap,
|
|
1709
|
+
ZodNaN: () => ZodNaN,
|
|
1710
|
+
ZodNativeEnum: () => ZodNativeEnum,
|
|
1711
|
+
ZodNever: () => ZodNever,
|
|
1712
|
+
ZodNull: () => ZodNull,
|
|
1713
|
+
ZodNullable: () => ZodNullable,
|
|
1714
|
+
ZodNumber: () => ZodNumber,
|
|
1715
|
+
ZodObject: () => ZodObject,
|
|
1716
|
+
ZodOptional: () => ZodOptional,
|
|
1717
|
+
ZodParsedType: () => ZodParsedType,
|
|
1718
|
+
ZodPipeline: () => ZodPipeline,
|
|
1719
|
+
ZodPromise: () => ZodPromise,
|
|
1720
|
+
ZodReadonly: () => ZodReadonly,
|
|
1721
|
+
ZodRecord: () => ZodRecord,
|
|
1722
|
+
ZodSchema: () => ZodType,
|
|
1723
|
+
ZodSet: () => ZodSet,
|
|
1724
|
+
ZodString: () => ZodString,
|
|
1725
|
+
ZodSymbol: () => ZodSymbol,
|
|
1726
|
+
ZodTransformer: () => ZodEffects,
|
|
1727
|
+
ZodTuple: () => ZodTuple,
|
|
1728
|
+
ZodType: () => ZodType,
|
|
1729
|
+
ZodUndefined: () => ZodUndefined,
|
|
1730
|
+
ZodUnion: () => ZodUnion,
|
|
1731
|
+
ZodUnknown: () => ZodUnknown,
|
|
1732
|
+
ZodVoid: () => ZodVoid,
|
|
1733
|
+
addIssueToContext: () => addIssueToContext,
|
|
1734
|
+
any: () => anyType,
|
|
1735
|
+
array: () => arrayType,
|
|
1736
|
+
bigint: () => bigIntType,
|
|
1737
|
+
boolean: () => booleanType,
|
|
1738
|
+
coerce: () => coerce,
|
|
1739
|
+
custom: () => custom,
|
|
1740
|
+
date: () => dateType,
|
|
1741
|
+
datetimeRegex: () => datetimeRegex,
|
|
1742
|
+
defaultErrorMap: () => en_default,
|
|
1743
|
+
discriminatedUnion: () => discriminatedUnionType,
|
|
1744
|
+
effect: () => effectsType,
|
|
1745
|
+
enum: () => enumType,
|
|
1746
|
+
function: () => functionType,
|
|
1747
|
+
getErrorMap: () => getErrorMap,
|
|
1748
|
+
getParsedType: () => getParsedType,
|
|
1749
|
+
instanceof: () => instanceOfType,
|
|
1750
|
+
intersection: () => intersectionType,
|
|
1751
|
+
isAborted: () => isAborted,
|
|
1752
|
+
isAsync: () => isAsync,
|
|
1753
|
+
isDirty: () => isDirty,
|
|
1754
|
+
isValid: () => isValid,
|
|
1755
|
+
late: () => late,
|
|
1756
|
+
lazy: () => lazyType,
|
|
1757
|
+
literal: () => literalType,
|
|
1758
|
+
makeIssue: () => makeIssue,
|
|
1759
|
+
map: () => mapType,
|
|
1760
|
+
nan: () => nanType,
|
|
1761
|
+
nativeEnum: () => nativeEnumType,
|
|
1762
|
+
never: () => neverType,
|
|
1763
|
+
null: () => nullType,
|
|
1764
|
+
nullable: () => nullableType,
|
|
1765
|
+
number: () => numberType,
|
|
1766
|
+
object: () => objectType,
|
|
1767
|
+
objectUtil: () => objectUtil,
|
|
1768
|
+
oboolean: () => oboolean,
|
|
1769
|
+
onumber: () => onumber,
|
|
1770
|
+
optional: () => optionalType,
|
|
1771
|
+
ostring: () => ostring,
|
|
1772
|
+
pipeline: () => pipelineType,
|
|
1773
|
+
preprocess: () => preprocessType,
|
|
1774
|
+
promise: () => promiseType,
|
|
1775
|
+
quotelessJson: () => quotelessJson,
|
|
1776
|
+
record: () => recordType,
|
|
1777
|
+
set: () => setType,
|
|
1778
|
+
setErrorMap: () => setErrorMap,
|
|
1779
|
+
strictObject: () => strictObjectType,
|
|
1780
|
+
string: () => stringType,
|
|
1781
|
+
symbol: () => symbolType,
|
|
1782
|
+
transformer: () => effectsType,
|
|
1783
|
+
tuple: () => tupleType,
|
|
1784
|
+
undefined: () => undefinedType,
|
|
1785
|
+
union: () => unionType,
|
|
1786
|
+
unknown: () => unknownType,
|
|
1787
|
+
util: () => util,
|
|
1788
|
+
void: () => voidType
|
|
1789
|
+
});
|
|
1669
1790
|
var util;
|
|
1670
1791
|
(function(util2) {
|
|
1671
|
-
util2.assertEqual = (
|
|
1792
|
+
util2.assertEqual = (_) => {
|
|
1793
|
+
};
|
|
1672
1794
|
function assertIs(_arg) {
|
|
1673
1795
|
}
|
|
1674
1796
|
util2.assertIs = assertIs;
|
|
@@ -1712,7 +1834,7 @@ var MagicLabs = (() => {
|
|
|
1712
1834
|
}
|
|
1713
1835
|
return void 0;
|
|
1714
1836
|
};
|
|
1715
|
-
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
1837
|
+
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
|
|
1716
1838
|
function joinValues(array, separator = " | ") {
|
|
1717
1839
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
1718
1840
|
}
|
|
@@ -1764,7 +1886,7 @@ var MagicLabs = (() => {
|
|
|
1764
1886
|
case "string":
|
|
1765
1887
|
return ZodParsedType.string;
|
|
1766
1888
|
case "number":
|
|
1767
|
-
return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1889
|
+
return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
|
|
1768
1890
|
case "boolean":
|
|
1769
1891
|
return ZodParsedType.boolean;
|
|
1770
1892
|
case "function":
|
|
@@ -1896,8 +2018,9 @@ var MagicLabs = (() => {
|
|
|
1896
2018
|
const formErrors = [];
|
|
1897
2019
|
for (const sub of this.issues) {
|
|
1898
2020
|
if (sub.path.length > 0) {
|
|
1899
|
-
|
|
1900
|
-
fieldErrors[
|
|
2021
|
+
const firstEl = sub.path[0];
|
|
2022
|
+
fieldErrors[firstEl] = fieldErrors[firstEl] || [];
|
|
2023
|
+
fieldErrors[firstEl].push(mapper(sub));
|
|
1901
2024
|
} else {
|
|
1902
2025
|
formErrors.push(mapper(sub));
|
|
1903
2026
|
}
|
|
@@ -1973,6 +2096,8 @@ var MagicLabs = (() => {
|
|
|
1973
2096
|
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
|
|
1974
2097
|
else if (issue.type === "number")
|
|
1975
2098
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
2099
|
+
else if (issue.type === "bigint")
|
|
2100
|
+
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
|
1976
2101
|
else if (issue.type === "date")
|
|
1977
2102
|
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
|
1978
2103
|
else
|
|
@@ -2010,7 +2135,8 @@ var MagicLabs = (() => {
|
|
|
2010
2135
|
}
|
|
2011
2136
|
return { message };
|
|
2012
2137
|
};
|
|
2013
|
-
var
|
|
2138
|
+
var en_default = errorMap;
|
|
2139
|
+
var overrideErrorMap = en_default;
|
|
2014
2140
|
function setErrorMap(map) {
|
|
2015
2141
|
overrideErrorMap = map;
|
|
2016
2142
|
}
|
|
@@ -2056,7 +2182,7 @@ var MagicLabs = (() => {
|
|
|
2056
2182
|
// then schema-bound map if available
|
|
2057
2183
|
overrideMap,
|
|
2058
2184
|
// then global override map
|
|
2059
|
-
overrideMap ===
|
|
2185
|
+
overrideMap === en_default ? void 0 : en_default
|
|
2060
2186
|
// then global default map
|
|
2061
2187
|
].filter((x) => !!x)
|
|
2062
2188
|
});
|
|
@@ -2125,29 +2251,11 @@ var MagicLabs = (() => {
|
|
|
2125
2251
|
var isDirty = (x) => x.status === "dirty";
|
|
2126
2252
|
var isValid = (x) => x.status === "valid";
|
|
2127
2253
|
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
2254
|
var errorUtil;
|
|
2145
2255
|
(function(errorUtil2) {
|
|
2146
2256
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
2147
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message
|
|
2257
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
2148
2258
|
})(errorUtil || (errorUtil = {}));
|
|
2149
|
-
var _ZodEnum_cache;
|
|
2150
|
-
var _ZodNativeEnum_cache;
|
|
2151
2259
|
var ParseInputLazyPath = class {
|
|
2152
2260
|
constructor(parent, value, path, key) {
|
|
2153
2261
|
this._cachedPath = [];
|
|
@@ -2158,7 +2266,7 @@ var MagicLabs = (() => {
|
|
|
2158
2266
|
}
|
|
2159
2267
|
get path() {
|
|
2160
2268
|
if (!this._cachedPath.length) {
|
|
2161
|
-
if (this._key
|
|
2269
|
+
if (Array.isArray(this._key)) {
|
|
2162
2270
|
this._cachedPath.push(...this._path, ...this._key);
|
|
2163
2271
|
} else {
|
|
2164
2272
|
this._cachedPath.push(...this._path, this._key);
|
|
@@ -2196,17 +2304,16 @@ var MagicLabs = (() => {
|
|
|
2196
2304
|
if (errorMap2)
|
|
2197
2305
|
return { errorMap: errorMap2, description };
|
|
2198
2306
|
const customMap = (iss, ctx) => {
|
|
2199
|
-
var _a, _b;
|
|
2200
2307
|
const { message } = params;
|
|
2201
2308
|
if (iss.code === "invalid_enum_value") {
|
|
2202
|
-
return { message: message
|
|
2309
|
+
return { message: message ?? ctx.defaultError };
|
|
2203
2310
|
}
|
|
2204
2311
|
if (typeof ctx.data === "undefined") {
|
|
2205
|
-
return { message:
|
|
2312
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
2206
2313
|
}
|
|
2207
2314
|
if (iss.code !== "invalid_type")
|
|
2208
2315
|
return { message: ctx.defaultError };
|
|
2209
|
-
return { message:
|
|
2316
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
2210
2317
|
};
|
|
2211
2318
|
return { errorMap: customMap, description };
|
|
2212
2319
|
}
|
|
@@ -2258,14 +2365,13 @@ var MagicLabs = (() => {
|
|
|
2258
2365
|
throw result.error;
|
|
2259
2366
|
}
|
|
2260
2367
|
safeParse(data, params) {
|
|
2261
|
-
var _a;
|
|
2262
2368
|
const ctx = {
|
|
2263
2369
|
common: {
|
|
2264
2370
|
issues: [],
|
|
2265
|
-
async:
|
|
2266
|
-
contextualErrorMap: params
|
|
2371
|
+
async: params?.async ?? false,
|
|
2372
|
+
contextualErrorMap: params?.errorMap
|
|
2267
2373
|
},
|
|
2268
|
-
path:
|
|
2374
|
+
path: params?.path || [],
|
|
2269
2375
|
schemaErrorMap: this._def.errorMap,
|
|
2270
2376
|
parent: null,
|
|
2271
2377
|
data,
|
|
@@ -2275,7 +2381,6 @@ var MagicLabs = (() => {
|
|
|
2275
2381
|
return handleResult(ctx, result);
|
|
2276
2382
|
}
|
|
2277
2383
|
"~validate"(data) {
|
|
2278
|
-
var _a, _b;
|
|
2279
2384
|
const ctx = {
|
|
2280
2385
|
common: {
|
|
2281
2386
|
issues: [],
|
|
@@ -2296,7 +2401,7 @@ var MagicLabs = (() => {
|
|
|
2296
2401
|
issues: ctx.common.issues
|
|
2297
2402
|
};
|
|
2298
2403
|
} catch (err) {
|
|
2299
|
-
if (
|
|
2404
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
2300
2405
|
this["~standard"].async = true;
|
|
2301
2406
|
}
|
|
2302
2407
|
ctx.common = {
|
|
@@ -2321,10 +2426,10 @@ var MagicLabs = (() => {
|
|
|
2321
2426
|
const ctx = {
|
|
2322
2427
|
common: {
|
|
2323
2428
|
issues: [],
|
|
2324
|
-
contextualErrorMap: params
|
|
2429
|
+
contextualErrorMap: params?.errorMap,
|
|
2325
2430
|
async: true
|
|
2326
2431
|
},
|
|
2327
|
-
path:
|
|
2432
|
+
path: params?.path || [],
|
|
2328
2433
|
schemaErrorMap: this._def.errorMap,
|
|
2329
2434
|
parent: null,
|
|
2330
2435
|
data,
|
|
@@ -2549,16 +2654,20 @@ var MagicLabs = (() => {
|
|
|
2549
2654
|
return false;
|
|
2550
2655
|
try {
|
|
2551
2656
|
const [header] = jwt.split(".");
|
|
2657
|
+
if (!header)
|
|
2658
|
+
return false;
|
|
2552
2659
|
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
2553
2660
|
const decoded = JSON.parse(atob(base64));
|
|
2554
2661
|
if (typeof decoded !== "object" || decoded === null)
|
|
2555
2662
|
return false;
|
|
2556
|
-
if (
|
|
2663
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
2664
|
+
return false;
|
|
2665
|
+
if (!decoded.alg)
|
|
2557
2666
|
return false;
|
|
2558
2667
|
if (alg && decoded.alg !== alg)
|
|
2559
2668
|
return false;
|
|
2560
2669
|
return true;
|
|
2561
|
-
} catch
|
|
2670
|
+
} catch {
|
|
2562
2671
|
return false;
|
|
2563
2672
|
}
|
|
2564
2673
|
}
|
|
@@ -2717,7 +2826,7 @@ var MagicLabs = (() => {
|
|
|
2717
2826
|
} else if (check.kind === "url") {
|
|
2718
2827
|
try {
|
|
2719
2828
|
new URL(input.data);
|
|
2720
|
-
} catch
|
|
2829
|
+
} catch {
|
|
2721
2830
|
ctx = this._getOrReturnCtx(input, ctx);
|
|
2722
2831
|
addIssueToContext(ctx, {
|
|
2723
2832
|
validation: "url",
|
|
@@ -2929,7 +3038,6 @@ var MagicLabs = (() => {
|
|
|
2929
3038
|
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
2930
3039
|
}
|
|
2931
3040
|
datetime(options) {
|
|
2932
|
-
var _a, _b;
|
|
2933
3041
|
if (typeof options === "string") {
|
|
2934
3042
|
return this._addCheck({
|
|
2935
3043
|
kind: "datetime",
|
|
@@ -2941,10 +3049,10 @@ var MagicLabs = (() => {
|
|
|
2941
3049
|
}
|
|
2942
3050
|
return this._addCheck({
|
|
2943
3051
|
kind: "datetime",
|
|
2944
|
-
precision: typeof
|
|
2945
|
-
offset:
|
|
2946
|
-
local:
|
|
2947
|
-
...errorUtil.errToObj(options
|
|
3052
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3053
|
+
offset: options?.offset ?? false,
|
|
3054
|
+
local: options?.local ?? false,
|
|
3055
|
+
...errorUtil.errToObj(options?.message)
|
|
2948
3056
|
});
|
|
2949
3057
|
}
|
|
2950
3058
|
date(message) {
|
|
@@ -2960,8 +3068,8 @@ var MagicLabs = (() => {
|
|
|
2960
3068
|
}
|
|
2961
3069
|
return this._addCheck({
|
|
2962
3070
|
kind: "time",
|
|
2963
|
-
precision: typeof
|
|
2964
|
-
...errorUtil.errToObj(options
|
|
3071
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
3072
|
+
...errorUtil.errToObj(options?.message)
|
|
2965
3073
|
});
|
|
2966
3074
|
}
|
|
2967
3075
|
duration(message) {
|
|
@@ -2978,8 +3086,8 @@ var MagicLabs = (() => {
|
|
|
2978
3086
|
return this._addCheck({
|
|
2979
3087
|
kind: "includes",
|
|
2980
3088
|
value,
|
|
2981
|
-
position: options
|
|
2982
|
-
...errorUtil.errToObj(options
|
|
3089
|
+
position: options?.position,
|
|
3090
|
+
...errorUtil.errToObj(options?.message)
|
|
2983
3091
|
});
|
|
2984
3092
|
}
|
|
2985
3093
|
startsWith(value, message) {
|
|
@@ -3111,11 +3219,10 @@ var MagicLabs = (() => {
|
|
|
3111
3219
|
}
|
|
3112
3220
|
};
|
|
3113
3221
|
ZodString.create = (params) => {
|
|
3114
|
-
var _a;
|
|
3115
3222
|
return new ZodString({
|
|
3116
3223
|
checks: [],
|
|
3117
3224
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
3118
|
-
coerce:
|
|
3225
|
+
coerce: params?.coerce ?? false,
|
|
3119
3226
|
...processCreateParams(params)
|
|
3120
3227
|
});
|
|
3121
3228
|
};
|
|
@@ -3123,9 +3230,9 @@ var MagicLabs = (() => {
|
|
|
3123
3230
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
3124
3231
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
3125
3232
|
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 /
|
|
3233
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
3234
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
3235
|
+
return valInt % stepInt / 10 ** decCount;
|
|
3129
3236
|
}
|
|
3130
3237
|
var ZodNumber = class _ZodNumber extends ZodType {
|
|
3131
3238
|
constructor() {
|
|
@@ -3335,7 +3442,8 @@ var MagicLabs = (() => {
|
|
|
3335
3442
|
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
3336
3443
|
}
|
|
3337
3444
|
get isFinite() {
|
|
3338
|
-
let max = null
|
|
3445
|
+
let max = null;
|
|
3446
|
+
let min = null;
|
|
3339
3447
|
for (const ch of this._def.checks) {
|
|
3340
3448
|
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
3341
3449
|
return true;
|
|
@@ -3354,7 +3462,7 @@ var MagicLabs = (() => {
|
|
|
3354
3462
|
return new ZodNumber({
|
|
3355
3463
|
checks: [],
|
|
3356
3464
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
3357
|
-
coerce:
|
|
3465
|
+
coerce: params?.coerce || false,
|
|
3358
3466
|
...processCreateParams(params)
|
|
3359
3467
|
});
|
|
3360
3468
|
};
|
|
@@ -3368,7 +3476,7 @@ var MagicLabs = (() => {
|
|
|
3368
3476
|
if (this._def.coerce) {
|
|
3369
3477
|
try {
|
|
3370
3478
|
input.data = BigInt(input.data);
|
|
3371
|
-
} catch
|
|
3479
|
+
} catch {
|
|
3372
3480
|
return this._getInvalidInput(input);
|
|
3373
3481
|
}
|
|
3374
3482
|
}
|
|
@@ -3523,11 +3631,10 @@ var MagicLabs = (() => {
|
|
|
3523
3631
|
}
|
|
3524
3632
|
};
|
|
3525
3633
|
ZodBigInt.create = (params) => {
|
|
3526
|
-
var _a;
|
|
3527
3634
|
return new ZodBigInt({
|
|
3528
3635
|
checks: [],
|
|
3529
3636
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
3530
|
-
coerce:
|
|
3637
|
+
coerce: params?.coerce ?? false,
|
|
3531
3638
|
...processCreateParams(params)
|
|
3532
3639
|
});
|
|
3533
3640
|
};
|
|
@@ -3552,7 +3659,7 @@ var MagicLabs = (() => {
|
|
|
3552
3659
|
ZodBoolean.create = (params) => {
|
|
3553
3660
|
return new ZodBoolean({
|
|
3554
3661
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
3555
|
-
coerce:
|
|
3662
|
+
coerce: params?.coerce || false,
|
|
3556
3663
|
...processCreateParams(params)
|
|
3557
3664
|
});
|
|
3558
3665
|
};
|
|
@@ -3571,7 +3678,7 @@ var MagicLabs = (() => {
|
|
|
3571
3678
|
});
|
|
3572
3679
|
return INVALID;
|
|
3573
3680
|
}
|
|
3574
|
-
if (isNaN(input.data.getTime())) {
|
|
3681
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
3575
3682
|
const ctx2 = this._getOrReturnCtx(input);
|
|
3576
3683
|
addIssueToContext(ctx2, {
|
|
3577
3684
|
code: ZodIssueCode.invalid_date
|
|
@@ -3660,7 +3767,7 @@ var MagicLabs = (() => {
|
|
|
3660
3767
|
ZodDate.create = (params) => {
|
|
3661
3768
|
return new ZodDate({
|
|
3662
3769
|
checks: [],
|
|
3663
|
-
coerce:
|
|
3770
|
+
coerce: params?.coerce || false,
|
|
3664
3771
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
3665
3772
|
...processCreateParams(params)
|
|
3666
3773
|
});
|
|
@@ -3935,7 +4042,8 @@ var MagicLabs = (() => {
|
|
|
3935
4042
|
return this._cached;
|
|
3936
4043
|
const shape = this._def.shape();
|
|
3937
4044
|
const keys = util.objectKeys(shape);
|
|
3938
|
-
|
|
4045
|
+
this._cached = { shape, keys };
|
|
4046
|
+
return this._cached;
|
|
3939
4047
|
}
|
|
3940
4048
|
_parse(input) {
|
|
3941
4049
|
const parsedType = this._getType(input);
|
|
@@ -3985,9 +4093,8 @@ var MagicLabs = (() => {
|
|
|
3985
4093
|
});
|
|
3986
4094
|
status.dirty();
|
|
3987
4095
|
}
|
|
3988
|
-
} else if (unknownKeys === "strip")
|
|
3989
|
-
|
|
3990
|
-
else {
|
|
4096
|
+
} else if (unknownKeys === "strip") {
|
|
4097
|
+
} else {
|
|
3991
4098
|
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
3992
4099
|
}
|
|
3993
4100
|
} else {
|
|
@@ -4034,11 +4141,10 @@ var MagicLabs = (() => {
|
|
|
4034
4141
|
unknownKeys: "strict",
|
|
4035
4142
|
...message !== void 0 ? {
|
|
4036
4143
|
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;
|
|
4144
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
4039
4145
|
if (issue.code === "unrecognized_keys")
|
|
4040
4146
|
return {
|
|
4041
|
-
message:
|
|
4147
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
4042
4148
|
};
|
|
4043
4149
|
return {
|
|
4044
4150
|
message: defaultError
|
|
@@ -4169,11 +4275,11 @@ var MagicLabs = (() => {
|
|
|
4169
4275
|
}
|
|
4170
4276
|
pick(mask) {
|
|
4171
4277
|
const shape = {};
|
|
4172
|
-
util.objectKeys(mask)
|
|
4278
|
+
for (const key of util.objectKeys(mask)) {
|
|
4173
4279
|
if (mask[key] && this.shape[key]) {
|
|
4174
4280
|
shape[key] = this.shape[key];
|
|
4175
4281
|
}
|
|
4176
|
-
}
|
|
4282
|
+
}
|
|
4177
4283
|
return new _ZodObject({
|
|
4178
4284
|
...this._def,
|
|
4179
4285
|
shape: () => shape
|
|
@@ -4181,11 +4287,11 @@ var MagicLabs = (() => {
|
|
|
4181
4287
|
}
|
|
4182
4288
|
omit(mask) {
|
|
4183
4289
|
const shape = {};
|
|
4184
|
-
util.objectKeys(this.shape)
|
|
4290
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4185
4291
|
if (!mask[key]) {
|
|
4186
4292
|
shape[key] = this.shape[key];
|
|
4187
4293
|
}
|
|
4188
|
-
}
|
|
4294
|
+
}
|
|
4189
4295
|
return new _ZodObject({
|
|
4190
4296
|
...this._def,
|
|
4191
4297
|
shape: () => shape
|
|
@@ -4199,14 +4305,14 @@ var MagicLabs = (() => {
|
|
|
4199
4305
|
}
|
|
4200
4306
|
partial(mask) {
|
|
4201
4307
|
const newShape = {};
|
|
4202
|
-
util.objectKeys(this.shape)
|
|
4308
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4203
4309
|
const fieldSchema = this.shape[key];
|
|
4204
4310
|
if (mask && !mask[key]) {
|
|
4205
4311
|
newShape[key] = fieldSchema;
|
|
4206
4312
|
} else {
|
|
4207
4313
|
newShape[key] = fieldSchema.optional();
|
|
4208
4314
|
}
|
|
4209
|
-
}
|
|
4315
|
+
}
|
|
4210
4316
|
return new _ZodObject({
|
|
4211
4317
|
...this._def,
|
|
4212
4318
|
shape: () => newShape
|
|
@@ -4214,7 +4320,7 @@ var MagicLabs = (() => {
|
|
|
4214
4320
|
}
|
|
4215
4321
|
required(mask) {
|
|
4216
4322
|
const newShape = {};
|
|
4217
|
-
util.objectKeys(this.shape)
|
|
4323
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
4218
4324
|
if (mask && !mask[key]) {
|
|
4219
4325
|
newShape[key] = this.shape[key];
|
|
4220
4326
|
} else {
|
|
@@ -4225,7 +4331,7 @@ var MagicLabs = (() => {
|
|
|
4225
4331
|
}
|
|
4226
4332
|
newShape[key] = newField;
|
|
4227
4333
|
}
|
|
4228
|
-
}
|
|
4334
|
+
}
|
|
4229
4335
|
return new _ZodObject({
|
|
4230
4336
|
...this._def,
|
|
4231
4337
|
shape: () => newShape
|
|
@@ -4841,12 +4947,7 @@ var MagicLabs = (() => {
|
|
|
4841
4947
|
return makeIssue({
|
|
4842
4948
|
data: args,
|
|
4843
4949
|
path: ctx.path,
|
|
4844
|
-
errorMaps: [
|
|
4845
|
-
ctx.common.contextualErrorMap,
|
|
4846
|
-
ctx.schemaErrorMap,
|
|
4847
|
-
getErrorMap(),
|
|
4848
|
-
errorMap
|
|
4849
|
-
].filter((x) => !!x),
|
|
4950
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4850
4951
|
issueData: {
|
|
4851
4952
|
code: ZodIssueCode.invalid_arguments,
|
|
4852
4953
|
argumentsError: error
|
|
@@ -4857,12 +4958,7 @@ var MagicLabs = (() => {
|
|
|
4857
4958
|
return makeIssue({
|
|
4858
4959
|
data: returns,
|
|
4859
4960
|
path: ctx.path,
|
|
4860
|
-
errorMaps: [
|
|
4861
|
-
ctx.common.contextualErrorMap,
|
|
4862
|
-
ctx.schemaErrorMap,
|
|
4863
|
-
getErrorMap(),
|
|
4864
|
-
errorMap
|
|
4865
|
-
].filter((x) => !!x),
|
|
4961
|
+
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x),
|
|
4866
4962
|
issueData: {
|
|
4867
4963
|
code: ZodIssueCode.invalid_return_type,
|
|
4868
4964
|
returnTypeError: error
|
|
@@ -4986,10 +5082,6 @@ var MagicLabs = (() => {
|
|
|
4986
5082
|
});
|
|
4987
5083
|
}
|
|
4988
5084
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
4989
|
-
constructor() {
|
|
4990
|
-
super(...arguments);
|
|
4991
|
-
_ZodEnum_cache.set(this, void 0);
|
|
4992
|
-
}
|
|
4993
5085
|
_parse(input) {
|
|
4994
5086
|
if (typeof input.data !== "string") {
|
|
4995
5087
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5001,10 +5093,10 @@ var MagicLabs = (() => {
|
|
|
5001
5093
|
});
|
|
5002
5094
|
return INVALID;
|
|
5003
5095
|
}
|
|
5004
|
-
if (!
|
|
5005
|
-
|
|
5096
|
+
if (!this._cache) {
|
|
5097
|
+
this._cache = new Set(this._def.values);
|
|
5006
5098
|
}
|
|
5007
|
-
if (!
|
|
5099
|
+
if (!this._cache.has(input.data)) {
|
|
5008
5100
|
const ctx = this._getOrReturnCtx(input);
|
|
5009
5101
|
const expectedValues = this._def.values;
|
|
5010
5102
|
addIssueToContext(ctx, {
|
|
@@ -5053,13 +5145,8 @@ var MagicLabs = (() => {
|
|
|
5053
5145
|
});
|
|
5054
5146
|
}
|
|
5055
5147
|
};
|
|
5056
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5057
5148
|
ZodEnum.create = createZodEnum;
|
|
5058
5149
|
var ZodNativeEnum = class extends ZodType {
|
|
5059
|
-
constructor() {
|
|
5060
|
-
super(...arguments);
|
|
5061
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
|
5062
|
-
}
|
|
5063
5150
|
_parse(input) {
|
|
5064
5151
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
5065
5152
|
const ctx = this._getOrReturnCtx(input);
|
|
@@ -5072,10 +5159,10 @@ var MagicLabs = (() => {
|
|
|
5072
5159
|
});
|
|
5073
5160
|
return INVALID;
|
|
5074
5161
|
}
|
|
5075
|
-
if (!
|
|
5076
|
-
|
|
5162
|
+
if (!this._cache) {
|
|
5163
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
5077
5164
|
}
|
|
5078
|
-
if (!
|
|
5165
|
+
if (!this._cache.has(input.data)) {
|
|
5079
5166
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
5080
5167
|
addIssueToContext(ctx, {
|
|
5081
5168
|
received: ctx.data,
|
|
@@ -5090,7 +5177,6 @@ var MagicLabs = (() => {
|
|
|
5090
5177
|
return this._def.values;
|
|
5091
5178
|
}
|
|
5092
5179
|
};
|
|
5093
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
|
5094
5180
|
ZodNativeEnum.create = (values, params) => {
|
|
5095
5181
|
return new ZodNativeEnum({
|
|
5096
5182
|
values,
|
|
@@ -5231,7 +5317,7 @@ var MagicLabs = (() => {
|
|
|
5231
5317
|
parent: ctx
|
|
5232
5318
|
});
|
|
5233
5319
|
if (!isValid(base))
|
|
5234
|
-
return
|
|
5320
|
+
return INVALID;
|
|
5235
5321
|
const result = effect.transform(base.value, checkCtx);
|
|
5236
5322
|
if (result instanceof Promise) {
|
|
5237
5323
|
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
@@ -5240,8 +5326,11 @@ var MagicLabs = (() => {
|
|
|
5240
5326
|
} else {
|
|
5241
5327
|
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
5242
5328
|
if (!isValid(base))
|
|
5243
|
-
return
|
|
5244
|
-
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5329
|
+
return INVALID;
|
|
5330
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
5331
|
+
status: status.value,
|
|
5332
|
+
value: result
|
|
5333
|
+
}));
|
|
5245
5334
|
});
|
|
5246
5335
|
}
|
|
5247
5336
|
}
|
|
@@ -5501,21 +5590,19 @@ var MagicLabs = (() => {
|
|
|
5501
5590
|
function custom(check, _params = {}, fatal) {
|
|
5502
5591
|
if (check)
|
|
5503
5592
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5504
|
-
var _a, _b;
|
|
5505
5593
|
const r = check(data);
|
|
5506
5594
|
if (r instanceof Promise) {
|
|
5507
5595
|
return r.then((r2) => {
|
|
5508
|
-
var _a2, _b2;
|
|
5509
5596
|
if (!r2) {
|
|
5510
5597
|
const params = cleanParams(_params, data);
|
|
5511
|
-
const _fatal =
|
|
5598
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5512
5599
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5513
5600
|
}
|
|
5514
5601
|
});
|
|
5515
5602
|
}
|
|
5516
5603
|
if (!r) {
|
|
5517
5604
|
const params = cleanParams(_params, data);
|
|
5518
|
-
const _fatal =
|
|
5605
|
+
const _fatal = params.fatal ?? fatal ?? true;
|
|
5519
5606
|
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5520
5607
|
}
|
|
5521
5608
|
return;
|
|
@@ -5615,122 +5702,6 @@ var MagicLabs = (() => {
|
|
|
5615
5702
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
5616
5703
|
};
|
|
5617
5704
|
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
5705
|
var BookDesignRequest = class {
|
|
5735
5706
|
occasion;
|
|
5736
5707
|
style;
|
|
@@ -5753,29 +5724,29 @@ var MagicLabs = (() => {
|
|
|
5753
5724
|
this.text_sticker_level = props.text_sticker_level;
|
|
5754
5725
|
}
|
|
5755
5726
|
};
|
|
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:
|
|
5727
|
+
var bookDesignRequestSchema = external_exports.object({
|
|
5728
|
+
occasion: external_exports.enum(occasions),
|
|
5729
|
+
style: external_exports.string(),
|
|
5730
|
+
book_size: external_exports.enum(bookSizes),
|
|
5731
|
+
cover_type: external_exports.enum(coverTypes),
|
|
5732
|
+
page_type: external_exports.enum(pageTypes),
|
|
5733
|
+
image_density: external_exports.enum(imageDensities),
|
|
5734
|
+
image_filtering_level: external_exports.enum(imageFilteringLevels),
|
|
5735
|
+
embellishment_level: external_exports.enum(embellishmentLevels),
|
|
5736
|
+
text_sticker_level: external_exports.enum(textStickerLevels)
|
|
5766
5737
|
});
|
|
5767
|
-
var bookPropsSchema =
|
|
5768
|
-
id:
|
|
5769
|
-
title:
|
|
5770
|
-
subtitle:
|
|
5738
|
+
var bookPropsSchema = external_exports.object({
|
|
5739
|
+
id: external_exports.string().optional(),
|
|
5740
|
+
title: external_exports.string(),
|
|
5741
|
+
subtitle: external_exports.string().optional(),
|
|
5771
5742
|
design_request: bookDesignRequestSchema,
|
|
5772
|
-
sku:
|
|
5773
|
-
state:
|
|
5774
|
-
guid:
|
|
5775
|
-
cancelled_at:
|
|
5776
|
-
mb_client_timeout:
|
|
5777
|
-
user_id:
|
|
5778
|
-
revision:
|
|
5743
|
+
sku: external_exports.string().optional(),
|
|
5744
|
+
state: external_exports.enum(states).optional(),
|
|
5745
|
+
guid: external_exports.string().optional(),
|
|
5746
|
+
cancelled_at: external_exports.string().optional(),
|
|
5747
|
+
mb_client_timeout: external_exports.number().optional(),
|
|
5748
|
+
user_id: external_exports.string().optional(),
|
|
5749
|
+
revision: external_exports.number().optional()
|
|
5779
5750
|
});
|
|
5780
5751
|
var Book = class {
|
|
5781
5752
|
id;
|
|
@@ -5854,18 +5825,18 @@ var MagicLabs = (() => {
|
|
|
5854
5825
|
}
|
|
5855
5826
|
}
|
|
5856
5827
|
};
|
|
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:
|
|
5828
|
+
var imageServerSchema = external_exports.object({
|
|
5829
|
+
id: external_exports.string().optional(),
|
|
5830
|
+
handle: external_exports.string(),
|
|
5831
|
+
url: external_exports.string(),
|
|
5832
|
+
width: external_exports.number(),
|
|
5833
|
+
height: external_exports.number(),
|
|
5834
|
+
orientation: external_exports.number(),
|
|
5835
|
+
taken_at: external_exports.string(),
|
|
5836
|
+
camera_make: external_exports.string().optional(),
|
|
5837
|
+
camera: external_exports.string().optional(),
|
|
5838
|
+
filename: external_exports.string(),
|
|
5839
|
+
metadata: external_exports.record(external_exports.unknown()).optional()
|
|
5869
5840
|
});
|
|
5870
5841
|
var ImageServer = class {
|
|
5871
5842
|
id;
|
|
@@ -5908,34 +5879,34 @@ var MagicLabs = (() => {
|
|
|
5908
5879
|
metadata: imageServer.metadata
|
|
5909
5880
|
};
|
|
5910
5881
|
}
|
|
5911
|
-
var imageDensityOptionSchema =
|
|
5912
|
-
maxPageCount:
|
|
5913
|
-
minPageCount:
|
|
5914
|
-
maxImageCount:
|
|
5915
|
-
avgImageCount:
|
|
5916
|
-
minImageCount:
|
|
5882
|
+
var imageDensityOptionSchema = external_exports.object({
|
|
5883
|
+
maxPageCount: external_exports.number(),
|
|
5884
|
+
minPageCount: external_exports.number(),
|
|
5885
|
+
maxImageCount: external_exports.number(),
|
|
5886
|
+
avgImageCount: external_exports.number(),
|
|
5887
|
+
minImageCount: external_exports.number()
|
|
5917
5888
|
});
|
|
5918
|
-
var imageDensityOptionsSchema =
|
|
5889
|
+
var imageDensityOptionsSchema = external_exports.object({
|
|
5919
5890
|
high: imageDensityOptionSchema,
|
|
5920
5891
|
medium: imageDensityOptionSchema,
|
|
5921
5892
|
low: imageDensityOptionSchema
|
|
5922
5893
|
});
|
|
5923
|
-
var designOptionsSchema =
|
|
5894
|
+
var designOptionsSchema = external_exports.object({
|
|
5924
5895
|
densities: imageDensityOptionsSchema
|
|
5925
5896
|
});
|
|
5926
|
-
var imageDensityOptionServerSchema =
|
|
5927
|
-
max_page_count:
|
|
5928
|
-
min_page_count:
|
|
5929
|
-
max_image_count:
|
|
5930
|
-
avg_image_count:
|
|
5931
|
-
min_image_count:
|
|
5897
|
+
var imageDensityOptionServerSchema = external_exports.object({
|
|
5898
|
+
max_page_count: external_exports.number(),
|
|
5899
|
+
min_page_count: external_exports.number(),
|
|
5900
|
+
max_image_count: external_exports.number(),
|
|
5901
|
+
avg_image_count: external_exports.number(),
|
|
5902
|
+
min_image_count: external_exports.number()
|
|
5932
5903
|
});
|
|
5933
|
-
var imageDensityOptionsServerSchema =
|
|
5904
|
+
var imageDensityOptionsServerSchema = external_exports.object({
|
|
5934
5905
|
high: imageDensityOptionServerSchema,
|
|
5935
5906
|
medium: imageDensityOptionServerSchema,
|
|
5936
5907
|
low: imageDensityOptionServerSchema
|
|
5937
5908
|
});
|
|
5938
|
-
var designOptionsServerSchema =
|
|
5909
|
+
var designOptionsServerSchema = external_exports.object({
|
|
5939
5910
|
densities: imageDensityOptionsServerSchema
|
|
5940
5911
|
});
|
|
5941
5912
|
var DesignRequestOptions = {
|
|
@@ -6225,9 +6196,9 @@ var MagicLabs = (() => {
|
|
|
6225
6196
|
});
|
|
6226
6197
|
}
|
|
6227
6198
|
};
|
|
6228
|
-
var eventContextSchema =
|
|
6229
|
-
var eventSchema =
|
|
6230
|
-
name:
|
|
6199
|
+
var eventContextSchema = external_exports.record(external_exports.string(), external_exports.unknown()).optional();
|
|
6200
|
+
var eventSchema = external_exports.object({
|
|
6201
|
+
name: external_exports.string(),
|
|
6231
6202
|
context: eventContextSchema
|
|
6232
6203
|
});
|
|
6233
6204
|
var EventsEndpoints = class {
|
|
@@ -6311,7 +6282,7 @@ var MagicLabs = (() => {
|
|
|
6311
6282
|
const res = await this.engineAPI.fetcher.call({
|
|
6312
6283
|
path: `/v1/images/book/${bookId}`
|
|
6313
6284
|
});
|
|
6314
|
-
return
|
|
6285
|
+
return external_exports.array(imageServerSchema).parse(res);
|
|
6315
6286
|
});
|
|
6316
6287
|
}
|
|
6317
6288
|
retrieve(imageId, bookId) {
|
|
@@ -6357,117 +6328,117 @@ var MagicLabs = (() => {
|
|
|
6357
6328
|
});
|
|
6358
6329
|
}
|
|
6359
6330
|
};
|
|
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:
|
|
6331
|
+
var spreadServerSchema = external_exports.object({
|
|
6332
|
+
id: external_exports.string(),
|
|
6333
|
+
book_id: external_exports.string(),
|
|
6334
|
+
state: external_exports.string(),
|
|
6335
|
+
spread_type: external_exports.string(),
|
|
6336
|
+
width: external_exports.number(),
|
|
6337
|
+
height: external_exports.number(),
|
|
6338
|
+
sequence: external_exports.number(),
|
|
6339
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6340
|
+
background: external_exports.unknown(),
|
|
6341
|
+
laid_out_at: external_exports.string().nullable(),
|
|
6342
|
+
embellished_at: external_exports.string().nullable(),
|
|
6343
|
+
polished_at: external_exports.string().nullable(),
|
|
6344
|
+
metadata: external_exports.unknown(),
|
|
6345
|
+
url: external_exports.string().nullable().optional()
|
|
6375
6346
|
});
|
|
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:
|
|
6347
|
+
var spreadSchema = external_exports.object({
|
|
6348
|
+
id: external_exports.string(),
|
|
6349
|
+
bookId: external_exports.string(),
|
|
6350
|
+
state: external_exports.string(),
|
|
6351
|
+
spreadType: external_exports.string(),
|
|
6352
|
+
width: external_exports.number(),
|
|
6353
|
+
height: external_exports.number(),
|
|
6354
|
+
sequence: external_exports.number(),
|
|
6355
|
+
wells: external_exports.array(external_exports.unknown()),
|
|
6356
|
+
background: external_exports.unknown(),
|
|
6357
|
+
laidOutAt: external_exports.string().nullable(),
|
|
6358
|
+
embellishedAt: external_exports.string().nullable(),
|
|
6359
|
+
polishedAt: external_exports.string().nullable(),
|
|
6360
|
+
metadata: external_exports.unknown(),
|
|
6361
|
+
url: external_exports.string().nullable().optional()
|
|
6391
6362
|
});
|
|
6392
|
-
var imageAssignmentSchema =
|
|
6393
|
-
photoRefId:
|
|
6394
|
-
finalCrop:
|
|
6363
|
+
var imageAssignmentSchema = external_exports.object({
|
|
6364
|
+
photoRefId: external_exports.string(),
|
|
6365
|
+
finalCrop: external_exports.array(external_exports.number())
|
|
6395
6366
|
});
|
|
6396
|
-
var positionSchema =
|
|
6397
|
-
x:
|
|
6398
|
-
y:
|
|
6399
|
-
width:
|
|
6400
|
-
height:
|
|
6401
|
-
rotation:
|
|
6367
|
+
var positionSchema = external_exports.object({
|
|
6368
|
+
x: external_exports.number(),
|
|
6369
|
+
y: external_exports.number(),
|
|
6370
|
+
width: external_exports.number().optional(),
|
|
6371
|
+
height: external_exports.number().optional(),
|
|
6372
|
+
rotation: external_exports.number()
|
|
6402
6373
|
});
|
|
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:
|
|
6374
|
+
var photoMetadataSchema = external_exports.object({
|
|
6375
|
+
id: external_exports.string(),
|
|
6376
|
+
llx: external_exports.number(),
|
|
6377
|
+
lly: external_exports.number(),
|
|
6378
|
+
urx: external_exports.number(),
|
|
6379
|
+
ury: external_exports.number(),
|
|
6380
|
+
data: external_exports.string().nullable(),
|
|
6381
|
+
title: external_exports.string(),
|
|
6382
|
+
width: external_exports.number(),
|
|
6383
|
+
effect: external_exports.string(),
|
|
6384
|
+
height: external_exports.number(),
|
|
6385
|
+
source: external_exports.string(),
|
|
6386
|
+
rotation: external_exports.number(),
|
|
6387
|
+
uploadTime: external_exports.string()
|
|
6417
6388
|
});
|
|
6418
|
-
var propertySchema =
|
|
6419
|
-
key:
|
|
6420
|
-
value:
|
|
6389
|
+
var propertySchema = external_exports.object({
|
|
6390
|
+
key: external_exports.string(),
|
|
6391
|
+
value: external_exports.any()
|
|
6421
6392
|
});
|
|
6422
|
-
var assetSchema =
|
|
6423
|
-
type:
|
|
6393
|
+
var assetSchema = external_exports.object({
|
|
6394
|
+
type: external_exports.string(),
|
|
6424
6395
|
imageAssignment: imageAssignmentSchema.optional(),
|
|
6425
6396
|
position: positionSchema,
|
|
6426
|
-
seqNum:
|
|
6427
|
-
z:
|
|
6428
|
-
id:
|
|
6429
|
-
horizJustification:
|
|
6430
|
-
vertJustification:
|
|
6431
|
-
text:
|
|
6432
|
-
fontId:
|
|
6433
|
-
fontSize:
|
|
6434
|
-
fontColor:
|
|
6435
|
-
frame:
|
|
6397
|
+
seqNum: external_exports.number(),
|
|
6398
|
+
z: external_exports.number(),
|
|
6399
|
+
id: external_exports.string().optional(),
|
|
6400
|
+
horizJustification: external_exports.string().optional(),
|
|
6401
|
+
vertJustification: external_exports.string().optional().nullable(),
|
|
6402
|
+
text: external_exports.string().optional(),
|
|
6403
|
+
fontId: external_exports.string().optional(),
|
|
6404
|
+
fontSize: external_exports.number().optional(),
|
|
6405
|
+
fontColor: external_exports.string().optional(),
|
|
6406
|
+
frame: external_exports.string().optional()
|
|
6436
6407
|
});
|
|
6437
|
-
var photoStripSchema =
|
|
6438
|
-
url:
|
|
6439
|
-
encryptId:
|
|
6440
|
-
photoRefId:
|
|
6441
|
-
photoId:
|
|
6408
|
+
var photoStripSchema = external_exports.object({
|
|
6409
|
+
url: external_exports.string(),
|
|
6410
|
+
encryptId: external_exports.string(),
|
|
6411
|
+
photoRefId: external_exports.string(),
|
|
6412
|
+
photoId: external_exports.string(),
|
|
6442
6413
|
photoMetadata: photoMetadataSchema
|
|
6443
6414
|
});
|
|
6444
|
-
var reportingDataSchema =
|
|
6445
|
-
properties:
|
|
6415
|
+
var reportingDataSchema = external_exports.object({
|
|
6416
|
+
properties: external_exports.array(propertySchema)
|
|
6446
6417
|
});
|
|
6447
|
-
var sflyCanvasSchema =
|
|
6448
|
-
backgroundId:
|
|
6449
|
-
assets:
|
|
6418
|
+
var sflyCanvasSchema = external_exports.object({
|
|
6419
|
+
backgroundId: external_exports.string().nullable(),
|
|
6420
|
+
assets: external_exports.array(assetSchema).optional()
|
|
6450
6421
|
});
|
|
6451
|
-
var snapCanvasSchema =
|
|
6452
|
-
surfaceNumber:
|
|
6453
|
-
surfaceData:
|
|
6454
|
-
version:
|
|
6422
|
+
var snapCanvasSchema = external_exports.object({
|
|
6423
|
+
surfaceNumber: external_exports.number(),
|
|
6424
|
+
surfaceData: external_exports.record(external_exports.any()),
|
|
6425
|
+
version: external_exports.string()
|
|
6455
6426
|
});
|
|
6456
|
-
var pageSchema =
|
|
6457
|
-
pageNum:
|
|
6458
|
-
type:
|
|
6427
|
+
var pageSchema = external_exports.object({
|
|
6428
|
+
pageNum: external_exports.number(),
|
|
6429
|
+
type: external_exports.string(),
|
|
6459
6430
|
canvas: sflyCanvasSchema
|
|
6460
6431
|
});
|
|
6461
|
-
var magicShopBookSchema =
|
|
6462
|
-
pages:
|
|
6463
|
-
photoStrip:
|
|
6432
|
+
var magicShopBookSchema = external_exports.object({
|
|
6433
|
+
pages: external_exports.array(pageSchema),
|
|
6434
|
+
photoStrip: external_exports.array(photoStripSchema)
|
|
6464
6435
|
});
|
|
6465
|
-
var bookCreationRequestSchema =
|
|
6466
|
-
title:
|
|
6467
|
-
binding:
|
|
6468
|
-
coverSpecId:
|
|
6469
|
-
styleId:
|
|
6470
|
-
userId:
|
|
6436
|
+
var bookCreationRequestSchema = external_exports.object({
|
|
6437
|
+
title: external_exports.string(),
|
|
6438
|
+
binding: external_exports.string(),
|
|
6439
|
+
coverSpecId: external_exports.string(),
|
|
6440
|
+
styleId: external_exports.number(),
|
|
6441
|
+
userId: external_exports.string(),
|
|
6471
6442
|
magicShopBook: magicShopBookSchema,
|
|
6472
6443
|
reportingData: reportingDataSchema
|
|
6473
6444
|
});
|
|
@@ -6482,7 +6453,7 @@ var MagicLabs = (() => {
|
|
|
6482
6453
|
const res = await this.engineAPI.fetcher.call({
|
|
6483
6454
|
path: `/v1/spreads/book/${bookId}`
|
|
6484
6455
|
});
|
|
6485
|
-
return
|
|
6456
|
+
return external_exports.array(spreadServerSchema).parse(res);
|
|
6486
6457
|
});
|
|
6487
6458
|
}
|
|
6488
6459
|
create(bookId, spread) {
|
|
@@ -6548,96 +6519,96 @@ var MagicLabs = (() => {
|
|
|
6548
6519
|
})
|
|
6549
6520
|
}
|
|
6550
6521
|
});
|
|
6551
|
-
return
|
|
6522
|
+
return external_exports.array(surfaceCategoryName ? snapCanvasSchema : sflyCanvasSchema).parse(res);
|
|
6552
6523
|
});
|
|
6553
6524
|
}
|
|
6554
6525
|
};
|
|
6555
|
-
var StoryboardItemImageFaceServerSchema =
|
|
6556
|
-
score:
|
|
6557
|
-
bounding_box:
|
|
6558
|
-
x:
|
|
6559
|
-
y:
|
|
6560
|
-
width:
|
|
6561
|
-
height:
|
|
6526
|
+
var StoryboardItemImageFaceServerSchema = external_exports.object({
|
|
6527
|
+
score: external_exports.number(),
|
|
6528
|
+
bounding_box: external_exports.object({
|
|
6529
|
+
x: external_exports.number(),
|
|
6530
|
+
y: external_exports.number(),
|
|
6531
|
+
width: external_exports.number(),
|
|
6532
|
+
height: external_exports.number()
|
|
6562
6533
|
}),
|
|
6563
|
-
size:
|
|
6564
|
-
eyes_open_score:
|
|
6565
|
-
smile_score:
|
|
6566
|
-
facing_camera_score:
|
|
6534
|
+
size: external_exports.number(),
|
|
6535
|
+
eyes_open_score: external_exports.number(),
|
|
6536
|
+
smile_score: external_exports.number(),
|
|
6537
|
+
facing_camera_score: external_exports.number()
|
|
6567
6538
|
});
|
|
6568
|
-
var StoryboardItemImageFaceSchema =
|
|
6569
|
-
score:
|
|
6570
|
-
boundingBox:
|
|
6571
|
-
x:
|
|
6572
|
-
y:
|
|
6573
|
-
width:
|
|
6574
|
-
height:
|
|
6539
|
+
var StoryboardItemImageFaceSchema = external_exports.object({
|
|
6540
|
+
score: external_exports.number(),
|
|
6541
|
+
boundingBox: external_exports.object({
|
|
6542
|
+
x: external_exports.number(),
|
|
6543
|
+
y: external_exports.number(),
|
|
6544
|
+
width: external_exports.number(),
|
|
6545
|
+
height: external_exports.number()
|
|
6575
6546
|
}),
|
|
6576
|
-
size:
|
|
6577
|
-
eyesOpenScore:
|
|
6578
|
-
smileScore:
|
|
6579
|
-
facingCameraScore:
|
|
6547
|
+
size: external_exports.number(),
|
|
6548
|
+
eyesOpenScore: external_exports.number(),
|
|
6549
|
+
smileScore: external_exports.number(),
|
|
6550
|
+
facingCameraScore: external_exports.number()
|
|
6580
6551
|
});
|
|
6581
|
-
var StoryboardItemImageServerSchema =
|
|
6582
|
-
id:
|
|
6583
|
-
url:
|
|
6584
|
-
category:
|
|
6585
|
-
aesthetic_score:
|
|
6586
|
-
faces:
|
|
6587
|
-
roi:
|
|
6588
|
-
x:
|
|
6589
|
-
y:
|
|
6590
|
-
width:
|
|
6591
|
-
height:
|
|
6552
|
+
var StoryboardItemImageServerSchema = external_exports.object({
|
|
6553
|
+
id: external_exports.string(),
|
|
6554
|
+
url: external_exports.string(),
|
|
6555
|
+
category: external_exports.string(),
|
|
6556
|
+
aesthetic_score: external_exports.number(),
|
|
6557
|
+
faces: external_exports.array(StoryboardItemImageFaceServerSchema),
|
|
6558
|
+
roi: external_exports.object({
|
|
6559
|
+
x: external_exports.number(),
|
|
6560
|
+
y: external_exports.number(),
|
|
6561
|
+
width: external_exports.number(),
|
|
6562
|
+
height: external_exports.number()
|
|
6592
6563
|
}),
|
|
6593
|
-
taken_at:
|
|
6594
|
-
width:
|
|
6595
|
-
height:
|
|
6564
|
+
taken_at: external_exports.number(),
|
|
6565
|
+
width: external_exports.number(),
|
|
6566
|
+
height: external_exports.number()
|
|
6596
6567
|
});
|
|
6597
|
-
var StoryboardItemImageSchema =
|
|
6598
|
-
id:
|
|
6599
|
-
url:
|
|
6600
|
-
category:
|
|
6601
|
-
aestheticScore:
|
|
6602
|
-
faces:
|
|
6603
|
-
roi:
|
|
6604
|
-
x:
|
|
6605
|
-
y:
|
|
6606
|
-
width:
|
|
6607
|
-
height:
|
|
6568
|
+
var StoryboardItemImageSchema = external_exports.object({
|
|
6569
|
+
id: external_exports.string(),
|
|
6570
|
+
url: external_exports.string(),
|
|
6571
|
+
category: external_exports.string(),
|
|
6572
|
+
aestheticScore: external_exports.number(),
|
|
6573
|
+
faces: external_exports.array(StoryboardItemImageFaceSchema),
|
|
6574
|
+
roi: external_exports.object({
|
|
6575
|
+
x: external_exports.number(),
|
|
6576
|
+
y: external_exports.number(),
|
|
6577
|
+
width: external_exports.number(),
|
|
6578
|
+
height: external_exports.number()
|
|
6608
6579
|
}),
|
|
6609
|
-
takenAt:
|
|
6610
|
-
width:
|
|
6611
|
-
height:
|
|
6580
|
+
takenAt: external_exports.number(),
|
|
6581
|
+
width: external_exports.number(),
|
|
6582
|
+
height: external_exports.number()
|
|
6612
6583
|
});
|
|
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:
|
|
6584
|
+
var StoryboardItemServerSchema = external_exports.object({
|
|
6585
|
+
id: external_exports.string(),
|
|
6586
|
+
sequence: external_exports.number(),
|
|
6587
|
+
book_id: external_exports.string(),
|
|
6588
|
+
similarity: external_exports.number(),
|
|
6589
|
+
duplicate: external_exports.boolean(),
|
|
6590
|
+
selected: external_exports.boolean(),
|
|
6591
|
+
surface_weight: external_exports.number(),
|
|
6592
|
+
front_cover: external_exports.boolean().optional(),
|
|
6593
|
+
back_cover: external_exports.boolean().optional(),
|
|
6594
|
+
scene: external_exports.number(),
|
|
6595
|
+
subscene: external_exports.number(),
|
|
6596
|
+
spine_break: external_exports.boolean().optional(),
|
|
6626
6597
|
image: StoryboardItemImageServerSchema
|
|
6627
6598
|
});
|
|
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:
|
|
6599
|
+
var StoryboardItemSchema = external_exports.object({
|
|
6600
|
+
id: external_exports.string(),
|
|
6601
|
+
sequence: external_exports.number(),
|
|
6602
|
+
bookId: external_exports.string(),
|
|
6603
|
+
similarity: external_exports.number(),
|
|
6604
|
+
duplicate: external_exports.boolean(),
|
|
6605
|
+
selected: external_exports.boolean(),
|
|
6606
|
+
surfaceWeight: external_exports.number(),
|
|
6607
|
+
frontCover: external_exports.boolean().optional(),
|
|
6608
|
+
backCover: external_exports.boolean().optional(),
|
|
6609
|
+
scene: external_exports.number(),
|
|
6610
|
+
subscene: external_exports.number(),
|
|
6611
|
+
spineBreak: external_exports.boolean().optional(),
|
|
6641
6612
|
image: StoryboardItemImageSchema
|
|
6642
6613
|
});
|
|
6643
6614
|
var StoryboardItemsEndpoints = class {
|
|
@@ -6651,7 +6622,7 @@ var MagicLabs = (() => {
|
|
|
6651
6622
|
const res = await this.engineAPI.fetcher.call({
|
|
6652
6623
|
path: `/v1/storyboarditems/book/${bookId}`
|
|
6653
6624
|
});
|
|
6654
|
-
return
|
|
6625
|
+
return external_exports.array(StoryboardItemServerSchema).parse(res);
|
|
6655
6626
|
});
|
|
6656
6627
|
}
|
|
6657
6628
|
};
|