@magiclabs.ai/magicbook-client 0.7.17-canary → 0.7.18-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.iife.js CHANGED
@@ -5657,7 +5657,7 @@ var MagicLabs = (() => {
5657
5657
  designRequestState;
5658
5658
  async add(image) {
5659
5659
  if (!canSubmitDesignRequest(this.designRequestState)) {
5660
- throw new Error("You need to wait for the current design request to be ready before adding new images.");
5660
+ throw new Error("You need to wait for the current design request to be completed before adding new images.");
5661
5661
  } else {
5662
5662
  const serverImage = await this.client.engineAPI.images.addToBook(this.parentId, new ImageServer(image));
5663
5663
  const img = imageServerToImage(serverImage);
@@ -5670,7 +5670,7 @@ var MagicLabs = (() => {
5670
5670
  }
5671
5671
  async delete(imageId) {
5672
5672
  if (!canSubmitDesignRequest(this.designRequestState)) {
5673
- throw new Error("You need to wait for the current design request to be ready before deleting images.");
5673
+ throw new Error("You need to wait for the current design request to be completed before deleting images.");
5674
5674
  } else {
5675
5675
  await this.client.engineAPI.images.delete(imageId, this.parentId);
5676
5676
  this.list.splice(this.list.findIndex((image) => image.handle === imageId), 1);
@@ -5934,7 +5934,7 @@ var MagicLabs = (() => {
5934
5934
  };
5935
5935
  delete designRequest.client;
5936
5936
  delete designRequest.webSocket;
5937
- const styleSlug = styles[this.style].slug;
5937
+ const styleSlug = styles[this.style]?.slug || this.style;
5938
5938
  const bookDesignRequest = camelCaseObjectKeysToSnakeCase(cleanJSON(designRequest));
5939
5939
  bookDesignRequest.style = styleSlug;
5940
5940
  return new Book({
package/index.js CHANGED
@@ -5595,7 +5595,7 @@ var Images = class {
5595
5595
  designRequestState;
5596
5596
  async add(image) {
5597
5597
  if (!canSubmitDesignRequest(this.designRequestState)) {
5598
- throw new Error("You need to wait for the current design request to be ready before adding new images.");
5598
+ throw new Error("You need to wait for the current design request to be completed before adding new images.");
5599
5599
  } else {
5600
5600
  const serverImage = await this.client.engineAPI.images.addToBook(this.parentId, new ImageServer(image));
5601
5601
  const img = imageServerToImage(serverImage);
@@ -5608,7 +5608,7 @@ var Images = class {
5608
5608
  }
5609
5609
  async delete(imageId) {
5610
5610
  if (!canSubmitDesignRequest(this.designRequestState)) {
5611
- throw new Error("You need to wait for the current design request to be ready before deleting images.");
5611
+ throw new Error("You need to wait for the current design request to be completed before deleting images.");
5612
5612
  } else {
5613
5613
  await this.client.engineAPI.images.delete(imageId, this.parentId);
5614
5614
  this.list.splice(this.list.findIndex((image) => image.handle === imageId), 1);
@@ -5876,7 +5876,7 @@ var DesignRequest = class {
5876
5876
  };
5877
5877
  delete designRequest.client;
5878
5878
  delete designRequest.webSocket;
5879
- const styleSlug = styles[this.style].slug;
5879
+ const styleSlug = styles[this.style]?.slug || this.style;
5880
5880
  const bookDesignRequest = camelCaseObjectKeysToSnakeCase(cleanJSON(designRequest));
5881
5881
  bookDesignRequest.style = styleSlug;
5882
5882
  return new Book({