@magiclabs.ai/magicbook-client 0.7.9-canary → 0.7.10-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
@@ -317,16 +317,7 @@ var styles = {
317
317
  "03f332e3b2b947ebae73b67a9a22b6f4": { slug: "winter-sparkle-snap" },
318
318
  "97f70f6cdb5244a08d45772cccfa2788": { slug: "year-of-memories-snap" }
319
319
  };
320
- var bookSizes = [
321
- "5x7",
322
- "6x6",
323
- "8x8",
324
- "10x10",
325
- "12x12",
326
- "8x11",
327
- "11x8",
328
- "11x14"
329
- ];
320
+ var bookSizes = ["5x7", "6x6", "8x8", "10x10", "12x12", "8x11", "11x8", "11x14"];
330
321
  var coverTypes = ["sc", "hc", "pl"];
331
322
  var pageTypes = ["sp", "sl", "dl"];
332
323
  var imageDensities = ["low", "medium", "high"];
@@ -346,6 +337,7 @@ var cancelledEventDetail = {
346
337
  message: "Design canceled"
347
338
  };
348
339
  var formats = ["galleon", "snapfish"];
340
+ var surfaceCategoryNames = ["inside", "cover"];
349
341
 
350
342
  // ../../core/utils/toolbox.ts
351
343
  function mergeNestedObject(obj, objToMerge) {
@@ -4602,9 +4594,9 @@ var DesignRequest = class {
4602
4594
  );
4603
4595
  return options;
4604
4596
  }
4605
- async getAlternateLayouts(pageNumber) {
4597
+ async getAlternateLayouts(pageNumber, surfaceCategoryName) {
4606
4598
  if (this.state === "ready") {
4607
- return await this.client.engineAPI.spreads.layouts(this.parentId, pageNumber);
4599
+ return await this.client.engineAPI.spreads.layouts(this.parentId, pageNumber, surfaceCategoryName);
4608
4600
  } else {
4609
4601
  throw new Error("Design request not ready");
4610
4602
  }
@@ -5052,14 +5044,19 @@ var photoStripSchema = z.object({
5052
5044
  var reportingDataSchema = z.object({
5053
5045
  properties: z.array(propertySchema)
5054
5046
  });
5055
- var canvasSchema = z.object({
5047
+ var sflyCanvasSchema = z.object({
5056
5048
  backgroundId: z.string().nullable(),
5057
5049
  assets: z.array(assetSchema).optional()
5058
5050
  });
5051
+ var snapCanvasSchema = z.object({
5052
+ surfaceNumber: z.number(),
5053
+ surfaceData: z.record(z.any()),
5054
+ version: z.string()
5055
+ });
5059
5056
  var pageSchema = z.object({
5060
5057
  pageNum: z.number(),
5061
5058
  type: z.string(),
5062
- canvas: canvasSchema
5059
+ canvas: sflyCanvasSchema
5063
5060
  });
5064
5061
  var magicShopBookSchema = z.object({
5065
5062
  pages: z.array(pageSchema),
@@ -5132,7 +5129,7 @@ var SpreadsEndpoints = class {
5132
5129
  });
5133
5130
  });
5134
5131
  }
5135
- layouts(bookId, page) {
5132
+ layouts(bookId, page, surfaceCategoryName) {
5136
5133
  return handleAsyncFunction(async () => {
5137
5134
  const res = await this.engineAPI.fetcher.call({
5138
5135
  path: "/v1/spreads/layouts",
@@ -5140,11 +5137,12 @@ var SpreadsEndpoints = class {
5140
5137
  method: "POST",
5141
5138
  body: cleanJSON({
5142
5139
  user_id: bookId,
5143
- page_num: page
5140
+ page_num: page,
5141
+ surfaceCategoryName
5144
5142
  })
5145
5143
  }
5146
5144
  });
5147
- return z.array(canvasSchema).parse(res);
5145
+ return z.array(surfaceCategoryName ? snapCanvasSchema : sflyCanvasSchema).parse(res);
5148
5146
  });
5149
5147
  }
5150
5148
  };
@@ -5316,7 +5314,6 @@ export {
5316
5314
  bookSizes,
5317
5315
  canSubmitDesignRequest,
5318
5316
  cancelledEventDetail,
5319
- canvasSchema,
5320
5317
  coverTypes,
5321
5318
  designOptionsSchema,
5322
5319
  designOptionsServerSchema,
@@ -5341,10 +5338,13 @@ export {
5341
5338
  positionSchema,
5342
5339
  propertySchema,
5343
5340
  reportingDataSchema,
5341
+ sflyCanvasSchema,
5342
+ snapCanvasSchema,
5344
5343
  states,
5345
5344
  statesToCloseWS,
5346
5345
  statesToReport,
5347
5346
  styles,
5347
+ surfaceCategoryNames,
5348
5348
  textStickerLevels,
5349
5349
  timeoutEventDetail
5350
5350
  };