@magiclabs.ai/magicbook-client 0.6.10 → 0.6.12
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 +59 -7
- package/index.cjs.map +1 -1
- package/index.d.cts +1618 -1
- package/index.d.ts +1618 -1
- package/index.js +32 -6
- package/index.js.map +1 -1
- package/package.json +9 -9
package/index.cjs
CHANGED
|
@@ -25,13 +25,39 @@ __export(src_exports, {
|
|
|
25
25
|
ImageServer: () => ImageServer,
|
|
26
26
|
Images: () => Images,
|
|
27
27
|
MagicBookClient: () => MagicBookClient,
|
|
28
|
+
assetSchema: () => assetSchema,
|
|
29
|
+
bookCreationRequestSchema: () => bookCreationRequestSchema,
|
|
30
|
+
bookSizes: () => bookSizes,
|
|
31
|
+
cancelledMessage: () => cancelledMessage,
|
|
32
|
+
canvasSchema: () => canvasSchema,
|
|
33
|
+
coverTypes: () => coverTypes,
|
|
28
34
|
designOptionsSchema: () => designOptionsSchema,
|
|
29
35
|
designOptionsServerSchema: () => designOptionsServerSchema,
|
|
36
|
+
embellishmentLevels: () => embellishmentLevels,
|
|
37
|
+
imageAssignmentSchema: () => imageAssignmentSchema,
|
|
38
|
+
imageDensities: () => imageDensities,
|
|
30
39
|
imageDensityOptionSchema: () => imageDensityOptionSchema,
|
|
31
40
|
imageDensityOptionServerSchema: () => imageDensityOptionServerSchema,
|
|
32
41
|
imageDensityOptionsSchema: () => imageDensityOptionsSchema,
|
|
33
42
|
imageDensityOptionsServerSchema: () => imageDensityOptionsServerSchema,
|
|
34
|
-
|
|
43
|
+
imageFilteringLevels: () => imageFilteringLevels,
|
|
44
|
+
imageServerSchema: () => imageServerSchema,
|
|
45
|
+
isDesignRequestSubmitted: () => isDesignRequestSubmitted,
|
|
46
|
+
magicShopBookSchema: () => magicShopBookSchema,
|
|
47
|
+
occasions: () => occasions,
|
|
48
|
+
pageSchema: () => pageSchema,
|
|
49
|
+
pageTypes: () => pageTypes,
|
|
50
|
+
photoMetadataSchema: () => photoMetadataSchema,
|
|
51
|
+
photoStripSchema: () => photoStripSchema,
|
|
52
|
+
positionSchema: () => positionSchema,
|
|
53
|
+
propertySchema: () => propertySchema,
|
|
54
|
+
reportingDataSchema: () => reportingDataSchema,
|
|
55
|
+
states: () => states,
|
|
56
|
+
statesToCloseWS: () => statesToCloseWS,
|
|
57
|
+
statesToReport: () => statesToReport,
|
|
58
|
+
styles: () => styles,
|
|
59
|
+
textStickerLevels: () => textStickerLevels,
|
|
60
|
+
timeoutMessage: () => timeoutMessage
|
|
35
61
|
});
|
|
36
62
|
module.exports = __toCommonJS(src_exports);
|
|
37
63
|
|
|
@@ -4167,8 +4193,8 @@ var designOptionsServerSchema = z.object({
|
|
|
4167
4193
|
});
|
|
4168
4194
|
|
|
4169
4195
|
// ../../core/config.ts
|
|
4170
|
-
var defaultApiHost = "https://api.
|
|
4171
|
-
var defaultWebSocketHost = "wss://socket.
|
|
4196
|
+
var defaultApiHost = "https://api.dev-sls.magicbook.io";
|
|
4197
|
+
var defaultWebSocketHost = "wss://socket.dev-sls.magicbook.io";
|
|
4172
4198
|
var designRequestTimeout = parseInt("30000"?.toString() || "3000");
|
|
4173
4199
|
|
|
4174
4200
|
// ../../core/models/design-request/index.ts
|
|
@@ -4280,7 +4306,6 @@ var DesignRequest = class {
|
|
|
4280
4306
|
}
|
|
4281
4307
|
async eventHandler(detail, type = "MagicBook.designRequestUpdated") {
|
|
4282
4308
|
const customEvent = new CustomEvent(type, { detail });
|
|
4283
|
-
window.dispatchEvent(customEvent);
|
|
4284
4309
|
if (statesToCloseWS.includes(detail.slug)) {
|
|
4285
4310
|
this.webSocket.close();
|
|
4286
4311
|
if (statesToReport.includes(detail.slug)) {
|
|
@@ -4291,6 +4316,7 @@ var DesignRequest = class {
|
|
|
4291
4316
|
}
|
|
4292
4317
|
}
|
|
4293
4318
|
this.state = detail.slug;
|
|
4319
|
+
window.dispatchEvent(customEvent);
|
|
4294
4320
|
}
|
|
4295
4321
|
timeoutHandler() {
|
|
4296
4322
|
return setTimeout(async () => {
|
|
@@ -4299,12 +4325,12 @@ var DesignRequest = class {
|
|
|
4299
4325
|
}
|
|
4300
4326
|
async getProgress() {
|
|
4301
4327
|
let timeout;
|
|
4302
|
-
this.webSocket.onmessage = (event) => {
|
|
4328
|
+
this.webSocket.onmessage = async (event) => {
|
|
4303
4329
|
const detail = JSON.parse(event.data);
|
|
4304
4330
|
if (this.state !== detail.slug) {
|
|
4305
4331
|
timeout && clearTimeout(timeout);
|
|
4306
4332
|
timeout = this.timeoutHandler();
|
|
4307
|
-
this.eventHandler(detail);
|
|
4333
|
+
await this.eventHandler(detail);
|
|
4308
4334
|
}
|
|
4309
4335
|
};
|
|
4310
4336
|
this.webSocket.onclose = () => clearTimeout(timeout);
|
|
@@ -4849,12 +4875,38 @@ var MagicBookClient = class {
|
|
|
4849
4875
|
ImageServer,
|
|
4850
4876
|
Images,
|
|
4851
4877
|
MagicBookClient,
|
|
4878
|
+
assetSchema,
|
|
4879
|
+
bookCreationRequestSchema,
|
|
4880
|
+
bookSizes,
|
|
4881
|
+
cancelledMessage,
|
|
4882
|
+
canvasSchema,
|
|
4883
|
+
coverTypes,
|
|
4852
4884
|
designOptionsSchema,
|
|
4853
4885
|
designOptionsServerSchema,
|
|
4886
|
+
embellishmentLevels,
|
|
4887
|
+
imageAssignmentSchema,
|
|
4888
|
+
imageDensities,
|
|
4854
4889
|
imageDensityOptionSchema,
|
|
4855
4890
|
imageDensityOptionServerSchema,
|
|
4856
4891
|
imageDensityOptionsSchema,
|
|
4857
4892
|
imageDensityOptionsServerSchema,
|
|
4858
|
-
|
|
4893
|
+
imageFilteringLevels,
|
|
4894
|
+
imageServerSchema,
|
|
4895
|
+
isDesignRequestSubmitted,
|
|
4896
|
+
magicShopBookSchema,
|
|
4897
|
+
occasions,
|
|
4898
|
+
pageSchema,
|
|
4899
|
+
pageTypes,
|
|
4900
|
+
photoMetadataSchema,
|
|
4901
|
+
photoStripSchema,
|
|
4902
|
+
positionSchema,
|
|
4903
|
+
propertySchema,
|
|
4904
|
+
reportingDataSchema,
|
|
4905
|
+
states,
|
|
4906
|
+
statesToCloseWS,
|
|
4907
|
+
statesToReport,
|
|
4908
|
+
styles,
|
|
4909
|
+
textStickerLevels,
|
|
4910
|
+
timeoutMessage
|
|
4859
4911
|
});
|
|
4860
4912
|
//# sourceMappingURL=index.cjs.map
|