@contello/sdk-client 8.14.0-next.1751836134 → 8.14.0

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/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- function P(e) {
1
+ function k(e) {
2
2
  return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
3
3
  }
4
- function R(e) {
5
- return P(e) === "object";
4
+ function I(e) {
5
+ return k(e) === "object";
6
6
  }
7
- function be(e) {
7
+ function he(e) {
8
8
  return Array.isArray(e) && // must be at least one error
9
9
  e.length > 0 && // error has at least a message
10
10
  e.every((t) => "message" in t);
@@ -12,18 +12,18 @@ function be(e) {
12
12
  function re(e, t) {
13
13
  return e.length < 124 ? e : t;
14
14
  }
15
- const me = "graphql-transport-ws";
16
- var _ = /* @__PURE__ */ ((e) => (e[e.InternalServerError = 4500] = "InternalServerError", e[e.InternalClientError = 4005] = "InternalClientError", e[e.BadRequest = 4400] = "BadRequest", e[e.BadResponse = 4004] = "BadResponse", e[e.Unauthorized = 4401] = "Unauthorized", e[e.Forbidden = 4403] = "Forbidden", e[e.SubprotocolNotAcceptable = 4406] = "SubprotocolNotAcceptable", e[e.ConnectionInitialisationTimeout = 4408] = "ConnectionInitialisationTimeout", e[e.ConnectionAcknowledgementTimeout = 4504] = "ConnectionAcknowledgementTimeout", e[e.SubscriberAlreadyExists = 4409] = "SubscriberAlreadyExists", e[e.TooManyInitialisationRequests = 4429] = "TooManyInitialisationRequests", e))(_ || {}), O = /* @__PURE__ */ ((e) => (e.ConnectionInit = "connection_init", e.ConnectionAck = "connection_ack", e.Ping = "ping", e.Pong = "pong", e.Subscribe = "subscribe", e.Next = "next", e.Error = "error", e.Complete = "complete", e))(O || {});
15
+ const be = "graphql-transport-ws";
16
+ var v = /* @__PURE__ */ ((e) => (e[e.InternalServerError = 4500] = "InternalServerError", e[e.InternalClientError = 4005] = "InternalClientError", e[e.BadRequest = 4400] = "BadRequest", e[e.BadResponse = 4004] = "BadResponse", e[e.Unauthorized = 4401] = "Unauthorized", e[e.Forbidden = 4403] = "Forbidden", e[e.SubprotocolNotAcceptable = 4406] = "SubprotocolNotAcceptable", e[e.ConnectionInitialisationTimeout = 4408] = "ConnectionInitialisationTimeout", e[e.ConnectionAcknowledgementTimeout = 4504] = "ConnectionAcknowledgementTimeout", e[e.SubscriberAlreadyExists = 4409] = "SubscriberAlreadyExists", e[e.TooManyInitialisationRequests = 4429] = "TooManyInitialisationRequests", e))(v || {}), _ = /* @__PURE__ */ ((e) => (e.ConnectionInit = "connection_init", e.ConnectionAck = "connection_ack", e.Ping = "ping", e.Pong = "pong", e.Subscribe = "subscribe", e.Next = "next", e.Error = "error", e.Complete = "complete", e))(_ || {});
17
17
  function ue(e) {
18
- if (!R(e))
18
+ if (!I(e))
19
19
  throw new Error(
20
- `Message is expected to be an object, but got ${P(e)}`
20
+ `Message is expected to be an object, but got ${k(e)}`
21
21
  );
22
22
  if (!e.type)
23
23
  throw new Error("Message is missing the 'type' property");
24
24
  if (typeof e.type != "string")
25
25
  throw new Error(
26
- `Message is expects the 'type' property to be a string, but got ${P(
26
+ `Message is expects the 'type' property to be a string, but got ${k(
27
27
  e.type
28
28
  )}`
29
29
  );
@@ -32,7 +32,7 @@ function ue(e) {
32
32
  case "connection_ack":
33
33
  case "ping":
34
34
  case "pong": {
35
- if (e.payload != null && !R(e.payload))
35
+ if (e.payload != null && !I(e.payload))
36
36
  throw new Error(
37
37
  `"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`
38
38
  );
@@ -41,7 +41,7 @@ function ue(e) {
41
41
  case "subscribe": {
42
42
  if (typeof e.id != "string")
43
43
  throw new Error(
44
- `"${e.type}" message expects the 'id' property to be a string, but got ${P(
44
+ `"${e.type}" message expects the 'id' property to be a string, but got ${k(
45
45
  e.id
46
46
  )}`
47
47
  );
@@ -49,33 +49,33 @@ function ue(e) {
49
49
  throw new Error(
50
50
  `"${e.type}" message requires a non-empty 'id' property`
51
51
  );
52
- if (!R(e.payload))
52
+ if (!I(e.payload))
53
53
  throw new Error(
54
- `"${e.type}" message expects the 'payload' property to be an object, but got ${P(
54
+ `"${e.type}" message expects the 'payload' property to be an object, but got ${k(
55
55
  e.payload
56
56
  )}`
57
57
  );
58
58
  if (typeof e.payload.query != "string")
59
59
  throw new Error(
60
- `"${e.type}" message payload expects the 'query' property to be a string, but got ${P(
60
+ `"${e.type}" message payload expects the 'query' property to be a string, but got ${k(
61
61
  e.payload.query
62
62
  )}`
63
63
  );
64
- if (e.payload.variables != null && !R(e.payload.variables))
64
+ if (e.payload.variables != null && !I(e.payload.variables))
65
65
  throw new Error(
66
- `"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${P(
66
+ `"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${k(
67
67
  e.payload.variables
68
68
  )}`
69
69
  );
70
- if (e.payload.operationName != null && P(e.payload.operationName) !== "string")
70
+ if (e.payload.operationName != null && k(e.payload.operationName) !== "string")
71
71
  throw new Error(
72
- `"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${P(
72
+ `"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${k(
73
73
  e.payload.operationName
74
74
  )}`
75
75
  );
76
- if (e.payload.extensions != null && !R(e.payload.extensions))
76
+ if (e.payload.extensions != null && !I(e.payload.extensions))
77
77
  throw new Error(
78
- `"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${P(
78
+ `"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${k(
79
79
  e.payload.extensions
80
80
  )}`
81
81
  );
@@ -84,7 +84,7 @@ function ue(e) {
84
84
  case "next": {
85
85
  if (typeof e.id != "string")
86
86
  throw new Error(
87
- `"${e.type}" message expects the 'id' property to be a string, but got ${P(
87
+ `"${e.type}" message expects the 'id' property to be a string, but got ${k(
88
88
  e.id
89
89
  )}`
90
90
  );
@@ -92,9 +92,9 @@ function ue(e) {
92
92
  throw new Error(
93
93
  `"${e.type}" message requires a non-empty 'id' property`
94
94
  );
95
- if (!R(e.payload))
95
+ if (!I(e.payload))
96
96
  throw new Error(
97
- `"${e.type}" message expects the 'payload' property to be an object, but got ${P(
97
+ `"${e.type}" message expects the 'payload' property to be an object, but got ${k(
98
98
  e.payload
99
99
  )}`
100
100
  );
@@ -103,7 +103,7 @@ function ue(e) {
103
103
  case "error": {
104
104
  if (typeof e.id != "string")
105
105
  throw new Error(
106
- `"${e.type}" message expects the 'id' property to be a string, but got ${P(
106
+ `"${e.type}" message expects the 'id' property to be a string, but got ${k(
107
107
  e.id
108
108
  )}`
109
109
  );
@@ -111,7 +111,7 @@ function ue(e) {
111
111
  throw new Error(
112
112
  `"${e.type}" message requires a non-empty 'id' property`
113
113
  );
114
- if (!be(e.payload))
114
+ if (!he(e.payload))
115
115
  throw new Error(
116
116
  `"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(
117
117
  e.payload
@@ -122,7 +122,7 @@ function ue(e) {
122
122
  case "complete": {
123
123
  if (typeof e.id != "string")
124
124
  throw new Error(
125
- `"${e.type}" message expects the 'id' property to be a string, but got ${P(
125
+ `"${e.type}" message expects the 'id' property to be a string, but got ${k(
126
126
  e.id
127
127
  )}`
128
128
  );
@@ -137,38 +137,38 @@ function ue(e) {
137
137
  }
138
138
  return e;
139
139
  }
140
- function ge(e, t) {
140
+ function me(e, t) {
141
141
  return ue(
142
142
  typeof e == "string" ? JSON.parse(e, t) : e
143
143
  );
144
144
  }
145
- function F(e, t) {
145
+ function z(e, t) {
146
146
  return ue(e), JSON.stringify(e, t);
147
147
  }
148
- function we(e) {
148
+ function ge(e) {
149
149
  const {
150
150
  url: t,
151
151
  connectionParams: r,
152
152
  lazy: n = !0,
153
- onNonLazyError: s = console.error,
153
+ onNonLazyError: c = console.error,
154
154
  lazyCloseTimeout: i = 0,
155
155
  keepAlive: o = 0,
156
156
  disablePong: h,
157
- connectionAckWaitTimeout: b = 0,
158
- retryAttempts: A = 5,
159
- retryWait: w = async function(f) {
160
- const c = Math.pow(2, f);
157
+ connectionAckWaitTimeout: y = 0,
158
+ retryAttempts: P = 5,
159
+ retryWait: m = async function(f) {
160
+ const s = Math.pow(2, f);
161
161
  await new Promise(
162
162
  (u) => setTimeout(
163
163
  u,
164
- c * 1e3 + // add random timeout from 300ms to 3s
164
+ s * 1e3 + // add random timeout from 300ms to 3s
165
165
  Math.floor(Math.random() * 2700 + 300)
166
166
  )
167
167
  );
168
168
  },
169
- shouldRetry: E = G,
169
+ shouldRetry: g = C,
170
170
  on: l,
171
- webSocketImpl: d,
171
+ webSocketImpl: T,
172
172
  /**
173
173
  * Generates a v4 UUID to be used as the ID using `Math`
174
174
  * as the random number generator. Supply your own generator
@@ -176,20 +176,20 @@ function we(e) {
176
176
  *
177
177
  * Reference: https://gist.github.com/jed/982883
178
178
  */
179
- generateID: v = function() {
179
+ generateID: L = function() {
180
180
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (f) => {
181
- const c = Math.random() * 16 | 0;
182
- return (f == "x" ? c : c & 3 | 8).toString(16);
181
+ const s = Math.random() * 16 | 0;
182
+ return (f == "x" ? s : s & 3 | 8).toString(16);
183
183
  });
184
184
  },
185
- jsonMessageReplacer: m,
186
- jsonMessageReviver: ye
185
+ jsonMessageReplacer: S,
186
+ jsonMessageReviver: de
187
187
  } = e;
188
188
  let N;
189
- if (d) {
190
- if (!xe(d))
189
+ if (T) {
190
+ if (!xe(T))
191
191
  throw new Error("Invalid WebSocket implementation provided");
192
- N = d;
192
+ N = T;
193
193
  } else typeof WebSocket < "u" ? N = WebSocket : typeof global < "u" ? N = global.WebSocket || // @ts-expect-error: Support more browsers
194
194
  global.MozWebSocket : typeof window < "u" && (N = window.WebSocket || // @ts-expect-error: Support more browsers
195
195
  window.MozWebSocket);
@@ -197,17 +197,17 @@ function we(e) {
197
197
  throw new Error(
198
198
  "WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`"
199
199
  );
200
- const q = N, x = (() => {
200
+ const R = N, w = (() => {
201
201
  const a = /* @__PURE__ */ (() => {
202
- const c = {};
202
+ const s = {};
203
203
  return {
204
- on(u, y) {
205
- return c[u] = y, () => {
206
- delete c[u];
204
+ on(u, d) {
205
+ return s[u] = d, () => {
206
+ delete s[u];
207
207
  };
208
208
  },
209
209
  emit(u) {
210
- "id" in u && c[u.id]?.(u);
210
+ "id" in u && s[u.id]?.(u);
211
211
  }
212
212
  };
213
213
  })(), f = {
@@ -222,117 +222,117 @@ function we(e) {
222
222
  };
223
223
  return {
224
224
  onMessage: a.on,
225
- on(c, u) {
226
- const y = f[c];
227
- return y.push(u), () => {
228
- y.splice(y.indexOf(u), 1);
225
+ on(s, u) {
226
+ const d = f[s];
227
+ return d.push(u), () => {
228
+ d.splice(d.indexOf(u), 1);
229
229
  };
230
230
  },
231
- emit(c, ...u) {
232
- for (const y of [...f[c]])
233
- y(...u);
231
+ emit(s, ...u) {
232
+ for (const d of [...f[s]])
233
+ d(...u);
234
234
  }
235
235
  };
236
236
  })();
237
- function H(a) {
237
+ function V(a) {
238
238
  const f = [
239
239
  // errors are fatal and more critical than close events, throw them first
240
- x.on("error", (c) => {
241
- f.forEach((u) => u()), a(c);
240
+ w.on("error", (s) => {
241
+ f.forEach((u) => u()), a(s);
242
242
  }),
243
243
  // closes can be graceful and not fatal, throw them second (if error didnt throw)
244
- x.on("closed", (c) => {
245
- f.forEach((u) => u()), a(c);
244
+ w.on("closed", (s) => {
245
+ f.forEach((u) => u()), a(s);
246
246
  })
247
247
  ];
248
248
  }
249
- let $, I = 0, K, W = !1, B = 0, X = !1;
249
+ let O, $ = 0, K, M = !1, F = 0, X = !1;
250
250
  async function Z() {
251
251
  clearTimeout(K);
252
- const [a, f] = await ($ ?? ($ = new Promise(
253
- (y, k) => (async () => {
254
- if (W) {
255
- if (await w(B), !I)
256
- return $ = void 0, k({ code: 1e3, reason: "All Subscriptions Gone" });
257
- B++;
252
+ const [a, f] = await (O ?? (O = new Promise(
253
+ (d, E) => (async () => {
254
+ if (M) {
255
+ if (await m(F), !$)
256
+ return O = void 0, E({ code: 1e3, reason: "All Subscriptions Gone" });
257
+ F++;
258
258
  }
259
- x.emit("connecting", W);
260
- const p = new q(
259
+ w.emit("connecting", M);
260
+ const p = new R(
261
261
  typeof t == "function" ? await t() : t,
262
- me
262
+ be
263
263
  );
264
- let M, z;
265
- function U() {
266
- isFinite(o) && o > 0 && (clearTimeout(z), z = setTimeout(() => {
267
- p.readyState === q.OPEN && (p.send(F({ type: O.Ping })), x.emit("ping", !1, void 0));
264
+ let q, W;
265
+ function B() {
266
+ isFinite(o) && o > 0 && (clearTimeout(W), W = setTimeout(() => {
267
+ p.readyState === R.OPEN && (p.send(z({ type: _.Ping })), w.emit("ping", !1, void 0));
268
268
  }, o));
269
269
  }
270
- H((S) => {
271
- $ = void 0, clearTimeout(M), clearTimeout(z), k(S), S instanceof ne && (p.close(4499, "Terminated"), p.onerror = null, p.onclose = null);
272
- }), p.onerror = (S) => x.emit("error", S), p.onclose = (S) => x.emit("closed", S), p.onopen = async () => {
270
+ V((x) => {
271
+ O = void 0, clearTimeout(q), clearTimeout(W), E(x), x instanceof ne && (p.close(4499, "Terminated"), p.onerror = null, p.onclose = null);
272
+ }), p.onerror = (x) => w.emit("error", x), p.onclose = (x) => w.emit("closed", x), p.onopen = async () => {
273
273
  try {
274
- x.emit("opened", p);
275
- const S = typeof r == "function" ? await r() : r;
276
- if (p.readyState !== q.OPEN) return;
274
+ w.emit("opened", p);
275
+ const x = typeof r == "function" ? await r() : r;
276
+ if (p.readyState !== R.OPEN) return;
277
277
  p.send(
278
- F(
279
- S ? {
280
- type: O.ConnectionInit,
281
- payload: S
278
+ z(
279
+ x ? {
280
+ type: _.ConnectionInit,
281
+ payload: x
282
282
  } : {
283
- type: O.ConnectionInit
283
+ type: _.ConnectionInit
284
284
  // payload is completely absent if not provided
285
285
  },
286
- m
286
+ S
287
287
  )
288
- ), isFinite(b) && b > 0 && (M = setTimeout(() => {
288
+ ), isFinite(y) && y > 0 && (q = setTimeout(() => {
289
289
  p.close(
290
- _.ConnectionAcknowledgementTimeout,
290
+ v.ConnectionAcknowledgementTimeout,
291
291
  "Connection acknowledgement timeout"
292
292
  );
293
- }, b)), U();
294
- } catch (S) {
295
- x.emit("error", S), p.close(
296
- _.InternalClientError,
293
+ }, y)), B();
294
+ } catch (x) {
295
+ w.emit("error", x), p.close(
296
+ v.InternalClientError,
297
297
  re(
298
- S instanceof Error ? S.message : String(S),
298
+ x instanceof Error ? x.message : String(x),
299
299
  "Internal client error"
300
300
  )
301
301
  );
302
302
  }
303
303
  };
304
304
  let j = !1;
305
- p.onmessage = ({ data: S }) => {
305
+ p.onmessage = ({ data: x }) => {
306
306
  try {
307
- const g = ge(S, ye);
308
- if (x.emit("message", g), g.type === "ping" || g.type === "pong") {
309
- x.emit(g.type, !0, g.payload), g.type === "pong" ? U() : h || (p.send(
310
- F(
311
- g.payload ? {
312
- type: O.Pong,
313
- payload: g.payload
307
+ const b = me(x, de);
308
+ if (w.emit("message", b), b.type === "ping" || b.type === "pong") {
309
+ w.emit(b.type, !0, b.payload), b.type === "pong" ? B() : h || (p.send(
310
+ z(
311
+ b.payload ? {
312
+ type: _.Pong,
313
+ payload: b.payload
314
314
  } : {
315
- type: O.Pong
315
+ type: _.Pong
316
316
  // payload is completely absent if not provided
317
317
  }
318
318
  )
319
- ), x.emit("pong", !1, g.payload));
319
+ ), w.emit("pong", !1, b.payload));
320
320
  return;
321
321
  }
322
322
  if (j) return;
323
- if (g.type !== O.ConnectionAck)
323
+ if (b.type !== _.ConnectionAck)
324
324
  throw new Error(
325
- `First message cannot be of type ${g.type}`
325
+ `First message cannot be of type ${b.type}`
326
326
  );
327
- clearTimeout(M), j = !0, x.emit("connected", p, g.payload, W), W = !1, B = 0, y([
327
+ clearTimeout(q), j = !0, w.emit("connected", p, b.payload, M), M = !1, F = 0, d([
328
328
  p,
329
- new Promise((Fe, he) => H(he))
329
+ new Promise((We, ye) => V(ye))
330
330
  ]);
331
- } catch (g) {
332
- p.onmessage = null, x.emit("error", g), p.close(
333
- _.BadResponse,
331
+ } catch (b) {
332
+ p.onmessage = null, w.emit("error", b), p.close(
333
+ v.BadResponse,
334
334
  re(
335
- g instanceof Error ? g.message : String(g),
335
+ b instanceof Error ? b.message : String(b),
336
336
  "Bad response"
337
337
  )
338
338
  );
@@ -340,21 +340,21 @@ function we(e) {
340
340
  };
341
341
  })()
342
342
  )));
343
- a.readyState === q.CLOSING && await f;
344
- let c = () => {
343
+ a.readyState === R.CLOSING && await f;
344
+ let s = () => {
345
345
  };
346
- const u = new Promise((y) => c = y);
346
+ const u = new Promise((d) => s = d);
347
347
  return [
348
348
  a,
349
- c,
349
+ s,
350
350
  Promise.race([
351
351
  // wait for
352
352
  u.then(() => {
353
- if (!I) {
354
- const y = () => a.close(1e3, "Normal Closure");
353
+ if (!$) {
354
+ const d = () => a.close(1e3, "Normal Closure");
355
355
  isFinite(i) && i > 0 ? K = setTimeout(() => {
356
- a.readyState === q.OPEN && y();
357
- }, i) : y();
356
+ a.readyState === R.OPEN && d();
357
+ }, i) : d();
358
358
  }
359
359
  }),
360
360
  // or
@@ -363,29 +363,29 @@ function we(e) {
363
363
  ];
364
364
  }
365
365
  function ee(a) {
366
- if (G(a) && (Ee(a.code) || [
367
- _.InternalServerError,
368
- _.InternalClientError,
369
- _.BadRequest,
370
- _.BadResponse,
371
- _.Unauthorized,
366
+ if (C(a) && (we(a.code) || [
367
+ v.InternalServerError,
368
+ v.InternalClientError,
369
+ v.BadRequest,
370
+ v.BadResponse,
371
+ v.Unauthorized,
372
372
  // CloseCode.Forbidden, might grant access out after retry
373
- _.SubprotocolNotAcceptable,
373
+ v.SubprotocolNotAcceptable,
374
374
  // CloseCode.ConnectionInitialisationTimeout, might not time out after retry
375
375
  // CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry
376
- _.SubscriberAlreadyExists,
377
- _.TooManyInitialisationRequests
376
+ v.SubscriberAlreadyExists,
377
+ v.TooManyInitialisationRequests
378
378
  // 4499, // Terminated, probably because the socket froze, we want to retry
379
379
  ].includes(a.code)))
380
380
  throw a;
381
381
  if (X) return !1;
382
- if (G(a) && a.code === 1e3)
383
- return I > 0;
384
- if (!A || B >= A || !E(a)) throw a;
385
- return W = !0;
382
+ if (C(a) && a.code === 1e3)
383
+ return $ > 0;
384
+ if (!P || F >= P || !g(a)) throw a;
385
+ return M = !0;
386
386
  }
387
387
  n || (async () => {
388
- for (I++; ; )
388
+ for ($++; ; )
389
389
  try {
390
390
  const [, , a] = await Z();
391
391
  await a;
@@ -393,107 +393,107 @@ function we(e) {
393
393
  try {
394
394
  if (!ee(a)) return;
395
395
  } catch (f) {
396
- return s?.(f);
396
+ return c?.(f);
397
397
  }
398
398
  }
399
399
  })();
400
400
  function te(a, f) {
401
- const c = v(a);
402
- let u = !1, y = !1, k = () => {
403
- I--, u = !0;
401
+ const s = L(a);
402
+ let u = !1, d = !1, E = () => {
403
+ $--, u = !0;
404
404
  };
405
405
  return (async () => {
406
- for (I++; ; )
406
+ for ($++; ; )
407
407
  try {
408
- const [p, M, z] = await Z();
409
- if (u) return M();
410
- const U = x.onMessage(c, (j) => {
408
+ const [p, q, W] = await Z();
409
+ if (u) return q();
410
+ const B = w.onMessage(s, (j) => {
411
411
  switch (j.type) {
412
- case O.Next: {
412
+ case _.Next: {
413
413
  f.next(j.payload);
414
414
  return;
415
415
  }
416
- case O.Error: {
417
- y = !0, u = !0, f.error(j.payload), k();
416
+ case _.Error: {
417
+ d = !0, u = !0, f.error(j.payload), E();
418
418
  return;
419
419
  }
420
- case O.Complete: {
421
- u = !0, k();
420
+ case _.Complete: {
421
+ u = !0, E();
422
422
  return;
423
423
  }
424
424
  }
425
425
  });
426
426
  p.send(
427
- F(
427
+ z(
428
428
  {
429
- id: c,
430
- type: O.Subscribe,
429
+ id: s,
430
+ type: _.Subscribe,
431
431
  payload: a
432
432
  },
433
- m
433
+ S
434
434
  )
435
- ), k = () => {
436
- !u && p.readyState === q.OPEN && p.send(
437
- F(
435
+ ), E = () => {
436
+ !u && p.readyState === R.OPEN && p.send(
437
+ z(
438
438
  {
439
- id: c,
440
- type: O.Complete
439
+ id: s,
440
+ type: _.Complete
441
441
  },
442
- m
442
+ S
443
443
  )
444
- ), I--, u = !0, M();
445
- }, await z.finally(U);
444
+ ), $--, u = !0, q();
445
+ }, await W.finally(B);
446
446
  return;
447
447
  } catch (p) {
448
448
  if (!ee(p)) return;
449
449
  }
450
450
  })().then(() => {
451
- y || f.complete();
451
+ d || f.complete();
452
452
  }).catch((p) => {
453
453
  f.error(p);
454
454
  }), () => {
455
- u || k();
455
+ u || E();
456
456
  };
457
457
  }
458
458
  return {
459
- on: x.on,
459
+ on: w.on,
460
460
  subscribe: te,
461
461
  iterate(a) {
462
- const f = [], c = {
462
+ const f = [], s = {
463
463
  done: !1,
464
464
  error: null,
465
465
  resolve: () => {
466
466
  }
467
467
  }, u = te(a, {
468
- next(k) {
469
- f.push(k), c.resolve();
468
+ next(E) {
469
+ f.push(E), s.resolve();
470
470
  },
471
- error(k) {
472
- c.done = !0, c.error = k, c.resolve();
471
+ error(E) {
472
+ s.done = !0, s.error = E, s.resolve();
473
473
  },
474
474
  complete() {
475
- c.done = !0, c.resolve();
475
+ s.done = !0, s.resolve();
476
476
  }
477
- }), y = async function* () {
477
+ }), d = async function* () {
478
478
  for (; ; ) {
479
- for (f.length || await new Promise((p) => c.resolve = p); f.length; )
479
+ for (f.length || await new Promise((p) => s.resolve = p); f.length; )
480
480
  yield f.shift();
481
- if (c.error)
482
- throw c.error;
483
- if (c.done)
481
+ if (s.error)
482
+ throw s.error;
483
+ if (s.done)
484
484
  return;
485
485
  }
486
486
  }();
487
- return y.throw = async (k) => (c.done || (c.done = !0, c.error = k, c.resolve()), { done: !0, value: void 0 }), y.return = async () => (u(), { done: !0, value: void 0 }), y;
487
+ return d.throw = async (E) => (s.done || (s.done = !0, s.error = E, s.resolve()), { done: !0, value: void 0 }), d.return = async () => (u(), { done: !0, value: void 0 }), d;
488
488
  },
489
489
  async dispose() {
490
- if (X = !0, $) {
491
- const [a] = await $;
490
+ if (X = !0, O) {
491
+ const [a] = await O;
492
492
  a.close(1e3, "Normal Closure");
493
493
  }
494
494
  },
495
495
  terminate() {
496
- $ && x.emit("closed", new ne());
496
+ O && w.emit("closed", new ne());
497
497
  }
498
498
  };
499
499
  }
@@ -504,10 +504,10 @@ class ne extends Error {
504
504
  reason = "Terminated";
505
505
  wasClean = !1;
506
506
  }
507
- function G(e) {
508
- return R(e) && "code" in e && "reason" in e;
507
+ function C(e) {
508
+ return I(e) && "code" in e && "reason" in e;
509
509
  }
510
- function Ee(e) {
510
+ function we(e) {
511
511
  return [
512
512
  1e3,
513
513
  // Normal Closure is not an erroneous close code
@@ -528,17 +528,39 @@ function Ee(e) {
528
528
  function xe(e) {
529
529
  return typeof e == "function" && "constructor" in e && "CLOSED" in e && "CLOSING" in e && "CONNECTING" in e && "OPEN" in e;
530
530
  }
531
- var J = function(e, t) {
532
- return J = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
531
+ class Se {
532
+ constructor(t, r) {
533
+ this.createClient = t, this.poolSize = r;
534
+ }
535
+ clients = [];
536
+ currentIndex = 0;
537
+ connect() {
538
+ for (let t = 0; t < this.poolSize; t++)
539
+ this.clients.push(this.createClient(`${t + 1}`));
540
+ }
541
+ get() {
542
+ if (this.clients.length === 0)
543
+ throw new Error("Connection pool is empty. Please call connect() first.");
544
+ const t = this.clients[this.currentIndex];
545
+ if (this.currentIndex = (this.currentIndex + 1) % this.poolSize, !t)
546
+ throw new Error("No available WebSocket client");
547
+ return t;
548
+ }
549
+ disconnect() {
550
+ this.clients.forEach((t) => t.dispose()), this.clients = [];
551
+ }
552
+ }
553
+ var D = function(e, t) {
554
+ return D = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
533
555
  r.__proto__ = n;
534
556
  } || function(r, n) {
535
- for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
536
- }, J(e, t);
557
+ for (var c in n) Object.prototype.hasOwnProperty.call(n, c) && (r[c] = n[c]);
558
+ }, D(e, t);
537
559
  };
538
560
  function pe(e, t) {
539
561
  if (typeof t != "function" && t !== null)
540
562
  throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
541
- J(e, t);
563
+ D(e, t);
542
564
  function r() {
543
565
  this.constructor = e;
544
566
  }
@@ -554,42 +576,42 @@ function oe(e) {
554
576
  };
555
577
  throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
556
578
  }
557
- function Q(e, t) {
579
+ function J(e, t) {
558
580
  var r = typeof Symbol == "function" && e[Symbol.iterator];
559
581
  if (!r) return e;
560
- var n = r.call(e), s, i = [], o;
582
+ var n = r.call(e), c, i = [], o;
561
583
  try {
562
- for (; (t === void 0 || t-- > 0) && !(s = n.next()).done; ) i.push(s.value);
584
+ for (; (t === void 0 || t-- > 0) && !(c = n.next()).done; ) i.push(c.value);
563
585
  } catch (h) {
564
586
  o = { error: h };
565
587
  } finally {
566
588
  try {
567
- s && !s.done && (r = n.return) && r.call(n);
589
+ c && !c.done && (r = n.return) && r.call(n);
568
590
  } finally {
569
591
  if (o) throw o.error;
570
592
  }
571
593
  }
572
594
  return i;
573
595
  }
574
- function V(e, t, r) {
575
- if (r || arguments.length === 2) for (var n = 0, s = t.length, i; n < s; n++)
596
+ function Q(e, t, r) {
597
+ if (r || arguments.length === 2) for (var n = 0, c = t.length, i; n < c; n++)
576
598
  (i || !(n in t)) && (i || (i = Array.prototype.slice.call(t, 0, n)), i[n] = t[n]);
577
599
  return e.concat(i || Array.prototype.slice.call(t));
578
600
  }
579
- function T(e) {
601
+ function A(e) {
580
602
  return typeof e == "function";
581
603
  }
582
- function le(e) {
604
+ function Ee(e) {
583
605
  var t = function(n) {
584
606
  Error.call(n), n.stack = new Error().stack;
585
607
  }, r = e(t);
586
608
  return r.prototype = Object.create(Error.prototype), r.prototype.constructor = r, r;
587
609
  }
588
- var D = le(function(e) {
610
+ var G = Ee(function(e) {
589
611
  return function(r) {
590
612
  e(this), this.message = r ? r.length + ` errors occurred during unsubscription:
591
- ` + r.map(function(n, s) {
592
- return s + 1 + ") " + n.toString();
613
+ ` + r.map(function(n, c) {
614
+ return c + 1 + ") " + n.toString();
593
615
  }).join(`
594
616
  `) : "", this.name = "UnsubscriptionError", this.errors = r;
595
617
  };
@@ -600,64 +622,64 @@ function ie(e, t) {
600
622
  0 <= r && e.splice(r, 1);
601
623
  }
602
624
  }
603
- var Y = function() {
625
+ var H = function() {
604
626
  function e(t) {
605
627
  this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
606
628
  }
607
629
  return e.prototype.unsubscribe = function() {
608
- var t, r, n, s, i;
630
+ var t, r, n, c, i;
609
631
  if (!this.closed) {
610
632
  this.closed = !0;
611
633
  var o = this._parentage;
612
634
  if (o)
613
635
  if (this._parentage = null, Array.isArray(o))
614
636
  try {
615
- for (var h = oe(o), b = h.next(); !b.done; b = h.next()) {
616
- var A = b.value;
617
- A.remove(this);
637
+ for (var h = oe(o), y = h.next(); !y.done; y = h.next()) {
638
+ var P = y.value;
639
+ P.remove(this);
618
640
  }
619
- } catch (m) {
620
- t = { error: m };
641
+ } catch (S) {
642
+ t = { error: S };
621
643
  } finally {
622
644
  try {
623
- b && !b.done && (r = h.return) && r.call(h);
645
+ y && !y.done && (r = h.return) && r.call(h);
624
646
  } finally {
625
647
  if (t) throw t.error;
626
648
  }
627
649
  }
628
650
  else
629
651
  o.remove(this);
630
- var w = this.initialTeardown;
631
- if (T(w))
652
+ var m = this.initialTeardown;
653
+ if (A(m))
632
654
  try {
633
- w();
634
- } catch (m) {
635
- i = m instanceof D ? m.errors : [m];
655
+ m();
656
+ } catch (S) {
657
+ i = S instanceof G ? S.errors : [S];
636
658
  }
637
- var E = this._finalizers;
638
- if (E) {
659
+ var g = this._finalizers;
660
+ if (g) {
639
661
  this._finalizers = null;
640
662
  try {
641
- for (var l = oe(E), d = l.next(); !d.done; d = l.next()) {
642
- var v = d.value;
663
+ for (var l = oe(g), T = l.next(); !T.done; T = l.next()) {
664
+ var L = T.value;
643
665
  try {
644
- se(v);
645
- } catch (m) {
646
- i = i ?? [], m instanceof D ? i = V(V([], Q(i)), Q(m.errors)) : i.push(m);
666
+ se(L);
667
+ } catch (S) {
668
+ i = i ?? [], S instanceof G ? i = Q(Q([], J(i)), J(S.errors)) : i.push(S);
647
669
  }
648
670
  }
649
- } catch (m) {
650
- n = { error: m };
671
+ } catch (S) {
672
+ n = { error: S };
651
673
  } finally {
652
674
  try {
653
- d && !d.done && (s = l.return) && s.call(l);
675
+ T && !T.done && (c = l.return) && c.call(l);
654
676
  } finally {
655
677
  if (n) throw n.error;
656
678
  }
657
679
  }
658
680
  }
659
681
  if (i)
660
- throw new D(i);
682
+ throw new G(i);
661
683
  }
662
684
  }, e.prototype.add = function(t) {
663
685
  var r;
@@ -689,44 +711,44 @@ var Y = function() {
689
711
  return t.closed = !0, t;
690
712
  }(), e;
691
713
  }();
692
- Y.EMPTY;
693
- function fe(e) {
694
- return e instanceof Y || e && "closed" in e && T(e.remove) && T(e.add) && T(e.unsubscribe);
714
+ H.EMPTY;
715
+ function le(e) {
716
+ return e instanceof H || e && "closed" in e && A(e.remove) && A(e.add) && A(e.unsubscribe);
695
717
  }
696
718
  function se(e) {
697
- T(e) ? e() : e.unsubscribe();
719
+ A(e) ? e() : e.unsubscribe();
698
720
  }
699
- var Se = {
721
+ var ke = {
700
722
  Promise: void 0
701
- }, ke = {
723
+ }, Pe = {
702
724
  setTimeout: function(e, t) {
703
725
  for (var r = [], n = 2; n < arguments.length; n++)
704
726
  r[n - 2] = arguments[n];
705
- return setTimeout.apply(void 0, V([e, t], Q(r)));
727
+ return setTimeout.apply(void 0, Q([e, t], J(r)));
706
728
  },
707
729
  clearTimeout: function(e) {
708
730
  return clearTimeout(e);
709
731
  },
710
732
  delegate: void 0
711
733
  };
712
- function Pe(e) {
713
- ke.setTimeout(function() {
734
+ function ve(e) {
735
+ Pe.setTimeout(function() {
714
736
  throw e;
715
737
  });
716
738
  }
717
739
  function ce() {
718
740
  }
719
- function ve(e) {
741
+ function _e(e) {
720
742
  e();
721
743
  }
722
- var de = function(e) {
744
+ var fe = function(e) {
723
745
  pe(t, e);
724
746
  function t(r) {
725
747
  var n = e.call(this) || this;
726
- return n.isStopped = !1, r ? (n.destination = r, fe(r) && r.add(n)) : n.destination = Te, n;
748
+ return n.isStopped = !1, r ? (n.destination = r, le(r) && r.add(n)) : n.destination = Oe, n;
727
749
  }
728
- return t.create = function(r, n, s) {
729
- return new C(r, n, s);
750
+ return t.create = function(r, n, c) {
751
+ return new Y(r, n, c);
730
752
  }, t.prototype.next = function(r) {
731
753
  this.isStopped || this._next(r);
732
754
  }, t.prototype.error = function(r) {
@@ -750,7 +772,7 @@ var de = function(e) {
750
772
  this.unsubscribe();
751
773
  }
752
774
  }, t;
753
- }(Y), _e = function() {
775
+ }(H), Te = function() {
754
776
  function e(t) {
755
777
  this.partialObserver = t;
756
778
  }
@@ -760,7 +782,7 @@ var de = function(e) {
760
782
  try {
761
783
  r.next(t);
762
784
  } catch (n) {
763
- L(n);
785
+ U(n);
764
786
  }
765
787
  }, e.prototype.error = function(t) {
766
788
  var r = this.partialObserver;
@@ -768,52 +790,52 @@ var de = function(e) {
768
790
  try {
769
791
  r.error(t);
770
792
  } catch (n) {
771
- L(n);
793
+ U(n);
772
794
  }
773
795
  else
774
- L(t);
796
+ U(t);
775
797
  }, e.prototype.complete = function() {
776
798
  var t = this.partialObserver;
777
799
  if (t.complete)
778
800
  try {
779
801
  t.complete();
780
802
  } catch (r) {
781
- L(r);
803
+ U(r);
782
804
  }
783
805
  }, e;
784
- }(), C = function(e) {
806
+ }(), Y = function(e) {
785
807
  pe(t, e);
786
- function t(r, n, s) {
808
+ function t(r, n, c) {
787
809
  var i = e.call(this) || this, o;
788
- return T(r) || !r ? o = {
810
+ return A(r) || !r ? o = {
789
811
  next: r ?? void 0,
790
812
  error: n ?? void 0,
791
- complete: s ?? void 0
792
- } : o = r, i.destination = new _e(o), i;
813
+ complete: c ?? void 0
814
+ } : o = r, i.destination = new Te(o), i;
793
815
  }
794
816
  return t;
795
- }(de);
796
- function L(e) {
797
- Pe(e);
817
+ }(fe);
818
+ function U(e) {
819
+ ve(e);
798
820
  }
799
- function Oe(e) {
821
+ function Ae(e) {
800
822
  throw e;
801
823
  }
802
- var Te = {
824
+ var Oe = {
803
825
  closed: !0,
804
826
  next: ce,
805
- error: Oe,
827
+ error: Ae,
806
828
  complete: ce
807
- }, Ae = function() {
829
+ }, $e = function() {
808
830
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
809
831
  }();
810
- function $e(e) {
832
+ function Ie(e) {
811
833
  return e;
812
834
  }
813
- function Ie(e) {
814
- return e.length === 0 ? $e : e.length === 1 ? e[0] : function(r) {
815
- return e.reduce(function(n, s) {
816
- return s(n);
835
+ function Ne(e) {
836
+ return e.length === 0 ? Ie : e.length === 1 ? e[0] : function(r) {
837
+ return e.reduce(function(n, c) {
838
+ return c(n);
817
839
  }, r);
818
840
  };
819
841
  }
@@ -825,10 +847,10 @@ var Re = function() {
825
847
  var r = new e();
826
848
  return r.source = this, r.operator = t, r;
827
849
  }, e.prototype.subscribe = function(t, r, n) {
828
- var s = this, i = qe(t) ? t : new C(t, r, n);
829
- return ve(function() {
830
- var o = s, h = o.operator, b = o.source;
831
- i.add(h ? h.call(i, b) : b ? s._subscribe(i) : s._trySubscribe(i));
850
+ var c = this, i = je(t) ? t : new Y(t, r, n);
851
+ return _e(function() {
852
+ var o = c, h = o.operator, y = o.source;
853
+ i.add(h ? h.call(i, y) : y ? c._subscribe(i) : c._trySubscribe(i));
832
854
  }), i;
833
855
  }, e.prototype._trySubscribe = function(t) {
834
856
  try {
@@ -838,37 +860,37 @@ var Re = function() {
838
860
  }
839
861
  }, e.prototype.forEach = function(t, r) {
840
862
  var n = this;
841
- return r = ae(r), new r(function(s, i) {
842
- var o = new C({
863
+ return r = ae(r), new r(function(c, i) {
864
+ var o = new Y({
843
865
  next: function(h) {
844
866
  try {
845
867
  t(h);
846
- } catch (b) {
847
- i(b), o.unsubscribe();
868
+ } catch (y) {
869
+ i(y), o.unsubscribe();
848
870
  }
849
871
  },
850
872
  error: i,
851
- complete: s
873
+ complete: c
852
874
  });
853
875
  n.subscribe(o);
854
876
  });
855
877
  }, e.prototype._subscribe = function(t) {
856
878
  var r;
857
879
  return (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(t);
858
- }, e.prototype[Ae] = function() {
880
+ }, e.prototype[$e] = function() {
859
881
  return this;
860
882
  }, e.prototype.pipe = function() {
861
883
  for (var t = [], r = 0; r < arguments.length; r++)
862
884
  t[r] = arguments[r];
863
- return Ie(t)(this);
885
+ return Ne(t)(this);
864
886
  }, e.prototype.toPromise = function(t) {
865
887
  var r = this;
866
- return t = ae(t), new t(function(n, s) {
888
+ return t = ae(t), new t(function(n, c) {
867
889
  var i;
868
890
  r.subscribe(function(o) {
869
891
  return i = o;
870
892
  }, function(o) {
871
- return s(o);
893
+ return c(o);
872
894
  }, function() {
873
895
  return n(i);
874
896
  });
@@ -879,131 +901,85 @@ var Re = function() {
879
901
  }();
880
902
  function ae(e) {
881
903
  var t;
882
- return (t = e ?? Se.Promise) !== null && t !== void 0 ? t : Promise;
883
- }
884
- function Ne(e) {
885
- return e && T(e.next) && T(e.error) && T(e.complete);
904
+ return (t = e ?? ke.Promise) !== null && t !== void 0 ? t : Promise;
886
905
  }
887
906
  function qe(e) {
888
- return e && e instanceof de || Ne(e) && fe(e);
907
+ return e && A(e.next) && A(e.error) && A(e.complete);
889
908
  }
890
- var Me = le(function(e) {
891
- return function() {
892
- e(this), this.name = "EmptyError", this.message = "no elements in sequence";
893
- };
894
- });
895
- function je(e, t) {
896
- return new Promise(function(r, n) {
897
- var s = new C({
898
- next: function(i) {
899
- r(i), s.unsubscribe();
900
- },
901
- error: n,
902
- complete: function() {
903
- n(new Me());
904
- }
905
- });
906
- e.subscribe(s);
907
- });
909
+ function je(e) {
910
+ return e && e instanceof fe || qe(e) && le(e);
908
911
  }
909
- class We {
910
- constructor(t, r) {
911
- this.createClient = t, this.poolSize = r;
912
- }
913
- clients = [];
914
- currentIndex = 0;
915
- connect() {
916
- for (let t = 0; t < this.poolSize; t++)
917
- this.clients.push(this.createClient(`${t + 1}`));
918
- }
919
- get() {
920
- if (this.clients.length === 0)
921
- throw new Error("Connection pool is empty. Please call connect() first.");
922
- const t = this.clients[this.currentIndex];
923
- if (this.currentIndex = (this.currentIndex + 1) % this.poolSize, !t)
924
- throw new Error("No available WebSocket client");
925
- return t;
926
- }
927
- disconnect() {
928
- this.clients.forEach((t) => t.dispose()), this.clients = [];
929
- }
930
- }
931
- const ze = (e, t, r) => r((n, s, i) => {
932
- i && console.warn("options are not supported yet");
933
- const o = n.loc?.source.body;
934
- if (!o)
912
+ const Me = (e, t) => t((r, n, c) => {
913
+ c && console.warn("options are not supported yet");
914
+ const i = r.loc?.source.body;
915
+ if (!i)
935
916
  throw new Error("No query provided");
936
- if (s && typeof s != "object")
917
+ if (n && typeof n != "object")
937
918
  throw new Error("Variables must be an object");
938
- const h = n.definitions.find((d) => d.kind === "OperationDefinition");
939
- if (!h)
919
+ const o = r.definitions.find((P) => P.kind === "OperationDefinition");
920
+ if (!o)
940
921
  throw new Error("No operation definition found");
941
- const b = h.operation, A = () => {
942
- const d = e();
943
- return new Re((v) => d.subscribe({ query: o, variables: s }, v));
944
- }, w = {
945
- kind: b,
946
- operationName: h.name?.value ?? "",
947
- query: o,
948
- variables: s || {}
949
- }, E = (d, v) => {
950
- if (v >= d.length)
951
- return A();
952
- const m = d[v];
953
- return m?.onRequest ? m.onRequest(w, () => E(d, v + 1)) : E(d, v + 1);
954
- }, l = E(t, 0);
955
- return b !== "subscription" ? je(l) : l;
922
+ const h = o.operation, y = e();
923
+ return h !== "subscription" ? new Promise((P, m) => {
924
+ let g = !1;
925
+ y.subscribe(
926
+ { query: i, variables: n },
927
+ {
928
+ next: (l) => {
929
+ g || (P(l), g = !0);
930
+ },
931
+ error: (l) => {
932
+ g || (m(l), g = !0);
933
+ },
934
+ complete: () => {
935
+ if (!g)
936
+ throw new Error("Subscription completed unexpectedly");
937
+ }
938
+ }
939
+ );
940
+ }) : new Re((P) => y.subscribe({ query: i, variables: n }, P));
956
941
  });
957
- class Be {
942
+ class ze {
958
943
  _pool;
959
944
  _sdk;
960
945
  constructor(t, r) {
961
- const { url: n, project: s, token: i, client: o, pooling: h } = r, b = `${n}/graphql/projects/${s}`.replace(/^http/i, "ws");
962
- this._pool = new We(
963
- (A) => {
964
- const w = Object.freeze({ connectionId: A, websocketUrl: b });
965
- return we({
966
- url: b,
946
+ const { url: n, project: c, token: i, client: o, pooling: h } = r, y = `${n}/graphql/projects/${c}`.replace(/^http/i, "ws");
947
+ this._pool = new Se(
948
+ (P) => {
949
+ const m = Object.freeze({ id: P });
950
+ return ge({
951
+ url: y,
967
952
  connectionParams: { authorization: `Bearer ${i}` },
968
953
  lazy: !1,
969
954
  keepAlive: 3e4,
970
955
  retryAttempts: o?.retryAttempts ?? 3,
971
956
  shouldRetry: () => !0,
972
- jsonMessageReplacer: (E, l) => {
973
- if (!E) {
974
- let d = l;
975
- for (const v of r.middlewares ?? [])
976
- v.onOutgoingMessage && (d = v.onOutgoingMessage(d));
977
- return d;
978
- }
979
- return l;
980
- },
981
- ...o?.onError ? { onNonLazyError: (E) => o.onError(w, E) } : {},
957
+ ...o?.onError ? { onNonLazyError: (g) => o.onError(m, g) } : {},
982
958
  on: {
983
- ...o?.onError ? { error: (E) => o.onError(w, E) } : {},
984
- ...o?.onConnected ? { connected: () => o.onConnected(w) } : {},
985
- ...o?.onClosed ? { closed: () => o.onClosed(w) } : {},
986
- ...o?.onConnecting ? { connecting: () => o.onConnecting(w) } : {},
987
- ...o?.onOpened ? { opened: () => o.onOpened(w) } : {},
988
- ...o?.onMessage ? { message: (E) => o.onMessage(w, E) } : {},
989
- ...o?.onPing ? { ping: () => o.onPing(w) } : {},
990
- ...o?.onPong ? { pong: () => o.onPong(w) } : {}
959
+ ...o?.onError ? { error: (g) => o.onError(m, g) } : {},
960
+ ...o?.onConnected ? { connected: () => o.onConnected(m) } : {},
961
+ ...o?.onClosed ? { closed: () => o.onClosed(m) } : {},
962
+ ...o?.onConnecting ? { connecting: () => o.onConnecting(m) } : {},
963
+ ...o?.onOpened ? { opened: () => o.onOpened(m) } : {},
964
+ ...o?.onMessage ? { message: (g) => o.onMessage(m, g) } : {},
965
+ ...o?.onPing ? { ping: () => o.onPing(m) } : {},
966
+ ...o?.onPong ? { pong: () => o.onPong(m) } : {}
991
967
  }
992
968
  });
993
969
  },
994
970
  h?.enabled === !1 ? 1 : h?.size ?? 5
995
- ), this._sdk = { sdk: ze(() => this._pool.get(), r.middlewares ?? [], t) };
971
+ ), this._sdk = { sdk: Me(() => this._pool.get(), t) };
996
972
  }
997
973
  get sdk() {
998
974
  return this._sdk.sdk;
999
975
  }
1000
- async connect() {
976
+ connect() {
1001
977
  this._pool.connect();
1002
978
  }
1003
- async disconnect() {
979
+ disconnect() {
1004
980
  this._pool.disconnect();
1005
981
  }
1006
982
  }
1007
983
  export {
1008
- Be as ContelloSdkClient
984
+ ze as ContelloSdkClient
1009
985
  };