@magiclabs.ai/magicbook-client 0.7.17-canary → 0.7.19-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 CHANGED
@@ -1642,7 +1642,7 @@ function getStyleIdBySlug(slug) {
1642
1642
  return id;
1643
1643
  }
1644
1644
  }
1645
- return void 0;
1645
+ return slug;
1646
1646
  }
1647
1647
 
1648
1648
  // ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
@@ -5667,7 +5667,7 @@ var Images = class {
5667
5667
  designRequestState;
5668
5668
  async add(image) {
5669
5669
  if (!canSubmitDesignRequest(this.designRequestState)) {
5670
- throw new Error("You need to wait for the current design request to be ready before adding new images.");
5670
+ throw new Error("You need to wait for the current design request to be completed before adding new images.");
5671
5671
  } else {
5672
5672
  const serverImage = await this.client.engineAPI.images.addToBook(this.parentId, new ImageServer(image));
5673
5673
  const img = imageServerToImage(serverImage);
@@ -5680,7 +5680,7 @@ var Images = class {
5680
5680
  }
5681
5681
  async delete(imageId) {
5682
5682
  if (!canSubmitDesignRequest(this.designRequestState)) {
5683
- throw new Error("You need to wait for the current design request to be ready before deleting images.");
5683
+ throw new Error("You need to wait for the current design request to be completed before deleting images.");
5684
5684
  } else {
5685
5685
  await this.client.engineAPI.images.delete(imageId, this.parentId);
5686
5686
  this.list.splice(this.list.findIndex((image) => image.handle === imageId), 1);
@@ -5948,7 +5948,7 @@ var DesignRequest = class {
5948
5948
  };
5949
5949
  delete designRequest.client;
5950
5950
  delete designRequest.webSocket;
5951
- const styleSlug = styles[this.style].slug;
5951
+ const styleSlug = styles[this.style]?.slug || this.style;
5952
5952
  const bookDesignRequest = camelCaseObjectKeysToSnakeCase(cleanJSON(designRequest));
5953
5953
  bookDesignRequest.style = styleSlug;
5954
5954
  return new Book({