@fileverse-dev/ddoc 3.0.11 → 3.0.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.
@@ -1,4 +1,4 @@
1
- import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-jQSXpa4H.mjs";
1
+ import { B as p, g as m, s as w, d as k, i as b, l as L, a as O, c as E, b as x, e as R, H as y, f as M } from "./index-B9JRAWhX.mjs";
2
2
  class S extends p {
3
3
  constructor({ callbackSelector: r, cause: a, data: n, extraData: i, sender: f, urls: t }) {
4
4
  var o;
@@ -93960,7 +93960,7 @@ async function vF(e, t) {
93960
93960
  });
93961
93961
  return ne === "0x" ? { data: void 0 } : { data: ne };
93962
93962
  } catch (R) {
93963
- const I = fKt(R), { offchainLookup: H, offchainLookupSignature: $ } = await import("./ccip-BSmAwD79.mjs");
93963
+ const I = fKt(R), { offchainLookup: H, offchainLookupSignature: $ } = await import("./ccip-utBQ0sDm.mjs");
93964
93964
  if (e.ccipRead !== !1 && (I == null ? void 0 : I.slice(0, 10)) === $ && x)
93965
93965
  return { data: await H(e, { data: I, to: x }) };
93966
93966
  throw B && (I == null ? void 0 : I.slice(0, 10)) === "0x101bb98d" ? new WGt({ factory: f }) : cge(R, {
@@ -259480,7 +259480,8 @@ class oOn {
259480
259480
  data: a,
259481
259481
  roomKey: this.roomKey
259482
259482
  }), a.statusCode !== 200) {
259483
- (u = this._onHandShakeError) == null || u.call(this, a.error);
259483
+ const d = a.err, f = new Error(d);
259484
+ f.name = "SocketHandshakeError", (u = this._onHandShakeError) == null || u.call(this, f);
259484
259485
  return;
259485
259486
  }
259486
259487
  if (!a.is_handshake_response) {
@@ -259537,7 +259538,8 @@ class oOn {
259537
259538
  async _sendNetworkRequest(t, n) {
259538
259539
  var r;
259539
259540
  if (this._webSocketStatus !== Io.CONNECTED || !this._webSocket) {
259540
- (r = this._onError) == null || r.call(this, "Lost connection to websocket server");
259541
+ const o = new Error("Lost connection to websocket server");
259542
+ o.name = "SocketConnectionLostError", (r = this._onError) == null || r.call(this, o);
259541
259543
  return;
259542
259544
  }
259543
259545
  return new Promise((o) => {
@@ -259687,7 +259689,10 @@ class oOn {
259687
259689
  this._webSocketStatus = Io.CLOSED, (r = this._onDisconnection) == null || r.call(this, n);
259688
259690
  }, this._webSocket.onerror = (n) => {
259689
259691
  var r;
259690
- console.error("SocketAPI: socket error", n), this._webSocketStatus = Io.CLOSED, this._webSocket && this._webSocket.retryCount === Yoe.maxRetries && ((r = this._onError) == null || r.call(this, "Failed to connect to Socket"));
259692
+ if (console.error("SocketAPI: socket error", n), this._webSocketStatus = Io.CLOSED, this._webSocket && this._webSocket.retryCount === Yoe.maxRetries) {
259693
+ const o = new Error("Failed to connect to Socket");
259694
+ o.name = "SocketConnectionFailedError", (r = this._onError) == null || r.call(this, o);
259695
+ }
259691
259696
  };
259692
259697
  });
259693
259698
  }
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-jQSXpa4H.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-B9JRAWhX.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -48,7 +48,7 @@ export interface SyncMachineContext {
48
48
  updated: number[];
49
49
  removed: number[];
50
50
  }) => void) | null;
51
- onError: ((e: string) => void) | null;
51
+ onError: ((e: Error) => void) | null;
52
52
  roomKey: string;
53
53
  wsUrl: string;
54
54
  uncommittedUpdatesIdList: string[];
@@ -121,9 +121,9 @@ export type Update = Uint8Array;
121
121
  export interface ISocketInitConfig {
122
122
  onConnect: ConnectHandler;
123
123
  onDisconnect: DisconnectHandler;
124
- onError: (err: string) => void;
124
+ onError: (err: Error) => void;
125
125
  onWsEvent: EventHandler;
126
- onHandShakeError: (err: string) => void;
126
+ onHandShakeError: (err: Error) => void;
127
127
  roomId: string;
128
128
  }
129
129
  export declare enum SocketStatusEnum {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.11",
5
+ "version": "3.0.12",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {