@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 +4 -4
- package/index.cjs.map +1 -1
- package/index.iife.js +4 -4
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.iife.js
CHANGED
|
@@ -1638,7 +1638,7 @@ var MagicLabs = (() => {
|
|
|
1638
1638
|
return id;
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
|
-
return
|
|
1641
|
+
return slug;
|
|
1642
1642
|
}
|
|
1643
1643
|
var util;
|
|
1644
1644
|
(function(util2) {
|
|
@@ -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
|
|
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
|
|
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].
|
|
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
|
@@ -1570,7 +1570,7 @@ function getStyleIdBySlug(slug) {
|
|
|
1570
1570
|
return id;
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
1573
|
-
return
|
|
1573
|
+
return slug;
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
1576
|
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
@@ -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
|
|
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
|
|
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].
|
|
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({
|