@magiclabs.ai/magicbook-client 0.7.27 → 0.7.29-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 +30 -12
- package/index.cjs.map +1 -1
- package/index.d.cts +3 -0
- package/index.d.ts +3 -0
- package/index.iife.js +29 -11
- package/index.iife.min.js +1 -1
- package/index.js +30 -12
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -292,6 +292,7 @@ var styles = {
|
|
|
292
292
|
6165: { slug: "disneys-simply-mickey-sfly" },
|
|
293
293
|
6166: { slug: "disney-mickey-and-friends-sfly" },
|
|
294
294
|
6169: { slug: "through-the-years-sfly" },
|
|
295
|
+
6172: { slug: "modern-editorial-moments-sfly" },
|
|
295
296
|
//snapfish styles
|
|
296
297
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
297
298
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -1670,7 +1671,7 @@ function getStyleIdBySlug(slug) {
|
|
|
1670
1671
|
return slug;
|
|
1671
1672
|
}
|
|
1672
1673
|
|
|
1673
|
-
// ../../node_modules/.pnpm/zod@3.24.
|
|
1674
|
+
// ../../node_modules/.pnpm/zod@3.24.4/node_modules/zod/lib/index.mjs
|
|
1674
1675
|
var util;
|
|
1675
1676
|
(function(util2) {
|
|
1676
1677
|
util2.assertEqual = (val) => val;
|
|
@@ -2519,13 +2520,14 @@ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_
|
|
|
2519
2520
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
2520
2521
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2521
2522
|
function timeRegexSource(args) {
|
|
2522
|
-
let
|
|
2523
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
2523
2524
|
if (args.precision) {
|
|
2524
|
-
|
|
2525
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
2525
2526
|
} else if (args.precision == null) {
|
|
2526
|
-
|
|
2527
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
2527
2528
|
}
|
|
2528
|
-
|
|
2529
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
2530
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
2529
2531
|
}
|
|
2530
2532
|
function timeRegex(args) {
|
|
2531
2533
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -5497,16 +5499,32 @@ ZodReadonly.create = (type, params) => {
|
|
|
5497
5499
|
...processCreateParams(params)
|
|
5498
5500
|
});
|
|
5499
5501
|
};
|
|
5500
|
-
function
|
|
5502
|
+
function cleanParams(params, data) {
|
|
5503
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
5504
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
5505
|
+
return p2;
|
|
5506
|
+
}
|
|
5507
|
+
function custom(check, _params = {}, fatal) {
|
|
5501
5508
|
if (check)
|
|
5502
5509
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5503
5510
|
var _a, _b;
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5511
|
+
const r = check(data);
|
|
5512
|
+
if (r instanceof Promise) {
|
|
5513
|
+
return r.then((r2) => {
|
|
5514
|
+
var _a2, _b2;
|
|
5515
|
+
if (!r2) {
|
|
5516
|
+
const params = cleanParams(_params, data);
|
|
5517
|
+
const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
5518
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5519
|
+
}
|
|
5520
|
+
});
|
|
5521
|
+
}
|
|
5522
|
+
if (!r) {
|
|
5523
|
+
const params = cleanParams(_params, data);
|
|
5524
|
+
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
5525
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5509
5526
|
}
|
|
5527
|
+
return;
|
|
5510
5528
|
});
|
|
5511
5529
|
return ZodAny.create();
|
|
5512
5530
|
}
|
|
@@ -5953,7 +5971,7 @@ var DesignRequest = class {
|
|
|
5953
5971
|
this.title = designRequestProps?.title || "";
|
|
5954
5972
|
this.subtitle = designRequestProps?.subtitle;
|
|
5955
5973
|
this.occasion = designRequestProps?.occasion || occasions[0];
|
|
5956
|
-
this.style = designRequestProps?.style || parseInt(Object.keys(styles)[0]);
|
|
5974
|
+
this.style = designRequestProps?.style || (designRequestProps?.sku ? "eed1dc1510934cd3aa6ac9395d9c2d20" : parseInt(Object.keys(styles)[0]));
|
|
5957
5975
|
this.sku = designRequestProps?.sku;
|
|
5958
5976
|
this.bookSize = designRequestProps?.bookSize || bookSizes[0];
|
|
5959
5977
|
this.coverType = designRequestProps?.coverType || coverTypes[0];
|