@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.js CHANGED
@@ -218,6 +218,7 @@ var styles = {
218
218
  6165: { slug: "disneys-simply-mickey-sfly" },
219
219
  6166: { slug: "disney-mickey-and-friends-sfly" },
220
220
  6169: { slug: "through-the-years-sfly" },
221
+ 6172: { slug: "modern-editorial-moments-sfly" },
221
222
  //snapfish styles
222
223
  be5f79d7525f4717844db77a2f1b5e50: { slug: "abstract-baby-first-year-snap" },
223
224
  "519bf5f2b6734103a9a359469be4961b": { slug: "album-snap" },
@@ -1596,7 +1597,7 @@ function getStyleIdBySlug(slug) {
1596
1597
  return slug;
1597
1598
  }
1598
1599
 
1599
- // ../../node_modules/.pnpm/zod@3.24.1/node_modules/zod/lib/index.mjs
1600
+ // ../../node_modules/.pnpm/zod@3.24.4/node_modules/zod/lib/index.mjs
1600
1601
  var util;
1601
1602
  (function(util2) {
1602
1603
  util2.assertEqual = (val) => val;
@@ -2445,13 +2446,14 @@ var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_
2445
2446
  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])))`;
2446
2447
  var dateRegex = new RegExp(`^${dateRegexSource}$`);
2447
2448
  function timeRegexSource(args) {
2448
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
2449
+ let secondsRegexSource = `[0-5]\\d`;
2449
2450
  if (args.precision) {
2450
- regex = `${regex}\\.\\d{${args.precision}}`;
2451
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
2451
2452
  } else if (args.precision == null) {
2452
- regex = `${regex}(\\.\\d+)?`;
2453
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
2453
2454
  }
2454
- return regex;
2455
+ const secondsQuantifier = args.precision ? "+" : "?";
2456
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
2455
2457
  }
2456
2458
  function timeRegex(args) {
2457
2459
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -5423,16 +5425,32 @@ ZodReadonly.create = (type, params) => {
5423
5425
  ...processCreateParams(params)
5424
5426
  });
5425
5427
  };
5426
- function custom(check, params = {}, fatal) {
5428
+ function cleanParams(params, data) {
5429
+ const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
5430
+ const p2 = typeof p === "string" ? { message: p } : p;
5431
+ return p2;
5432
+ }
5433
+ function custom(check, _params = {}, fatal) {
5427
5434
  if (check)
5428
5435
  return ZodAny.create().superRefine((data, ctx) => {
5429
5436
  var _a, _b;
5430
- if (!check(data)) {
5431
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
5432
- const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
5433
- const p2 = typeof p === "string" ? { message: p } : p;
5434
- ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
5437
+ const r = check(data);
5438
+ if (r instanceof Promise) {
5439
+ return r.then((r2) => {
5440
+ var _a2, _b2;
5441
+ if (!r2) {
5442
+ const params = cleanParams(_params, data);
5443
+ const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
5444
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
5445
+ }
5446
+ });
5447
+ }
5448
+ if (!r) {
5449
+ const params = cleanParams(_params, data);
5450
+ const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
5451
+ ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
5435
5452
  }
5453
+ return;
5436
5454
  });
5437
5455
  return ZodAny.create();
5438
5456
  }
@@ -5879,7 +5897,7 @@ var DesignRequest = class {
5879
5897
  this.title = designRequestProps?.title || "";
5880
5898
  this.subtitle = designRequestProps?.subtitle;
5881
5899
  this.occasion = designRequestProps?.occasion || occasions[0];
5882
- this.style = designRequestProps?.style || parseInt(Object.keys(styles)[0]);
5900
+ this.style = designRequestProps?.style || (designRequestProps?.sku ? "eed1dc1510934cd3aa6ac9395d9c2d20" : parseInt(Object.keys(styles)[0]));
5883
5901
  this.sku = designRequestProps?.sku;
5884
5902
  this.bookSize = designRequestProps?.bookSize || bookSizes[0];
5885
5903
  this.coverType = designRequestProps?.coverType || coverTypes[0];