@magiclabs.ai/magicbook-client 0.6.6 → 0.6.8

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
@@ -4162,8 +4162,8 @@ var designOptionsServerSchema = z.object({
4162
4162
  });
4163
4163
 
4164
4164
  // ../../core/config.ts
4165
- var defaultApiHost = "https://api.dev-sls.magicbook.io";
4166
- var defaultWebSocketHost = "wss://socket.dev-sls.magicbook.io";
4165
+ var defaultApiHost = "https://api.sfly-sls.magicbook.io";
4166
+ var defaultWebSocketHost = "wss://socket.sfly-sls.magicbook.io";
4167
4167
  var designRequestTimeout = parseInt("30000"?.toString() || "3000");
4168
4168
 
4169
4169
  // ../../core/models/design-request/index.ts
@@ -4240,13 +4240,15 @@ var DesignRequest = class {
4240
4240
  }
4241
4241
  }
4242
4242
  async setGuid(guid) {
4243
- this.guid = guid;
4244
- if (isDesignRequestSubmitted(this.state)) {
4243
+ if (!isDesignRequestSubmitted(this.state)) {
4244
+ throw new Error("Design request not submitted");
4245
+ } else {
4246
+ this.guid = guid;
4245
4247
  this.updateDesignRequest(
4246
4248
  (await this.client.engineAPI.books.update(this.parentId, this.toBook())).toDesignRequestProps()
4247
4249
  );
4250
+ return this.guid;
4248
4251
  }
4249
- return this.guid;
4250
4252
  }
4251
4253
  async cancel() {
4252
4254
  if (this.state === "cancelled") {
@@ -4286,7 +4288,7 @@ var DesignRequest = class {
4286
4288
  this.state = detail.slug;
4287
4289
  }
4288
4290
  timeoutHandler() {
4289
- return setTimeout(async () => {
4291
+ return setTimeout(() => {
4290
4292
  this.eventHandler(timeoutMessage);
4291
4293
  }, designRequestTimeout);
4292
4294
  }