@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.d.cts
CHANGED
package/index.d.ts
CHANGED
package/index.iife.js
CHANGED
|
@@ -290,6 +290,7 @@ var MagicLabs = (() => {
|
|
|
290
290
|
6165: { slug: "disneys-simply-mickey-sfly" },
|
|
291
291
|
6166: { slug: "disney-mickey-and-friends-sfly" },
|
|
292
292
|
6169: { slug: "through-the-years-sfly" },
|
|
293
|
+
6172: { slug: "modern-editorial-moments-sfly" },
|
|
293
294
|
//snapfish styles
|
|
294
295
|
be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
|
|
295
296
|
"519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
|
|
@@ -2513,13 +2514,14 @@ var MagicLabs = (() => {
|
|
|
2513
2514
|
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])))`;
|
|
2514
2515
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2515
2516
|
function timeRegexSource(args) {
|
|
2516
|
-
let
|
|
2517
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
2517
2518
|
if (args.precision) {
|
|
2518
|
-
|
|
2519
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
2519
2520
|
} else if (args.precision == null) {
|
|
2520
|
-
|
|
2521
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
2521
2522
|
}
|
|
2522
|
-
|
|
2523
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
2524
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
2523
2525
|
}
|
|
2524
2526
|
function timeRegex(args) {
|
|
2525
2527
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -5491,16 +5493,32 @@ var MagicLabs = (() => {
|
|
|
5491
5493
|
...processCreateParams(params)
|
|
5492
5494
|
});
|
|
5493
5495
|
};
|
|
5494
|
-
function
|
|
5496
|
+
function cleanParams(params, data) {
|
|
5497
|
+
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
5498
|
+
const p2 = typeof p === "string" ? { message: p } : p;
|
|
5499
|
+
return p2;
|
|
5500
|
+
}
|
|
5501
|
+
function custom(check, _params = {}, fatal) {
|
|
5495
5502
|
if (check)
|
|
5496
5503
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
5497
5504
|
var _a, _b;
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5505
|
+
const r = check(data);
|
|
5506
|
+
if (r instanceof Promise) {
|
|
5507
|
+
return r.then((r2) => {
|
|
5508
|
+
var _a2, _b2;
|
|
5509
|
+
if (!r2) {
|
|
5510
|
+
const params = cleanParams(_params, data);
|
|
5511
|
+
const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
|
|
5512
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5513
|
+
}
|
|
5514
|
+
});
|
|
5515
|
+
}
|
|
5516
|
+
if (!r) {
|
|
5517
|
+
const params = cleanParams(_params, data);
|
|
5518
|
+
const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
5519
|
+
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
5503
5520
|
}
|
|
5521
|
+
return;
|
|
5504
5522
|
});
|
|
5505
5523
|
return ZodAny.create();
|
|
5506
5524
|
}
|
|
@@ -5939,7 +5957,7 @@ var MagicLabs = (() => {
|
|
|
5939
5957
|
this.title = designRequestProps?.title || "";
|
|
5940
5958
|
this.subtitle = designRequestProps?.subtitle;
|
|
5941
5959
|
this.occasion = designRequestProps?.occasion || occasions[0];
|
|
5942
|
-
this.style = designRequestProps?.style || parseInt(Object.keys(styles)[0]);
|
|
5960
|
+
this.style = designRequestProps?.style || (designRequestProps?.sku ? "eed1dc1510934cd3aa6ac9395d9c2d20" : parseInt(Object.keys(styles)[0]));
|
|
5943
5961
|
this.sku = designRequestProps?.sku;
|
|
5944
5962
|
this.bookSize = designRequestProps?.bookSize || bookSizes[0];
|
|
5945
5963
|
this.coverType = designRequestProps?.coverType || coverTypes[0];
|