@compilot/react-sdk 2.146.0-dev → 2.147.0-dev
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/compilot-react-sdk.cjs.dev.cjs +178 -350
- package/dist/compilot-react-sdk.cjs.prod.cjs +178 -350
- package/dist/compilot-react-sdk.esm.mjs +178 -350
- package/dist/package.json +2 -2
- package/package.json +5 -5
|
@@ -254,274 +254,116 @@ var useComPilotConfig = function useComPilotConfig() {
|
|
|
254
254
|
return config;
|
|
255
255
|
};
|
|
256
256
|
|
|
257
|
-
function
|
|
258
|
-
|
|
259
|
-
return r;
|
|
260
|
-
};
|
|
261
|
-
var t,
|
|
262
|
-
r = {},
|
|
263
|
-
e = Object.prototype,
|
|
264
|
-
n = e.hasOwnProperty,
|
|
265
|
-
o = "function" == typeof Symbol ? Symbol : {},
|
|
266
|
-
i = o.iterator || "@@iterator",
|
|
267
|
-
a = o.asyncIterator || "@@asyncIterator",
|
|
268
|
-
u = o.toStringTag || "@@toStringTag";
|
|
269
|
-
function c(t, r, e, n) {
|
|
270
|
-
Object.defineProperty(t, r, {
|
|
271
|
-
value: e,
|
|
272
|
-
enumerable: !n,
|
|
273
|
-
configurable: !n,
|
|
274
|
-
writable: !n
|
|
275
|
-
});
|
|
276
|
-
}
|
|
257
|
+
function _regeneratorDefine(e, r, n, t) {
|
|
258
|
+
var i = Object.defineProperty;
|
|
277
259
|
try {
|
|
278
|
-
|
|
279
|
-
} catch (
|
|
280
|
-
|
|
281
|
-
return t[r] = e;
|
|
282
|
-
};
|
|
260
|
+
i({}, "", {});
|
|
261
|
+
} catch (e) {
|
|
262
|
+
i = 0;
|
|
283
263
|
}
|
|
284
|
-
function
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
264
|
+
_regeneratorDefine = function (e, r, n, t) {
|
|
265
|
+
if (r) i ? i(e, r, {
|
|
266
|
+
value: n,
|
|
267
|
+
enumerable: !t,
|
|
268
|
+
configurable: !t,
|
|
269
|
+
writable: !t
|
|
270
|
+
}) : e[r] = n;else {
|
|
271
|
+
function o(r, n) {
|
|
272
|
+
_regeneratorDefine(e, r, function (e) {
|
|
273
|
+
return this._invoke(r, n, e);
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
o("next", 0), o("throw", 1), o("return", 2);
|
|
277
|
+
}
|
|
278
|
+
}, _regeneratorDefine(e, r, n, t);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function _regenerator() {
|
|
282
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
283
|
+
var e,
|
|
284
|
+
t,
|
|
285
|
+
r = "function" == typeof Symbol ? Symbol : {},
|
|
286
|
+
n = r.iterator || "@@iterator",
|
|
287
|
+
o = r.toStringTag || "@@toStringTag";
|
|
288
|
+
function i(r, n, o, i) {
|
|
289
|
+
var c = n && n.prototype instanceof Generator ? n : Generator,
|
|
290
|
+
u = Object.create(c.prototype);
|
|
291
|
+
return _regeneratorDefine(u, "_invoke", function (r, n, o) {
|
|
292
|
+
var i,
|
|
293
|
+
c,
|
|
294
|
+
u,
|
|
295
|
+
f = 0,
|
|
296
|
+
p = o || [],
|
|
297
|
+
y = !1,
|
|
298
|
+
G = {
|
|
299
|
+
p: 0,
|
|
300
|
+
n: 0,
|
|
301
|
+
v: e,
|
|
302
|
+
a: d,
|
|
303
|
+
f: d.bind(e, 4),
|
|
304
|
+
d: function (t, r) {
|
|
305
|
+
return i = t, c = 0, u = e, G.n = r, a;
|
|
306
306
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
307
|
+
};
|
|
308
|
+
function d(r, n) {
|
|
309
|
+
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
|
|
310
|
+
var o,
|
|
311
|
+
i = p[t],
|
|
312
|
+
d = G.p,
|
|
313
|
+
l = i[2];
|
|
314
|
+
r > 3 ? (o = l === n) && (c = i[4] || 3, u = i[5] === e ? i[3] : i[5], i[4] = 3, i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
|
|
315
|
+
}
|
|
316
|
+
if (o || r > 1) return a;
|
|
317
|
+
throw y = !0, n;
|
|
318
|
+
}
|
|
319
|
+
return function (o, p, l) {
|
|
320
|
+
if (f > 1) throw TypeError("Generator is already running");
|
|
321
|
+
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
|
|
322
|
+
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
|
|
323
|
+
try {
|
|
324
|
+
if (f = 2, i) {
|
|
325
|
+
if (c || (o = "next"), t = i[o]) {
|
|
326
|
+
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
|
|
327
|
+
if (!t.done) return t;
|
|
328
|
+
u = t.value, c < 2 && (c = 0);
|
|
329
|
+
} else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
|
|
330
|
+
i = e;
|
|
331
|
+
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
|
|
332
|
+
} catch (t) {
|
|
333
|
+
i = e, c = 1, u = t;
|
|
334
|
+
} finally {
|
|
335
|
+
f = 1;
|
|
319
336
|
}
|
|
320
|
-
"throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg);
|
|
321
337
|
}
|
|
338
|
+
return {
|
|
339
|
+
value: t,
|
|
340
|
+
done: y
|
|
341
|
+
};
|
|
322
342
|
};
|
|
323
|
-
}(r,
|
|
324
|
-
}
|
|
325
|
-
function s(t, r, e) {
|
|
326
|
-
try {
|
|
327
|
-
return {
|
|
328
|
-
type: "normal",
|
|
329
|
-
arg: t.call(r, e)
|
|
330
|
-
};
|
|
331
|
-
} catch (t) {
|
|
332
|
-
return {
|
|
333
|
-
type: "throw",
|
|
334
|
-
arg: t
|
|
335
|
-
};
|
|
336
|
-
}
|
|
343
|
+
}(r, o, i), !0), u;
|
|
337
344
|
}
|
|
338
|
-
|
|
339
|
-
var f = {};
|
|
345
|
+
var a = {};
|
|
340
346
|
function Generator() {}
|
|
341
347
|
function GeneratorFunction() {}
|
|
342
348
|
function GeneratorFunctionPrototype() {}
|
|
343
|
-
|
|
344
|
-
c(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l);
|
|
351
|
-
function g(t) {
|
|
352
|
-
["next", "throw", "return"].forEach(function (r) {
|
|
353
|
-
c(t, r, function (t) {
|
|
354
|
-
return this._invoke(r, t);
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
}
|
|
358
|
-
function AsyncIterator(t, r) {
|
|
359
|
-
function e(o, i, a, u) {
|
|
360
|
-
var c = s(t[o], t, i);
|
|
361
|
-
if ("throw" !== c.type) {
|
|
362
|
-
var h = c.arg,
|
|
363
|
-
f = h.value;
|
|
364
|
-
return f && "object" == typeof f && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) {
|
|
365
|
-
e("next", t, a, u);
|
|
366
|
-
}, function (t) {
|
|
367
|
-
e("throw", t, a, u);
|
|
368
|
-
}) : r.resolve(f).then(function (t) {
|
|
369
|
-
h.value = t, a(h);
|
|
370
|
-
}, function (t) {
|
|
371
|
-
return e("throw", t, a, u);
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
u(c.arg);
|
|
375
|
-
}
|
|
376
|
-
var o;
|
|
377
|
-
c(this, "_invoke", function (t, n) {
|
|
378
|
-
function i() {
|
|
379
|
-
return new r(function (r, o) {
|
|
380
|
-
e(t, n, r, o);
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
return o = o ? o.then(i, i) : i();
|
|
384
|
-
}, !0);
|
|
385
|
-
}
|
|
386
|
-
function d(r, e) {
|
|
387
|
-
var n = e.method,
|
|
388
|
-
o = r.i[n];
|
|
389
|
-
if (o === t) return e.delegate = null, "throw" === n && r.i.return && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f;
|
|
390
|
-
var i = s(o, r.i, e.arg);
|
|
391
|
-
if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f;
|
|
392
|
-
var a = i.arg;
|
|
393
|
-
return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f);
|
|
394
|
-
}
|
|
395
|
-
function w(t) {
|
|
396
|
-
this.tryEntries.push(t);
|
|
397
|
-
}
|
|
398
|
-
function m(r) {
|
|
399
|
-
var e = r[4] || {};
|
|
400
|
-
e.type = "normal", e.arg = t, r[4] = e;
|
|
401
|
-
}
|
|
402
|
-
function Context(t) {
|
|
403
|
-
this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0);
|
|
349
|
+
t = Object.getPrototypeOf;
|
|
350
|
+
var c = [][n] ? t(t([][n]())) : (_regeneratorDefine(t = {}, n, function () {
|
|
351
|
+
return this;
|
|
352
|
+
}), t),
|
|
353
|
+
u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
|
|
354
|
+
function f(e) {
|
|
355
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
|
|
404
356
|
}
|
|
405
|
-
function
|
|
406
|
-
if (null != r) {
|
|
407
|
-
var e = r[i];
|
|
408
|
-
if (e) return e.call(r);
|
|
409
|
-
if ("function" == typeof r.next) return r;
|
|
410
|
-
if (!isNaN(r.length)) {
|
|
411
|
-
var o = -1,
|
|
412
|
-
a = function e() {
|
|
413
|
-
for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e;
|
|
414
|
-
return e.value = t, e.done = !0, e;
|
|
415
|
-
};
|
|
416
|
-
return a.next = a;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
throw new TypeError(typeof r + " is not iterable");
|
|
420
|
-
}
|
|
421
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) {
|
|
422
|
-
var r = "function" == typeof t && t.constructor;
|
|
423
|
-
return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name));
|
|
424
|
-
}, r.mark = function (t) {
|
|
425
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t;
|
|
426
|
-
}, r.awrap = function (t) {
|
|
427
|
-
return {
|
|
428
|
-
__await: t
|
|
429
|
-
};
|
|
430
|
-
}, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () {
|
|
357
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine(u), _regeneratorDefine(u, o, "Generator"), _regeneratorDefine(u, n, function () {
|
|
431
358
|
return this;
|
|
432
|
-
}),
|
|
433
|
-
void 0 === i && (i = Promise);
|
|
434
|
-
var a = new AsyncIterator(h(t, e, n, o), i);
|
|
435
|
-
return r.isGeneratorFunction(e) ? a : a.next().then(function (t) {
|
|
436
|
-
return t.done ? t.value : a.next();
|
|
437
|
-
});
|
|
438
|
-
}, g(v), c(v, u, "Generator"), c(v, i, function () {
|
|
439
|
-
return this;
|
|
440
|
-
}), c(v, "toString", function () {
|
|
359
|
+
}), _regeneratorDefine(u, "toString", function () {
|
|
441
360
|
return "[object Generator]";
|
|
442
|
-
}),
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
return function t() {
|
|
447
|
-
for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t;
|
|
448
|
-
return t.done = !0, t;
|
|
361
|
+
}), (_regenerator = function () {
|
|
362
|
+
return {
|
|
363
|
+
w: i,
|
|
364
|
+
m: f
|
|
449
365
|
};
|
|
450
|
-
}
|
|
451
|
-
constructor: Context,
|
|
452
|
-
reset: function (r) {
|
|
453
|
-
if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t);
|
|
454
|
-
},
|
|
455
|
-
stop: function () {
|
|
456
|
-
this.done = !0;
|
|
457
|
-
var t = this.tryEntries[0][4];
|
|
458
|
-
if ("throw" === t.type) throw t.arg;
|
|
459
|
-
return this.rval;
|
|
460
|
-
},
|
|
461
|
-
dispatchException: function (r) {
|
|
462
|
-
if (this.done) throw r;
|
|
463
|
-
var e = this;
|
|
464
|
-
function n(t) {
|
|
465
|
-
a.type = "throw", a.arg = r, e.next = t;
|
|
466
|
-
}
|
|
467
|
-
for (var o = e.tryEntries.length - 1; o >= 0; --o) {
|
|
468
|
-
var i = this.tryEntries[o],
|
|
469
|
-
a = i[4],
|
|
470
|
-
u = this.prev,
|
|
471
|
-
c = i[1],
|
|
472
|
-
h = i[2];
|
|
473
|
-
if (-1 === i[0]) return n("end"), !1;
|
|
474
|
-
if (!c && !h) throw Error("try statement without catch or finally");
|
|
475
|
-
if (null != i[0] && i[0] <= u) {
|
|
476
|
-
if (u < c) return this.method = "next", this.arg = t, n(c), !0;
|
|
477
|
-
if (u < h) return n(h), !1;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
},
|
|
481
|
-
abrupt: function (t, r) {
|
|
482
|
-
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
483
|
-
var n = this.tryEntries[e];
|
|
484
|
-
if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) {
|
|
485
|
-
var o = n;
|
|
486
|
-
break;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null);
|
|
490
|
-
var i = o ? o[4] : {};
|
|
491
|
-
return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i);
|
|
492
|
-
},
|
|
493
|
-
complete: function (t, r) {
|
|
494
|
-
if ("throw" === t.type) throw t.arg;
|
|
495
|
-
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f;
|
|
496
|
-
},
|
|
497
|
-
finish: function (t) {
|
|
498
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
499
|
-
var e = this.tryEntries[r];
|
|
500
|
-
if (e[2] === t) return this.complete(e[4], e[3]), m(e), f;
|
|
501
|
-
}
|
|
502
|
-
},
|
|
503
|
-
catch: function (t) {
|
|
504
|
-
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
505
|
-
var e = this.tryEntries[r];
|
|
506
|
-
if (e[0] === t) {
|
|
507
|
-
var n = e[4];
|
|
508
|
-
if ("throw" === n.type) {
|
|
509
|
-
var o = n.arg;
|
|
510
|
-
m(e);
|
|
511
|
-
}
|
|
512
|
-
return o;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
throw Error("illegal catch attempt");
|
|
516
|
-
},
|
|
517
|
-
delegateYield: function (r, e, n) {
|
|
518
|
-
return this.delegate = {
|
|
519
|
-
i: x(r),
|
|
520
|
-
r: e,
|
|
521
|
-
n: n
|
|
522
|
-
}, "next" === this.method && (this.arg = t), f;
|
|
523
|
-
}
|
|
524
|
-
}, r;
|
|
366
|
+
})();
|
|
525
367
|
}
|
|
526
368
|
|
|
527
369
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
@@ -587,11 +429,12 @@ var useAsyncMutationState = function useAsyncMutationState(_ref) {
|
|
|
587
429
|
_useGlobalState2 = _slicedToArray(_useGlobalState, 2),
|
|
588
430
|
globalState = _useGlobalState2[0],
|
|
589
431
|
setState = _useGlobalState2[1];
|
|
590
|
-
var mutateAsync = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
432
|
+
var mutateAsync = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
591
433
|
var result,
|
|
592
|
-
_args = arguments
|
|
593
|
-
|
|
594
|
-
|
|
434
|
+
_args = arguments,
|
|
435
|
+
_t;
|
|
436
|
+
return _regenerator().w(function (_context) {
|
|
437
|
+
while (1) switch (_context.n) {
|
|
595
438
|
case 0:
|
|
596
439
|
setState(function (state) {
|
|
597
440
|
return {
|
|
@@ -603,11 +446,11 @@ var useAsyncMutationState = function useAsyncMutationState(_ref) {
|
|
|
603
446
|
error: null
|
|
604
447
|
};
|
|
605
448
|
});
|
|
606
|
-
_context.
|
|
607
|
-
_context.
|
|
449
|
+
_context.p = 1;
|
|
450
|
+
_context.n = 2;
|
|
608
451
|
return mutationFn.apply(void 0, _args);
|
|
609
|
-
case
|
|
610
|
-
result = _context.
|
|
452
|
+
case 2:
|
|
453
|
+
result = _context.v;
|
|
611
454
|
setState(function (_state) {
|
|
612
455
|
return {
|
|
613
456
|
data: result,
|
|
@@ -620,10 +463,10 @@ var useAsyncMutationState = function useAsyncMutationState(_ref) {
|
|
|
620
463
|
});
|
|
621
464
|
|
|
622
465
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
623
|
-
return _context.
|
|
624
|
-
case
|
|
625
|
-
_context.
|
|
626
|
-
|
|
466
|
+
return _context.a(2, result);
|
|
467
|
+
case 3:
|
|
468
|
+
_context.p = 3;
|
|
469
|
+
_t = _context.v;
|
|
627
470
|
setState(function (state) {
|
|
628
471
|
return {
|
|
629
472
|
data: state.data,
|
|
@@ -631,14 +474,13 @@ var useAsyncMutationState = function useAsyncMutationState(_ref) {
|
|
|
631
474
|
isPending: false,
|
|
632
475
|
isError: true,
|
|
633
476
|
isSuccess: false,
|
|
634
|
-
error:
|
|
477
|
+
error: _t instanceof Error ? _t : new Error(String(_t))
|
|
635
478
|
};
|
|
636
479
|
});
|
|
637
|
-
case
|
|
638
|
-
|
|
639
|
-
return _context.stop();
|
|
480
|
+
case 4:
|
|
481
|
+
return _context.a(2);
|
|
640
482
|
}
|
|
641
|
-
}, _callee, null, [[1,
|
|
483
|
+
}, _callee, null, [[1, 3]]);
|
|
642
484
|
})), [setState, mutationFn]);
|
|
643
485
|
var setData = useCallback(function (data) {
|
|
644
486
|
setState(function (_state) {
|
|
@@ -880,32 +722,31 @@ var useCustomerStatus = function useCustomerStatus() {
|
|
|
880
722
|
}, [config._internal.externalEventEmitter, config._internal.identifier]);
|
|
881
723
|
useEffect(function () {
|
|
882
724
|
var updateStatus = /*#__PURE__*/function () {
|
|
883
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
884
|
-
var status;
|
|
885
|
-
return
|
|
886
|
-
while (1) switch (_context.
|
|
725
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
726
|
+
var status, _t;
|
|
727
|
+
return _regenerator().w(function (_context) {
|
|
728
|
+
while (1) switch (_context.n) {
|
|
887
729
|
case 0:
|
|
888
|
-
_context.
|
|
889
|
-
_context.
|
|
730
|
+
_context.p = 0;
|
|
731
|
+
_context.n = 1;
|
|
890
732
|
return fetchCustomerStatus(config);
|
|
891
|
-
case
|
|
892
|
-
status = _context.
|
|
733
|
+
case 1:
|
|
734
|
+
status = _context.v;
|
|
893
735
|
setResult(status);
|
|
894
|
-
_context.
|
|
736
|
+
_context.n = 3;
|
|
895
737
|
break;
|
|
896
|
-
case
|
|
897
|
-
_context.
|
|
898
|
-
|
|
738
|
+
case 2:
|
|
739
|
+
_context.p = 2;
|
|
740
|
+
_t = _context.v;
|
|
899
741
|
config._internal.logger.error({
|
|
900
742
|
msg: "Failed to fetch user status",
|
|
901
|
-
error:
|
|
743
|
+
error: _t
|
|
902
744
|
});
|
|
903
|
-
setError(
|
|
904
|
-
case
|
|
905
|
-
|
|
906
|
-
return _context.stop();
|
|
745
|
+
setError(_t instanceof Error ? _t : new Error(String(_t)));
|
|
746
|
+
case 3:
|
|
747
|
+
return _context.a(2);
|
|
907
748
|
}
|
|
908
|
-
}, _callee, null, [[0,
|
|
749
|
+
}, _callee, null, [[0, 2]]);
|
|
909
750
|
}));
|
|
910
751
|
return function updateStatus() {
|
|
911
752
|
return _ref2.apply(this, arguments);
|
|
@@ -951,19 +792,16 @@ var useCustomerStatus = function useCustomerStatus() {
|
|
|
951
792
|
|
|
952
793
|
// ensure the debounce is global accross all react hook instances
|
|
953
794
|
var fetchCustomerStatus = simpleLeadingDebounce(/*#__PURE__*/function () {
|
|
954
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/
|
|
795
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(config) {
|
|
955
796
|
var status;
|
|
956
|
-
return
|
|
957
|
-
while (1) switch (_context2.
|
|
797
|
+
return _regenerator().w(function (_context2) {
|
|
798
|
+
while (1) switch (_context2.n) {
|
|
958
799
|
case 0:
|
|
959
|
-
_context2.
|
|
800
|
+
_context2.n = 1;
|
|
960
801
|
return getCustomerStatus(config);
|
|
961
|
-
case
|
|
962
|
-
status = _context2.
|
|
963
|
-
return _context2.
|
|
964
|
-
case 4:
|
|
965
|
-
case "end":
|
|
966
|
-
return _context2.stop();
|
|
802
|
+
case 1:
|
|
803
|
+
status = _context2.v;
|
|
804
|
+
return _context2.a(2, status);
|
|
967
805
|
}
|
|
968
806
|
}, _callee2);
|
|
969
807
|
}));
|
|
@@ -999,19 +837,16 @@ var fetchCustomerStatus = simpleLeadingDebounce(/*#__PURE__*/function () {
|
|
|
999
837
|
*/
|
|
1000
838
|
var useDisconnect = function useDisconnect() {
|
|
1001
839
|
var config = useComPilotConfig();
|
|
1002
|
-
var mutationFn = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
840
|
+
var mutationFn = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
1003
841
|
var isDisconnected;
|
|
1004
|
-
return
|
|
1005
|
-
while (1) switch (_context.
|
|
842
|
+
return _regenerator().w(function (_context) {
|
|
843
|
+
while (1) switch (_context.n) {
|
|
1006
844
|
case 0:
|
|
1007
|
-
_context.
|
|
845
|
+
_context.n = 1;
|
|
1008
846
|
return disconnect(config);
|
|
1009
|
-
case
|
|
1010
|
-
isDisconnected = _context.
|
|
1011
|
-
return _context.
|
|
1012
|
-
case 4:
|
|
1013
|
-
case "end":
|
|
1014
|
-
return _context.stop();
|
|
847
|
+
case 1:
|
|
848
|
+
isDisconnected = _context.v;
|
|
849
|
+
return _context.a(2, !isDisconnected);
|
|
1015
850
|
}
|
|
1016
851
|
}, _callee);
|
|
1017
852
|
})), [config]);
|
|
@@ -1183,19 +1018,16 @@ var useDisconnect = function useDisconnect() {
|
|
|
1183
1018
|
var useGetTxAuthDataSignature = function useGetTxAuthDataSignature() {
|
|
1184
1019
|
var config = useComPilotConfig();
|
|
1185
1020
|
var mutationFn = useCallback(/*#__PURE__*/function () {
|
|
1186
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
1021
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
|
|
1187
1022
|
var res;
|
|
1188
|
-
return
|
|
1189
|
-
while (1) switch (_context.
|
|
1023
|
+
return _regenerator().w(function (_context) {
|
|
1024
|
+
while (1) switch (_context.n) {
|
|
1190
1025
|
case 0:
|
|
1191
|
-
_context.
|
|
1026
|
+
_context.n = 1;
|
|
1192
1027
|
return getTxAuthDataSignature(config, params);
|
|
1193
|
-
case
|
|
1194
|
-
res = _context.
|
|
1195
|
-
return _context.
|
|
1196
|
-
case 4:
|
|
1197
|
-
case "end":
|
|
1198
|
-
return _context.stop();
|
|
1028
|
+
case 1:
|
|
1029
|
+
res = _context.v;
|
|
1030
|
+
return _context.a(2, res);
|
|
1199
1031
|
}
|
|
1200
1032
|
}, _callee);
|
|
1201
1033
|
}));
|
|
@@ -1237,36 +1069,35 @@ var useIdentityId = function useIdentityId() {
|
|
|
1237
1069
|
}
|
|
1238
1070
|
var unsubscribe = watchIsAuthenticated(config, {
|
|
1239
1071
|
onIsAuthenticatedChange: function () {
|
|
1240
|
-
var _onIsAuthenticatedChange = _asyncToGenerator(/*#__PURE__*/
|
|
1241
|
-
var res;
|
|
1242
|
-
return
|
|
1243
|
-
while (1) switch (_context.
|
|
1072
|
+
var _onIsAuthenticatedChange = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(isAuthenticated) {
|
|
1073
|
+
var res, _t;
|
|
1074
|
+
return _regenerator().w(function (_context) {
|
|
1075
|
+
while (1) switch (_context.n) {
|
|
1244
1076
|
case 0:
|
|
1245
1077
|
if (isAuthenticated) {
|
|
1246
|
-
_context.
|
|
1078
|
+
_context.n = 1;
|
|
1247
1079
|
break;
|
|
1248
1080
|
}
|
|
1249
1081
|
setResult(null);
|
|
1250
|
-
return _context.
|
|
1251
|
-
case
|
|
1252
|
-
_context.
|
|
1253
|
-
_context.
|
|
1082
|
+
return _context.a(2);
|
|
1083
|
+
case 1:
|
|
1084
|
+
_context.p = 1;
|
|
1085
|
+
_context.n = 2;
|
|
1254
1086
|
return getIdentityId(config);
|
|
1255
|
-
case
|
|
1256
|
-
res = _context.
|
|
1087
|
+
case 2:
|
|
1088
|
+
res = _context.v;
|
|
1257
1089
|
setResult(res);
|
|
1258
|
-
_context.
|
|
1090
|
+
_context.n = 4;
|
|
1259
1091
|
break;
|
|
1260
|
-
case
|
|
1261
|
-
_context.
|
|
1262
|
-
|
|
1263
|
-
config._internal.logger.error("Failed to fetch identity id",
|
|
1264
|
-
setError(
|
|
1265
|
-
case
|
|
1266
|
-
|
|
1267
|
-
return _context.stop();
|
|
1092
|
+
case 3:
|
|
1093
|
+
_context.p = 3;
|
|
1094
|
+
_t = _context.v;
|
|
1095
|
+
config._internal.logger.error("Failed to fetch identity id", _t);
|
|
1096
|
+
setError(_t instanceof Error ? _t : new Error("Unknown error"));
|
|
1097
|
+
case 4:
|
|
1098
|
+
return _context.a(2);
|
|
1268
1099
|
}
|
|
1269
|
-
}, _callee, null, [[
|
|
1100
|
+
}, _callee, null, [[1, 3]]);
|
|
1270
1101
|
}));
|
|
1271
1102
|
function onIsAuthenticatedChange(_x) {
|
|
1272
1103
|
return _onIsAuthenticatedChange.apply(this, arguments);
|
|
@@ -1317,26 +1148,23 @@ var useIdentityWallets = function useIdentityWallets() {
|
|
|
1317
1148
|
});
|
|
1318
1149
|
}, [config, queryCacheBuster]);
|
|
1319
1150
|
var mutationFn = useCallback(/*#__PURE__*/function () {
|
|
1320
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
1151
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(wallet) {
|
|
1321
1152
|
var res;
|
|
1322
|
-
return
|
|
1323
|
-
while (1) switch (_context.
|
|
1153
|
+
return _regenerator().w(function (_context) {
|
|
1154
|
+
while (1) switch (_context.n) {
|
|
1324
1155
|
case 0:
|
|
1325
|
-
_context.
|
|
1156
|
+
_context.n = 1;
|
|
1326
1157
|
return attachWalletToIdentity(config, {
|
|
1327
1158
|
wallet: wallet
|
|
1328
1159
|
});
|
|
1329
|
-
case
|
|
1330
|
-
res = _context.
|
|
1160
|
+
case 1:
|
|
1161
|
+
res = _context.v;
|
|
1331
1162
|
if (res) {
|
|
1332
1163
|
setQueryCacheBuster(function (prev) {
|
|
1333
1164
|
return prev + 1;
|
|
1334
1165
|
});
|
|
1335
1166
|
}
|
|
1336
|
-
return _context.
|
|
1337
|
-
case 5:
|
|
1338
|
-
case "end":
|
|
1339
|
-
return _context.stop();
|
|
1167
|
+
return _context.a(2, res);
|
|
1340
1168
|
}
|
|
1341
1169
|
}, _callee);
|
|
1342
1170
|
}));
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compilot/react-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.147.0",
|
|
4
4
|
"description": "ComPilot React SDK",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "ISC",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@nexeraid/identity-schemas": "workspace:*",
|
|
51
51
|
"@nexeraid/logger": "workspace:*",
|
|
52
52
|
"pino": "^9.7.0",
|
|
53
|
-
"zod": "^3.25.
|
|
53
|
+
"zod": "^3.25.51"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": ">=17.0.0 <20.0.0"
|