@ancon/wildcat-utils 1.51.0-check-optimizations.1 → 1.51.0-check-optimizations.3
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/{_baseIsEqual-5e6adb07.mjs → _baseIsEqual-4ee44a4c.mjs} +1 -1
- package/{_baseIsEqual-ad544573.js → _baseIsEqual-7e335f42.js} +1 -1
- package/_baseIteratee-374c60ca.js +1 -0
- package/{_baseIteratee-db1f278d.mjs → _baseIteratee-5fbe491c.mjs} +21 -20
- package/_getTag-3d3032da.js +1 -0
- package/{_getTag-fcc5160b.mjs → _getTag-ebc0f90e.mjs} +20 -24
- package/api/getMediaImageClosestSize.d.ts +2 -0
- package/api/getMediaImageClosestSize.js +1 -0
- package/api/getMediaImageClosestSize.mjs +31 -0
- package/api/index.d.ts +2 -1
- package/api/index.js +1 -1
- package/api/index.mjs +8 -6
- package/card/getPrepaidWalletScanReadingInfo.d.ts +7 -0
- package/card/getPrepaidWalletScanReadingInfo.js +1 -0
- package/card/getPrepaidWalletScanReadingInfo.mjs +32 -0
- package/card/getScannedWalletReadingInfo.d.ts +1 -0
- package/card/index.d.ts +2 -0
- package/card/index.js +1 -1
- package/card/index.mjs +7 -4
- package/check/getOrganizedCheckItemModifications.js +1 -1
- package/check/getOrganizedCheckItemModifications.mjs +65 -64
- package/check/index.js +1 -1
- package/check/index.mjs +9 -8
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +7 -6
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +61 -60
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +8 -7
- package/hangfire/createHangfirePoller.d.ts +13 -2
- package/hangfire/createHangfirePoller.js +1 -1
- package/hangfire/createHangfirePoller.mjs +153 -87
- package/hangfire/createMakeHangfireRequest.d.ts +2 -0
- package/hangfire/createMakeHangfireRequest.js +1 -1
- package/hangfire/createMakeHangfireRequest.mjs +18 -17
- package/{identity-cf449299.mjs → identity-41198897.mjs} +1 -1
- package/{identity-2a048185.js → identity-58f9497d.js} +1 -1
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +372 -365
- package/isObject-361bd834.js +1 -0
- package/isObject-b8638513.mjs +7 -0
- package/multilingual/createLocalizedCheckDetails.d.ts +16 -0
- package/multilingual/createLocalizedCheckDetails.js +1 -0
- package/multilingual/createLocalizedCheckDetails.mjs +53 -0
- package/multilingual/index.d.ts +2 -0
- package/multilingual/index.js +1 -0
- package/multilingual/index.mjs +5 -0
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +7 -6
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +20 -19
- package/order/index.js +1 -1
- package/order/index.mjs +11 -10
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +10 -9
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +7 -6
- package/outlet/index.d.ts +2 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +71 -68
- package/outlet/isOutletAcceptingPreOrdersWhenClosed.d.ts +2 -0
- package/outlet/isOutletAcceptingPreOrdersWhenClosed.js +1 -0
- package/outlet/isOutletAcceptingPreOrdersWhenClosed.mjs +14 -0
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +29 -28
- package/package.json +26 -1
- package/preOrder/isGroupPreOrder.d.ts +6 -4
- package/preOrder/isGroupPreOrder.js +1 -1
- package/preOrder/isGroupPreOrder.mjs +4 -4
- package/preOrder/isPreOrderLink.d.ts +6 -4
- package/preOrder/isPreOrderLink.js +1 -1
- package/preOrder/isPreOrderLink.mjs +4 -4
- package/preOrder/isPreOrderSharable.d.ts +6 -4
- package/preOrder/isPreOrderSharable.js +1 -1
- package/preOrder/isPreOrderSharable.mjs +1 -1
- package/signalr/SignalR.js +1 -1
- package/signalr/SignalR.mjs +62 -62
- package/signalr/types.d.ts +2 -0
- package/_baseIteratee-ae97e42e.js +0 -1
- package/_getTag-d4cd1660.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const X=require("../toString-b771abdf.js"),o=require("../_getTag-3d3032da.js"),O=require("../isObject-361bd834.js"),f=require("../isObjectLike-963267e9.js"),T=require("../identity-58f9497d.js"),Z=require("../_baseSlice-e1b41ceb.js");function V(e,n){for(var r=-1,t=e==null?0:e.length;++r<t&&n(e[r],r,e)!==!1;);return e}var z=function(){try{var e=o.getNative(Object,"defineProperty");return e({},"",{}),e}catch{}}();const v=z;function N(e,n,r){n=="__proto__"&&v?v(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[n]=r}var k=Object.prototype,ee=k.hasOwnProperty;function B(e,n,r){var t=e[n];(!(ee.call(e,n)&&o.eq(t,r))||r===void 0&&!(n in e))&&N(e,n,r)}function d(e,n,r,t){var a=!r;r||(r={});for(var c=-1,u=n.length;++c<u;){var s=n[c],l=t?t(r[s],e[s],s,r,e):void 0;l===void 0&&(l=e[s]),a?N(r,s,l):B(r,s,l)}return r}function ne(e,n){return e&&d(n,o.keys(n),e)}function re(e){var n=[];if(e!=null)for(var r in Object(e))n.push(r);return n}var te=Object.prototype,oe=te.hasOwnProperty;function ae(e){if(!O.isObject(e))return re(e);var n=o.isPrototype(e),r=[];for(var t in e)t=="constructor"&&(n||!oe.call(e,t))||r.push(t);return r}function A(e){return o.isArrayLike(e)?o.arrayLikeKeys(e,!0):ae(e)}function ie(e,n){return e&&d(n,A(n),e)}var D=typeof exports=="object"&&exports&&!exports.nodeType&&exports,P=D&&typeof module=="object"&&module&&!module.nodeType&&module,ce=P&&P.exports===D,F=ce?f.root.Buffer:void 0,C=F?F.allocUnsafe:void 0;function ue(e,n){if(n)return e.slice();var r=e.length,t=C?C(r):new e.constructor(r);return e.copy(t),t}function se(e,n){var r=-1,t=e.length;for(n||(n=Array(t));++r<t;)n[r]=e[r];return n}function fe(e,n){return d(e,o.getSymbols(e),n)}var le=o.overArg(Object.getPrototypeOf,Object);const h=le;var ge=Object.getOwnPropertySymbols,be=ge?function(e){for(var n=[];e;)o.arrayPush(n,o.getSymbols(e)),e=h(e);return n}:o.stubArray;const G=be;function ye(e,n){return d(e,G(e),n)}function q(e){return o.baseGetAllKeys(e,A,G)}var Te=Object.prototype,de=Te.hasOwnProperty;function pe(e){var n=e.length,r=new e.constructor(n);return n&&typeof e[0]=="string"&&de.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function S(e){var n=new e.constructor(e.byteLength);return new o.Uint8Array(n).set(new o.Uint8Array(e)),n}function ve(e,n){var r=n?S(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Oe=/\w*$/;function Ae(e){var n=new e.constructor(e.source,Oe.exec(e));return n.lastIndex=e.lastIndex,n}var L=f.Symbol?f.Symbol.prototype:void 0,I=L?L.valueOf:void 0;function he(e){return I?Object(I.call(e)):{}}function Se(e,n){var r=n?S(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var je="[object Boolean]",$e="[object Date]",me="[object Map]",we="[object Number]",Pe="[object RegExp]",Fe="[object Set]",Ce="[object String]",Le="[object Symbol]",Ie="[object ArrayBuffer]",Ue="[object DataView]",_e="[object Float32Array]",xe="[object Float64Array]",Ee="[object Int8Array]",Me="[object Int16Array]",Ne="[object Int32Array]",Be="[object Uint8Array]",De="[object Uint8ClampedArray]",Ge="[object Uint16Array]",qe="[object Uint32Array]";function Ke(e,n,r){var t=e.constructor;switch(n){case Ie:return S(e);case je:case $e:return new t(+e);case Ue:return ve(e,r);case _e:case xe:case Ee:case Me:case Ne:case Be:case De:case Ge:case qe:return Se(e,r);case me:return new t;case we:case Ce:return new t(e);case Pe:return Ae(e);case Fe:return new t;case Le:return he(e)}}var U=Object.create,Re=function(){function e(){}return function(n){if(!O.isObject(n))return{};if(U)return U(n);e.prototype=n;var r=new e;return e.prototype=void 0,r}}();const He=Re;function Ye(e){return typeof e.constructor=="function"&&!o.isPrototype(e)?He(h(e)):{}}var We="[object Map]";function Je(e){return f.isObjectLike(e)&&o.getTag(e)==We}var _=o.nodeUtil&&o.nodeUtil.isMap,Qe=_?o.baseUnary(_):Je;const Xe=Qe;var Ze="[object Set]";function Ve(e){return f.isObjectLike(e)&&o.getTag(e)==Ze}var x=o.nodeUtil&&o.nodeUtil.isSet,ze=x?o.baseUnary(x):Ve;const ke=ze;var en=1,nn=2,rn=4,K="[object Arguments]",tn="[object Array]",on="[object Boolean]",an="[object Date]",cn="[object Error]",R="[object Function]",un="[object GeneratorFunction]",sn="[object Map]",fn="[object Number]",H="[object Object]",ln="[object RegExp]",gn="[object Set]",bn="[object String]",yn="[object Symbol]",Tn="[object WeakMap]",dn="[object ArrayBuffer]",pn="[object DataView]",vn="[object Float32Array]",On="[object Float64Array]",An="[object Int8Array]",hn="[object Int16Array]",Sn="[object Int32Array]",jn="[object Uint8Array]",$n="[object Uint8ClampedArray]",mn="[object Uint16Array]",wn="[object Uint32Array]",i={};i[K]=i[tn]=i[dn]=i[pn]=i[on]=i[an]=i[vn]=i[On]=i[An]=i[hn]=i[Sn]=i[sn]=i[fn]=i[H]=i[ln]=i[gn]=i[bn]=i[yn]=i[jn]=i[$n]=i[mn]=i[wn]=!0;i[cn]=i[R]=i[Tn]=!1;function p(e,n,r,t,a,c){var u,s=n&en,l=n&nn,J=n&rn;if(r&&(u=a?r(e,t,a,c):r(e)),u!==void 0)return u;if(!O.isObject(e))return e;var j=f.isArray(e);if(j){if(u=pe(e),!s)return se(e,u)}else{var y=o.getTag(e),$=y==R||y==un;if(o.isBuffer(e))return ue(e,s);if(y==H||y==K||$&&!a){if(u=l||$?{}:Ye(e),!s)return l?ye(e,ie(u,e)):fe(e,ne(u,e))}else{if(!i[y])return a?e:{};u=Ke(e,y,s)}}c||(c=new o.Stack);var m=c.get(e);if(m)return m;c.set(e,u),ke(e)?e.forEach(function(g){u.add(p(g,n,r,g,e,c))}):Xe(e)&&e.forEach(function(g,b){u.set(b,p(g,n,r,b,e,c))});var Q=J?l?q:o.getAllKeys:l?A:o.keys,w=j?void 0:Q(e);return V(w||e,function(g,b){w&&(b=g,g=e[b]),B(u,b,p(g,n,r,b,e,c))}),u}function Pn(e){var n=e==null?0:e.length;return n?e[n-1]:void 0}function Fn(e,n){return n.length<2?e:T.baseGet(e,Z.baseSlice(n,0,-1))}function Cn(e,n){return n=T.castPath(n,e),e=Fn(e,n),e==null||delete e[T.toKey(Pn(n))]}var Ln="[object Object]",In=Function.prototype,Un=Object.prototype,Y=In.toString,_n=Un.hasOwnProperty,xn=Y.call(Object);function En(e){if(!f.isObjectLike(e)||f.baseGetTag(e)!=Ln)return!1;var n=h(e);if(n===null)return!0;var r=_n.call(n,"constructor")&&n.constructor;return typeof r=="function"&&r instanceof r&&Y.call(r)==xn}function Mn(e){return En(e)?void 0:e}var E=f.Symbol?f.Symbol.isConcatSpreadable:void 0;function Nn(e){return f.isArray(e)||o.isArguments(e)||!!(E&&e&&e[E])}function W(e,n,r,t,a){var c=-1,u=e.length;for(r||(r=Nn),a||(a=[]);++c<u;){var s=e[c];n>0&&r(s)?n>1?W(s,n-1,r,t,a):o.arrayPush(a,s):t||(a[a.length]=s)}return a}function Bn(e){var n=e==null?0:e.length;return n?W(e,1):[]}function Dn(e,n,r){switch(r.length){case 0:return e.call(n);case 1:return e.call(n,r[0]);case 2:return e.call(n,r[0],r[1]);case 3:return e.call(n,r[0],r[1],r[2])}return e.apply(n,r)}var M=Math.max;function Gn(e,n,r){return n=M(n===void 0?e.length-1:n,0),function(){for(var t=arguments,a=-1,c=M(t.length-n,0),u=Array(c);++a<c;)u[a]=t[n+a];a=-1;for(var s=Array(n+1);++a<n;)s[a]=t[a];return s[n]=r(u),Dn(e,this,s)}}function qn(e){return function(){return e}}var Kn=v?function(e,n){return v(e,"toString",{configurable:!0,enumerable:!1,value:qn(n),writable:!0})}:T.identity;const Rn=Kn;var Hn=800,Yn=16,Wn=Date.now;function Jn(e){var n=0,r=0;return function(){var t=Wn(),a=Yn-(t-r);if(r=t,a>0){if(++n>=Hn)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}var Qn=Jn(Rn);const Xn=Qn;function Zn(e){return Xn(Gn(e,void 0,Bn),e+"")}var Vn=1,zn=2,kn=4,er=Zn(function(e,n){var r={};if(e==null)return r;var t=!1;n=X.arrayMap(n,function(c){return c=T.castPath(c,e),t||(t=c.length>1),c}),d(e,q(e),r),t&&(r=p(r,Vn|zn|kn,Mn));for(var a=n.length;a--;)Cn(r,n[a]);return r});const nr=er;function rr({openingHours:e}){const n=e.reduce((r,t)=>(r[t.orderFormat]||(r[t.orderFormat]={orderFormats:t.orderFormat,intervals:[],isDefault:t.isDefault}),r[t.orderFormat].intervals.push(nr(t,"orderFormat")),r),{});return Object.values(n)}module.exports=rr;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { a as or } from "../toString-ce418705.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { j as ar, e as ir, k as D, l as G, m as sr, n as ur, o as K, p as fr, s as cr, q as R, r as lr, U as F, a as v, t as y, u as H, i as gr, b as br, g as pr, h as yr } from "../_getTag-ebc0f90e.mjs";
|
|
3
|
+
import { i as m } from "../isObject-b8638513.mjs";
|
|
3
4
|
import { r as dr, S as d, i as O, a as q, b as Tr } from "../isObjectLike-54341556.mjs";
|
|
4
|
-
import { b as vr, c as Y, t as mr, i as Or } from "../identity-
|
|
5
|
-
import { b as
|
|
6
|
-
function
|
|
5
|
+
import { b as vr, c as Y, t as mr, i as Or } from "../identity-41198897.mjs";
|
|
6
|
+
import { b as hr } from "../_baseSlice-4d543985.mjs";
|
|
7
|
+
function Ar(r, e) {
|
|
7
8
|
for (var n = -1, t = r == null ? 0 : r.length; ++n < t && e(r[n], n, r) !== !1; )
|
|
8
9
|
;
|
|
9
10
|
return r;
|
|
@@ -50,18 +51,18 @@ function Pr(r) {
|
|
|
50
51
|
}
|
|
51
52
|
var Fr = Object.prototype, Cr = Fr.hasOwnProperty;
|
|
52
53
|
function xr(r) {
|
|
53
|
-
if (!
|
|
54
|
+
if (!m(r))
|
|
54
55
|
return Pr(r);
|
|
55
56
|
var e = G(r), n = [];
|
|
56
57
|
for (var t in r)
|
|
57
58
|
t == "constructor" && (e || !Cr.call(r, t)) || n.push(t);
|
|
58
59
|
return n;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function h(r) {
|
|
61
62
|
return sr(r) ? ur(r, !0) : xr(r);
|
|
62
63
|
}
|
|
63
64
|
function Lr(r, e) {
|
|
64
|
-
return r && b(e,
|
|
65
|
+
return r && b(e, h(e), r);
|
|
65
66
|
}
|
|
66
67
|
var Q = typeof exports == "object" && exports && !exports.nodeType && exports, C = Q && typeof module == "object" && module && !module.nodeType && module, Ir = C && C.exports === Q, x = Ir ? dr.Buffer : void 0, L = x ? x.allocUnsafe : void 0;
|
|
67
68
|
function Er(r, e) {
|
|
@@ -80,10 +81,10 @@ function Mr(r, e) {
|
|
|
80
81
|
return b(r, K(r), e);
|
|
81
82
|
}
|
|
82
83
|
var Ur = fr(Object.getPrototypeOf, Object);
|
|
83
|
-
const
|
|
84
|
+
const A = Ur;
|
|
84
85
|
var Nr = Object.getOwnPropertySymbols, Br = Nr ? function(r) {
|
|
85
86
|
for (var e = []; r; )
|
|
86
|
-
R(e, K(r)), r =
|
|
87
|
+
R(e, K(r)), r = A(r);
|
|
87
88
|
return e;
|
|
88
89
|
} : cr;
|
|
89
90
|
const X = Br;
|
|
@@ -91,7 +92,7 @@ function Dr(r, e) {
|
|
|
91
92
|
return b(r, X(r), e);
|
|
92
93
|
}
|
|
93
94
|
function Z(r) {
|
|
94
|
-
return lr(r,
|
|
95
|
+
return lr(r, h, X);
|
|
95
96
|
}
|
|
96
97
|
var Gr = Object.prototype, Kr = Gr.hasOwnProperty;
|
|
97
98
|
function Rr(r) {
|
|
@@ -157,7 +158,7 @@ var _ = Object.create, pe = function() {
|
|
|
157
158
|
function r() {
|
|
158
159
|
}
|
|
159
160
|
return function(e) {
|
|
160
|
-
if (!
|
|
161
|
+
if (!m(e))
|
|
161
162
|
return {};
|
|
162
163
|
if (_)
|
|
163
164
|
return _(e);
|
|
@@ -168,19 +169,19 @@ var _ = Object.create, pe = function() {
|
|
|
168
169
|
}();
|
|
169
170
|
const ye = pe;
|
|
170
171
|
function de(r) {
|
|
171
|
-
return typeof r.constructor == "function" && !G(r) ? ye(
|
|
172
|
+
return typeof r.constructor == "function" && !G(r) ? ye(A(r)) : {};
|
|
172
173
|
}
|
|
173
174
|
var Te = "[object Map]";
|
|
174
175
|
function ve(r) {
|
|
175
|
-
return O(r) &&
|
|
176
|
+
return O(r) && v(r) == Te;
|
|
176
177
|
}
|
|
177
178
|
var M = y && y.isMap, me = M ? H(M) : ve;
|
|
178
179
|
const Oe = me;
|
|
179
|
-
var
|
|
180
|
-
function
|
|
181
|
-
return O(r) &&
|
|
180
|
+
var he = "[object Set]";
|
|
181
|
+
function Ae(r) {
|
|
182
|
+
return O(r) && v(r) == he;
|
|
182
183
|
}
|
|
183
|
-
var U = y && y.isSet, $e = U ? H(U) :
|
|
184
|
+
var U = y && y.isSet, $e = U ? H(U) : Ae;
|
|
184
185
|
const Se = $e;
|
|
185
186
|
var je = 1, we = 2, Pe = 4, V = "[object Arguments]", Fe = "[object Array]", Ce = "[object Boolean]", xe = "[object Date]", Le = "[object Error]", z = "[object Function]", Ie = "[object GeneratorFunction]", Ee = "[object Map]", _e = "[object Number]", k = "[object Object]", Me = "[object RegExp]", Ue = "[object Set]", Ne = "[object String]", Be = "[object Symbol]", De = "[object WeakMap]", Ge = "[object ArrayBuffer]", Ke = "[object DataView]", Re = "[object Float32Array]", He = "[object Float64Array]", qe = "[object Int8Array]", Ye = "[object Int16Array]", We = "[object Int32Array]", Je = "[object Uint8Array]", Qe = "[object Uint8ClampedArray]", Xe = "[object Uint16Array]", Ze = "[object Uint32Array]", a = {};
|
|
186
187
|
a[V] = a[Fe] = a[Ge] = a[Ke] = a[Ce] = a[xe] = a[Re] = a[He] = a[qe] = a[Ye] = a[We] = a[Ee] = a[_e] = a[k] = a[Me] = a[Ue] = a[Ne] = a[Be] = a[Je] = a[Qe] = a[Xe] = a[Ze] = !0;
|
|
@@ -189,14 +190,14 @@ function p(r, e, n, t, o, i) {
|
|
|
189
190
|
var s, u = e & je, f = e & we, nr = e & Pe;
|
|
190
191
|
if (n && (s = o ? n(r, t, o, i) : n(r)), s !== void 0)
|
|
191
192
|
return s;
|
|
192
|
-
if (!
|
|
193
|
+
if (!m(r))
|
|
193
194
|
return r;
|
|
194
195
|
var S = q(r);
|
|
195
196
|
if (S) {
|
|
196
197
|
if (s = Rr(r), !u)
|
|
197
198
|
return _r(r, s);
|
|
198
199
|
} else {
|
|
199
|
-
var g =
|
|
200
|
+
var g = v(r), j = g == z || g == Ie;
|
|
200
201
|
if (gr(r))
|
|
201
202
|
return Er(r, u);
|
|
202
203
|
if (g == k || g == V || j && !o) {
|
|
@@ -217,8 +218,8 @@ function p(r, e, n, t, o, i) {
|
|
|
217
218
|
}) : Oe(r) && r.forEach(function(c, l) {
|
|
218
219
|
s.set(l, p(c, e, n, l, r, i));
|
|
219
220
|
});
|
|
220
|
-
var tr = nr ? f ? Z : pr : f ?
|
|
221
|
-
return
|
|
221
|
+
var tr = nr ? f ? Z : pr : f ? h : D, P = S ? void 0 : tr(r);
|
|
222
|
+
return Ar(P || r, function(c, l) {
|
|
222
223
|
P && (l = c, c = r[l]), J(s, l, p(c, e, n, l, r, i));
|
|
223
224
|
}), s;
|
|
224
225
|
}
|
|
@@ -227,7 +228,7 @@ function Ve(r) {
|
|
|
227
228
|
return e ? r[e - 1] : void 0;
|
|
228
229
|
}
|
|
229
230
|
function ze(r, e) {
|
|
230
|
-
return e.length < 2 ? r : vr(r,
|
|
231
|
+
return e.length < 2 ? r : vr(r, hr(e, 0, -1));
|
|
231
232
|
}
|
|
232
233
|
function ke(r, e) {
|
|
233
234
|
return e = Y(e, r), r = ze(r, e), r == null || delete r[mr(Ve(e))];
|
|
@@ -236,7 +237,7 @@ var rn = "[object Object]", en = Function.prototype, nn = Object.prototype, rr =
|
|
|
236
237
|
function an(r) {
|
|
237
238
|
if (!O(r) || Tr(r) != rn)
|
|
238
239
|
return !1;
|
|
239
|
-
var e =
|
|
240
|
+
var e = A(r);
|
|
240
241
|
if (e === null)
|
|
241
242
|
return !0;
|
|
242
243
|
var n = tn.call(e, "constructor") && e.constructor;
|
|
@@ -314,23 +315,23 @@ function vn(r) {
|
|
|
314
315
|
}
|
|
315
316
|
var mn = vn(pn);
|
|
316
317
|
const On = mn;
|
|
317
|
-
function
|
|
318
|
+
function hn(r) {
|
|
318
319
|
return On(ln(r, void 0, fn), r + "");
|
|
319
320
|
}
|
|
320
|
-
var
|
|
321
|
+
var An = 1, $n = 2, Sn = 4, jn = hn(function(r, e) {
|
|
321
322
|
var n = {};
|
|
322
323
|
if (r == null)
|
|
323
324
|
return n;
|
|
324
325
|
var t = !1;
|
|
325
326
|
e = or(e, function(i) {
|
|
326
327
|
return i = Y(i, r), t || (t = i.length > 1), i;
|
|
327
|
-
}), b(r, Z(r), n), t && (n = p(n,
|
|
328
|
+
}), b(r, Z(r), n), t && (n = p(n, An | $n | Sn, sn));
|
|
328
329
|
for (var o = e.length; o--; )
|
|
329
330
|
ke(n, e[o]);
|
|
330
331
|
return n;
|
|
331
332
|
});
|
|
332
333
|
const wn = jn;
|
|
333
|
-
function
|
|
334
|
+
function En({
|
|
334
335
|
openingHours: r
|
|
335
336
|
}) {
|
|
336
337
|
const e = r.reduce(
|
|
@@ -344,5 +345,5 @@ function In({
|
|
|
344
345
|
return Object.values(e);
|
|
345
346
|
}
|
|
346
347
|
export {
|
|
347
|
-
|
|
348
|
+
En as default
|
|
348
349
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.51.0-check-optimizations.
|
|
3
|
+
"version": "1.51.0-check-optimizations.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -26,6 +26,11 @@
|
|
|
26
26
|
"require": "./api/getEndpointWithVersion.js",
|
|
27
27
|
"types": "./api/getEndpointWithVersion.d.ts"
|
|
28
28
|
},
|
|
29
|
+
"./api/getMediaImageClosestSize": {
|
|
30
|
+
"import": "./api/getMediaImageClosestSize.mjs",
|
|
31
|
+
"require": "./api/getMediaImageClosestSize.js",
|
|
32
|
+
"types": "./api/getMediaImageClosestSize.d.ts"
|
|
33
|
+
},
|
|
29
34
|
"./api/getUrlAndParams": {
|
|
30
35
|
"import": "./api/getUrlAndParams.mjs",
|
|
31
36
|
"require": "./api/getUrlAndParams.js",
|
|
@@ -81,6 +86,11 @@
|
|
|
81
86
|
"require": "./card/getGiftCardStatus.js",
|
|
82
87
|
"types": "./card/getGiftCardStatus.d.ts"
|
|
83
88
|
},
|
|
89
|
+
"./card/getPrepaidWalletScanReadingInfo": {
|
|
90
|
+
"import": "./card/getPrepaidWalletScanReadingInfo.mjs",
|
|
91
|
+
"require": "./card/getPrepaidWalletScanReadingInfo.js",
|
|
92
|
+
"types": "./card/getPrepaidWalletScanReadingInfo.d.ts"
|
|
93
|
+
},
|
|
84
94
|
"./card/getScannedWalletReadingInfo": {
|
|
85
95
|
"import": "./card/getScannedWalletReadingInfo.mjs",
|
|
86
96
|
"require": "./card/getScannedWalletReadingInfo.js",
|
|
@@ -661,6 +671,16 @@
|
|
|
661
671
|
"require": "./logger/types.js",
|
|
662
672
|
"types": "./logger/types.d.ts"
|
|
663
673
|
},
|
|
674
|
+
"./multilingual/createLocalizedCheckDetails": {
|
|
675
|
+
"import": "./multilingual/createLocalizedCheckDetails.mjs",
|
|
676
|
+
"require": "./multilingual/createLocalizedCheckDetails.js",
|
|
677
|
+
"types": "./multilingual/createLocalizedCheckDetails.d.ts"
|
|
678
|
+
},
|
|
679
|
+
"./multilingual": {
|
|
680
|
+
"import": "./multilingual/index.mjs",
|
|
681
|
+
"require": "./multilingual/index.js",
|
|
682
|
+
"types": "./multilingual/index.d.ts"
|
|
683
|
+
},
|
|
664
684
|
"./number": {
|
|
665
685
|
"import": "./number/index.mjs",
|
|
666
686
|
"require": "./number/index.js",
|
|
@@ -916,6 +936,11 @@
|
|
|
916
936
|
"require": "./outlet/isOutletAcceptingPreOrders.js",
|
|
917
937
|
"types": "./outlet/isOutletAcceptingPreOrders.d.ts"
|
|
918
938
|
},
|
|
939
|
+
"./outlet/isOutletAcceptingPreOrdersWhenClosed": {
|
|
940
|
+
"import": "./outlet/isOutletAcceptingPreOrdersWhenClosed.mjs",
|
|
941
|
+
"require": "./outlet/isOutletAcceptingPreOrdersWhenClosed.js",
|
|
942
|
+
"types": "./outlet/isOutletAcceptingPreOrdersWhenClosed.d.ts"
|
|
943
|
+
},
|
|
919
944
|
"./outlet/searchNextOpeningMoment": {
|
|
920
945
|
"import": "./outlet/searchNextOpeningMoment.mjs",
|
|
921
946
|
"require": "./outlet/searchNextOpeningMoment.js",
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
orderType?:
|
|
4
|
-
}
|
|
1
|
+
import { OrderType } from '@ancon/wildcat-types';
|
|
2
|
+
declare type Order = {
|
|
3
|
+
orderType?: OrderType;
|
|
4
|
+
};
|
|
5
|
+
export default function isGroupPreOrder<T extends Order>(preOrder: T): boolean;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("@ancon/wildcat-types");function o(t){return(t==null?void 0:t.orderType)===e.
|
|
1
|
+
"use strict";const e=require("@ancon/wildcat-types");function o(t){return(t==null?void 0:t.orderType)===e.OrderType.GroupPreOrder}module.exports=o;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
return (o == null ? void 0 : o.orderType) ===
|
|
1
|
+
import { OrderType as r } from "@ancon/wildcat-types";
|
|
2
|
+
function u(o) {
|
|
3
|
+
return (o == null ? void 0 : o.orderType) === r.GroupPreOrder;
|
|
4
4
|
}
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
u as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
orderType?:
|
|
4
|
-
}
|
|
1
|
+
import { OrderType } from '@ancon/wildcat-types';
|
|
2
|
+
declare type Order = {
|
|
3
|
+
orderType?: OrderType;
|
|
4
|
+
};
|
|
5
|
+
export default function isPreOrderLink<T extends Order>(preOrder: T): boolean;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const t=require("@ancon/wildcat-types");function e(i){return(i==null?void 0:i.orderType)===t.OrderType.PreOrderLink}module.exports=e;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
return (
|
|
1
|
+
import { OrderType as n } from "@ancon/wildcat-types";
|
|
2
|
+
function t(i) {
|
|
3
|
+
return (i == null ? void 0 : i.orderType) === n.PreOrderLink;
|
|
4
4
|
}
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
t as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
orderType?:
|
|
4
|
-
}
|
|
1
|
+
import { OrderType } from '@ancon/wildcat-types';
|
|
2
|
+
declare type Order = {
|
|
3
|
+
orderType?: OrderType;
|
|
4
|
+
};
|
|
5
|
+
export default function isPreOrderSharable<T extends Order>(preOrder: T): boolean;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@ancon/wildcat-types");function o(e){const r=e==null?void 0:e.orderType;return r===t.
|
|
1
|
+
"use strict";const t=require("@ancon/wildcat-types");function o(e){const r=e==null?void 0:e.orderType;return r===t.OrderType.PreOrderLink||r===t.OrderType.GroupPreOrder}module.exports=o;
|
package/signalr/SignalR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var d=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(d(r,typeof e!="symbol"?e+"":e,t),t);const h=require("@microsoft/signalr"),a=require("@ancon/wildcat-types"),l=require("../shared/wait.js"),u=require("../api/generateBackoffWithEqualJitter.js");require("../number/randomIntFromInterval.js");class g{constructor(e){n(this,"internalEvents");n(this,"signalREvents");n(this,"hubConnection");n(this,"clientId");n(this,"logger");n(this,"backoff",[]);n(this,"reconnectAttempt",0);n(this,"shouldReconnect",!0);n(this,"groups");n(this,"info",(e,t)=>{var i;(i=this.logger)==null||i.info(e,t)});n(this,"generateBackoff",()=>{this.backoff=u(50,500,5e3),this.info("Generated new backoff")});n(this,"reconnect",async()=>{if(this.shouldReconnect)try{this.info("Attempting to reconnect...",{attempt:this.reconnectAttempt+1}),await this.connect(!0),this.info("Reconnected"),this.reconnectAttempt=0}catch{if(this.backoff[this.reconnectAttempt]!=null){const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}else{this.reconnectAttempt>0&&this.info("Ran out of backoff intervals, restarting backoff..."),this.reconnectAttempt=0,this.generateBackoff();const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}this.reconnectAttempt+=1,await this.reconnect()}});n(this,"buildInitialListeners",()=>{this.hubConnection.onclose(()=>{this.groups=[],this.info("Hub connection closed"),this.emitEvent("disconnected"),this.reconnect()}),this.hubConnection.onreconnected(()=>this.emitEvent("reconnected"))});n(this,"emitEvent",(e,...t)=>{if(this.internalEvents.has(e)){this.info(`Emitting event "${e}"`);const i=this.internalEvents.get(e);i&&i.forEach(s=>s(...t))}else this.info(`Failed to emit event "${e}". There were no listeners.`)});n(this,"skipSignal",(e,t)=>{this.info(`Skipped signal "${e}"`,t)});n(this,"enhanceListener",(e,t,i)=>s=>{const o=JSON.parse(s),c=i&&o.clientId&&o.clientId===this.clientId;return c||this.info(`Received signal "${e}"`,s),c?this.skipSignal(e,s):t(o)});n(this,"setClientId",e=>{this.clientId=e});n(this,"connect",async(e=!1)=>{try{this.info("Connecting..."),await this.hubConnection.start(),this.info("Connected"),this.emitEvent("connected")}catch(t){if(this.info("Failed to connect"),e)throw t}});n(this,"disconnect",async()=>{try{this.shouldReconnect=!1,this.info("Disconnecting..."),await this.hubConnection.stop(),this.info("Disconnected"),this.emitEvent("disconnected")}catch{this.info("Failed to disconnect")}});n(this,"addEventListener",(e,t)=>{this.internalEvents.has(e)||this.internalEvents.set(e,[]);const i=this.internalEvents.get(e);return i&&i.push(t),()=>this.removeEventListener(e,t)});n(this,"removeEventListener",(e,t)=>{var i;if(this.internalEvents.has(e)){const s=this.internalEvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(s.splice(o,1),this.info(`Removed event listener for event "${e}"`)):this.info(`Failed to remove event listener for event "${e}". Specified listener was not found.`)}else this.info(`Failed to remove event listener for event "${e}". Event doesn't have any listeners.`)});n(this,"addSignalListener",(e,t,i=!0)=>{this.signalREvents.has(e)||this.signalREvents.set(e,[]);const s=this.signalREvents.get(e),o=this.enhanceListener(e,t,i);return s&&s.push(o),this.hubConnection.on(e,o),this.info(`Added signal listener for signal "${e}"`),()=>this.removeSignalListener(e,o)});n(this,"removeSignalListener",(e,t)=>{var i;if(this.signalREvents.has(e)){const s=this.signalREvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(this.hubConnection.off(e,t),s.splice(o,1),this.info(`Removed signal listener for signal "${e}"`)):this.info(`Failed to remove signal listener for signal "${e}". Specified listener was not found.`)}else this.info(`Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`)});n(this,"joinGroup",async e=>{this.info(`Joining group "${e}"...`);const t=this.groups.push(e)-1;try{await this.hubConnection.invoke(a.SignalRMethodName.JoinGroup,e),this.info(`Joined group "${e}"`)}catch(i){this.info(`Failed to join group "${e}"`,i),t>=0&&this.groups.splice(t,1)}});n(this,"leaveGroup",async e=>{this.info(`Leaving group "${e}"...`);const t=this.groups.indexOf(e);t>=0&&this.groups.splice(t,1);try{await this.hubConnection.invoke(a.SignalRMethodName.LeaveGroup,e),this.info(`Left group "${e}"`)}catch(i){this.groups.indexOf(e)<0&&this.groups.push(e),this.info(`Failed to leave group "${e}"`,i)}});n(this,"leaveAllGroups",async()=>{this.info(`Leaving all (${this.groups.length}) groups...`);const e=[...this.groups].map(t=>this.leaveGroup(t));await Promise.all(e),this.info("Left all groups")});n(this,"getHubConnectionId",()=>this.hubConnection.connectionId);this.internalEvents=new Map,this.signalREvents=new Map,this.groups=[],e.enableLogging&&(this.logger=e.logger),this.hubConnection=new h.HubConnectionBuilder().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(h.LogLevel.None).build(),this.buildInitialListeners()}}module.exports=g;
|
|
1
|
+
"use strict";var f=Object.defineProperty;var d=(r,e,t)=>e in r?f(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(d(r,typeof e!="symbol"?e+"":e,t),t);const h=require("@microsoft/signalr"),a=require("@ancon/wildcat-types"),l=require("../shared/wait.js"),u=require("../api/generateBackoffWithEqualJitter.js");require("../number/randomIntFromInterval.js");class g{constructor(e){n(this,"internalEvents");n(this,"signalREvents");n(this,"hubConnection");n(this,"clientId");n(this,"logger");n(this,"backoff",[]);n(this,"reconnectAttempt",0);n(this,"shouldReconnect",!0);n(this,"groups");n(this,"info",(e,t)=>{var i;(i=this.logger)==null||i.info(e,t)});n(this,"generateBackoff",()=>{this.backoff=u(50,500,5e3),this.info("Generated new backoff")});n(this,"reconnect",async()=>{if(this.shouldReconnect)try{this.info("Attempting to reconnect...",{attempt:this.reconnectAttempt+1}),await this.connect(!0),this.info("Reconnected"),this.reconnectAttempt=0}catch{if(this.backoff[this.reconnectAttempt]!=null){const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}else{this.reconnectAttempt>0&&this.info("Ran out of backoff intervals, restarting backoff..."),this.reconnectAttempt=0,this.generateBackoff();const t=this.backoff[this.reconnectAttempt];if(t!=null)await l(t);else throw new Error("Could not resolve ms from backoff")}this.reconnectAttempt+=1,await this.reconnect()}});n(this,"buildInitialListeners",()=>{this.hubConnection.onclose(()=>{this.groups=[],this.info("Hub connection closed"),this.emitEvent("disconnected"),this.reconnect()}),this.hubConnection.onreconnected(()=>this.emitEvent("reconnected"))});n(this,"emitEvent",(e,...t)=>{if(this.internalEvents.has(e)){this.info(`Emitting event "${e}"`);const i=this.internalEvents.get(e);i&&i.forEach(s=>s(...t))}else this.info(`Failed to emit event "${e}". There were no listeners.`)});n(this,"skipSignal",(e,t)=>{this.info(`Skipped signal "${e}"`,t)});n(this,"enhanceListener",(e,t,i)=>s=>{const o=JSON.parse(s),c=i&&o.clientId&&o.clientId===this.clientId;return c||this.info(`Received signal "${e}"`,s),c?this.skipSignal(e,s):t(o)});n(this,"setClientId",e=>{this.clientId=e});n(this,"connect",async(e=!1)=>{try{this.info("Connecting..."),await this.hubConnection.start(),this.info("Connected"),this.emitEvent("connected")}catch(t){if(this.info("Failed to connect"),e)throw t}});n(this,"disconnect",async()=>{try{this.shouldReconnect=!1,this.info("Disconnecting..."),await this.hubConnection.stop(),this.info("Disconnected"),this.emitEvent("disconnected")}catch{this.info("Failed to disconnect")}});n(this,"addEventListener",(e,t)=>{this.internalEvents.has(e)||this.internalEvents.set(e,[]);const i=this.internalEvents.get(e);return i&&i.push(t),()=>this.removeEventListener(e,t)});n(this,"removeEventListener",(e,t)=>{var i;if(this.internalEvents.has(e)){const s=this.internalEvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(s.splice(o,1),this.info(`Removed event listener for event "${e}"`)):this.info(`Failed to remove event listener for event "${e}". Specified listener was not found.`)}else this.info(`Failed to remove event listener for event "${e}". Event doesn't have any listeners.`)});n(this,"addSignalListener",(e,t,i=!0)=>{this.signalREvents.has(e)||this.signalREvents.set(e,[]);const s=this.signalREvents.get(e),o=this.enhanceListener(e,t,i);return s&&s.push(o),this.hubConnection.on(e,o),this.info(`Added signal listener for signal "${e}"`),()=>this.removeSignalListener(e,o)});n(this,"removeSignalListener",(e,t)=>{var i;if(this.signalREvents.has(e)){const s=this.signalREvents.get(e),o=((i=s==null?void 0:s.indexOf)==null?void 0:i.call(s,t))??-1;o>=0?(this.hubConnection.off(e,t),s.splice(o,1),this.info(`Removed signal listener for signal "${e}"`)):this.info(`Failed to remove signal listener for signal "${e}". Specified listener was not found.`)}else this.info(`Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`)});n(this,"joinGroup",async e=>{this.info(`Joining group "${e}"...`);const t=this.groups.push(e)-1;try{await this.hubConnection.invoke(a.SignalRMethodName.JoinGroup,e),this.info(`Joined group "${e}"`)}catch(i){this.info(`Failed to join group "${e}"`,i),t>=0&&this.groups.splice(t,1)}});n(this,"leaveGroup",async e=>{this.info(`Leaving group "${e}"...`);const t=this.groups.indexOf(e);t>=0&&this.groups.splice(t,1);try{await this.hubConnection.invoke(a.SignalRMethodName.LeaveGroup,e),this.info(`Left group "${e}"`)}catch(i){this.groups.indexOf(e)<0&&this.groups.push(e),this.info(`Failed to leave group "${e}"`,i)}});n(this,"leaveAllGroups",async()=>{this.info(`Leaving all (${this.groups.length}) groups...`);const e=[...this.groups].map(t=>this.leaveGroup(t));await Promise.all(e),this.info("Left all groups")});n(this,"getHubConnectionId",()=>this.hubConnection.connectionId);this.internalEvents=new Map,this.signalREvents=new Map,this.groups=[],e.enableLogging&&(this.logger=e.logger),this.hubConnection=new h.HubConnectionBuilder().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(h.LogLevel.None).build(),e.serverTimeoutInMilliseconds&&(this.hubConnection.serverTimeoutInMilliseconds=e.serverTimeoutInMilliseconds),this.buildInitialListeners()}}module.exports=g;
|
package/signalr/SignalR.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var f = Object.defineProperty;
|
|
2
|
-
var l = (r,
|
|
3
|
-
var n = (r,
|
|
2
|
+
var l = (r, e, t) => e in r ? f(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var n = (r, e, t) => (l(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
4
|
import { HubConnectionBuilder as d, LogLevel as u } from "@microsoft/signalr";
|
|
5
5
|
import { SignalRMethodName as h } from "@ancon/wildcat-types";
|
|
6
6
|
import a from "../shared/wait.mjs";
|
|
7
7
|
import g from "../api/generateBackoffWithEqualJitter.mjs";
|
|
8
8
|
import "../number/randomIntFromInterval.mjs";
|
|
9
9
|
class L {
|
|
10
|
-
constructor(
|
|
10
|
+
constructor(e) {
|
|
11
11
|
n(this, "internalEvents");
|
|
12
12
|
n(this, "signalREvents");
|
|
13
13
|
n(this, "hubConnection");
|
|
@@ -17,9 +17,9 @@ class L {
|
|
|
17
17
|
n(this, "reconnectAttempt", 0);
|
|
18
18
|
n(this, "shouldReconnect", !0);
|
|
19
19
|
n(this, "groups");
|
|
20
|
-
n(this, "info", (
|
|
20
|
+
n(this, "info", (e, t) => {
|
|
21
21
|
var i;
|
|
22
|
-
(i = this.logger) == null || i.info(
|
|
22
|
+
(i = this.logger) == null || i.info(e, t);
|
|
23
23
|
});
|
|
24
24
|
n(this, "generateBackoff", () => {
|
|
25
25
|
this.backoff = g(50, 500, 5e3), this.info("Generated new backoff");
|
|
@@ -32,16 +32,16 @@ class L {
|
|
|
32
32
|
}), await this.connect(!0), this.info("Reconnected"), this.reconnectAttempt = 0;
|
|
33
33
|
} catch {
|
|
34
34
|
if (this.backoff[this.reconnectAttempt] != null) {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
await a(
|
|
35
|
+
const t = this.backoff[this.reconnectAttempt];
|
|
36
|
+
if (t != null)
|
|
37
|
+
await a(t);
|
|
38
38
|
else
|
|
39
39
|
throw new Error("Could not resolve ms from backoff");
|
|
40
40
|
} else {
|
|
41
41
|
this.reconnectAttempt > 0 && this.info("Ran out of backoff intervals, restarting backoff..."), this.reconnectAttempt = 0, this.generateBackoff();
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
await a(
|
|
42
|
+
const t = this.backoff[this.reconnectAttempt];
|
|
43
|
+
if (t != null)
|
|
44
|
+
await a(t);
|
|
45
45
|
else
|
|
46
46
|
throw new Error("Could not resolve ms from backoff");
|
|
47
47
|
}
|
|
@@ -58,30 +58,30 @@ class L {
|
|
|
58
58
|
* @param event Event to emit
|
|
59
59
|
* @param args Arguments to send to the listeners
|
|
60
60
|
*/
|
|
61
|
-
n(this, "emitEvent", (
|
|
62
|
-
if (this.internalEvents.has(
|
|
63
|
-
this.info(`Emitting event "${
|
|
64
|
-
const i = this.internalEvents.get(
|
|
65
|
-
i && i.forEach((s) => s(...
|
|
61
|
+
n(this, "emitEvent", (e, ...t) => {
|
|
62
|
+
if (this.internalEvents.has(e)) {
|
|
63
|
+
this.info(`Emitting event "${e}"`);
|
|
64
|
+
const i = this.internalEvents.get(e);
|
|
65
|
+
i && i.forEach((s) => s(...t));
|
|
66
66
|
} else
|
|
67
|
-
this.info(`Failed to emit event "${
|
|
67
|
+
this.info(`Failed to emit event "${e}". There were no listeners.`);
|
|
68
68
|
});
|
|
69
|
-
n(this, "skipSignal", (
|
|
70
|
-
this.info(`Skipped signal "${
|
|
69
|
+
n(this, "skipSignal", (e, t) => {
|
|
70
|
+
this.info(`Skipped signal "${e}"`, t);
|
|
71
71
|
});
|
|
72
|
-
n(this, "enhanceListener", (
|
|
72
|
+
n(this, "enhanceListener", (e, t, i) => (s) => {
|
|
73
73
|
const o = JSON.parse(s), c = i && o.clientId && o.clientId === this.clientId;
|
|
74
|
-
return c || this.info(`Received signal "${
|
|
74
|
+
return c || this.info(`Received signal "${e}"`, s), c ? this.skipSignal(e, s) : t(o);
|
|
75
75
|
});
|
|
76
|
-
n(this, "setClientId", (
|
|
77
|
-
this.clientId =
|
|
76
|
+
n(this, "setClientId", (e) => {
|
|
77
|
+
this.clientId = e;
|
|
78
78
|
});
|
|
79
|
-
n(this, "connect", async (
|
|
79
|
+
n(this, "connect", async (e = !1) => {
|
|
80
80
|
try {
|
|
81
81
|
this.info("Connecting..."), await this.hubConnection.start(), this.info("Connected"), this.emitEvent("connected");
|
|
82
|
-
} catch (
|
|
83
|
-
if (this.info("Failed to connect"),
|
|
84
|
-
throw
|
|
82
|
+
} catch (t) {
|
|
83
|
+
if (this.info("Failed to connect"), e)
|
|
84
|
+
throw t;
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
n(this, "disconnect", async () => {
|
|
@@ -96,26 +96,26 @@ class L {
|
|
|
96
96
|
* @param event Event to listen on
|
|
97
97
|
* @param listener Event listener function
|
|
98
98
|
*/
|
|
99
|
-
n(this, "addEventListener", (
|
|
100
|
-
this.internalEvents.has(
|
|
101
|
-
const i = this.internalEvents.get(
|
|
102
|
-
return i && i.push(
|
|
99
|
+
n(this, "addEventListener", (e, t) => {
|
|
100
|
+
this.internalEvents.has(e) || this.internalEvents.set(e, []);
|
|
101
|
+
const i = this.internalEvents.get(e);
|
|
102
|
+
return i && i.push(t), () => this.removeEventListener(e, t);
|
|
103
103
|
});
|
|
104
104
|
/**
|
|
105
105
|
* Remove internal event listener
|
|
106
106
|
* @param event Event to stop listening to
|
|
107
107
|
* @param listener Event listener function
|
|
108
108
|
*/
|
|
109
|
-
n(this, "removeEventListener", (
|
|
109
|
+
n(this, "removeEventListener", (e, t) => {
|
|
110
110
|
var i;
|
|
111
|
-
if (this.internalEvents.has(
|
|
112
|
-
const s = this.internalEvents.get(
|
|
113
|
-
o >= 0 ? (s.splice(o, 1), this.info(`Removed event listener for event "${
|
|
114
|
-
`Failed to remove event listener for event "${
|
|
111
|
+
if (this.internalEvents.has(e)) {
|
|
112
|
+
const s = this.internalEvents.get(e), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, t)) ?? -1;
|
|
113
|
+
o >= 0 ? (s.splice(o, 1), this.info(`Removed event listener for event "${e}"`)) : this.info(
|
|
114
|
+
`Failed to remove event listener for event "${e}". Specified listener was not found.`
|
|
115
115
|
);
|
|
116
116
|
} else
|
|
117
117
|
this.info(
|
|
118
|
-
`Failed to remove event listener for event "${
|
|
118
|
+
`Failed to remove event listener for event "${e}". Event doesn't have any listeners.`
|
|
119
119
|
);
|
|
120
120
|
});
|
|
121
121
|
/**
|
|
@@ -123,58 +123,58 @@ class L {
|
|
|
123
123
|
* @param signal Signal name
|
|
124
124
|
* @param listener Signal listener function
|
|
125
125
|
*/
|
|
126
|
-
n(this, "addSignalListener", (
|
|
127
|
-
this.signalREvents.has(
|
|
128
|
-
const s = this.signalREvents.get(
|
|
129
|
-
t,
|
|
126
|
+
n(this, "addSignalListener", (e, t, i = !0) => {
|
|
127
|
+
this.signalREvents.has(e) || this.signalREvents.set(e, []);
|
|
128
|
+
const s = this.signalREvents.get(e), o = this.enhanceListener(
|
|
130
129
|
e,
|
|
130
|
+
t,
|
|
131
131
|
i
|
|
132
132
|
);
|
|
133
|
-
return s && s.push(o), this.hubConnection.on(
|
|
133
|
+
return s && s.push(o), this.hubConnection.on(e, o), this.info(`Added signal listener for signal "${e}"`), () => this.removeSignalListener(e, o);
|
|
134
134
|
});
|
|
135
135
|
/**
|
|
136
136
|
* Remove signal listener
|
|
137
137
|
* @param signal Signal name
|
|
138
138
|
* @param listener Signal listener function
|
|
139
139
|
*/
|
|
140
|
-
n(this, "removeSignalListener", (
|
|
140
|
+
n(this, "removeSignalListener", (e, t) => {
|
|
141
141
|
var i;
|
|
142
|
-
if (this.signalREvents.has(
|
|
143
|
-
const s = this.signalREvents.get(
|
|
144
|
-
o >= 0 ? (this.hubConnection.off(
|
|
145
|
-
`Failed to remove signal listener for signal "${
|
|
142
|
+
if (this.signalREvents.has(e)) {
|
|
143
|
+
const s = this.signalREvents.get(e), o = ((i = s == null ? void 0 : s.indexOf) == null ? void 0 : i.call(s, t)) ?? -1;
|
|
144
|
+
o >= 0 ? (this.hubConnection.off(e, t), s.splice(o, 1), this.info(`Removed signal listener for signal "${e}"`)) : this.info(
|
|
145
|
+
`Failed to remove signal listener for signal "${e}". Specified listener was not found.`
|
|
146
146
|
);
|
|
147
147
|
} else
|
|
148
148
|
this.info(
|
|
149
|
-
`Failed to remove signal listener for signal "${
|
|
149
|
+
`Failed to remove signal listener for signal "${e}". Signal doesn't have any listeners.`
|
|
150
150
|
);
|
|
151
151
|
});
|
|
152
|
-
n(this, "joinGroup", async (
|
|
153
|
-
this.info(`Joining group "${
|
|
154
|
-
const
|
|
152
|
+
n(this, "joinGroup", async (e) => {
|
|
153
|
+
this.info(`Joining group "${e}"...`);
|
|
154
|
+
const t = this.groups.push(e) - 1;
|
|
155
155
|
try {
|
|
156
|
-
await this.hubConnection.invoke(h.JoinGroup,
|
|
156
|
+
await this.hubConnection.invoke(h.JoinGroup, e), this.info(`Joined group "${e}"`);
|
|
157
157
|
} catch (i) {
|
|
158
|
-
this.info(`Failed to join group "${
|
|
158
|
+
this.info(`Failed to join group "${e}"`, i), t >= 0 && this.groups.splice(t, 1);
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
|
-
n(this, "leaveGroup", async (
|
|
162
|
-
this.info(`Leaving group "${
|
|
163
|
-
const
|
|
164
|
-
|
|
161
|
+
n(this, "leaveGroup", async (e) => {
|
|
162
|
+
this.info(`Leaving group "${e}"...`);
|
|
163
|
+
const t = this.groups.indexOf(e);
|
|
164
|
+
t >= 0 && this.groups.splice(t, 1);
|
|
165
165
|
try {
|
|
166
|
-
await this.hubConnection.invoke(h.LeaveGroup,
|
|
166
|
+
await this.hubConnection.invoke(h.LeaveGroup, e), this.info(`Left group "${e}"`);
|
|
167
167
|
} catch (i) {
|
|
168
|
-
this.groups.indexOf(
|
|
168
|
+
this.groups.indexOf(e) < 0 && this.groups.push(e), this.info(`Failed to leave group "${e}"`, i);
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
n(this, "leaveAllGroups", async () => {
|
|
172
172
|
this.info(`Leaving all (${this.groups.length}) groups...`);
|
|
173
|
-
const
|
|
174
|
-
await Promise.all(
|
|
173
|
+
const e = [...this.groups].map((t) => this.leaveGroup(t));
|
|
174
|
+
await Promise.all(e), this.info("Left all groups");
|
|
175
175
|
});
|
|
176
176
|
n(this, "getHubConnectionId", () => this.hubConnection.connectionId);
|
|
177
|
-
this.internalEvents = /* @__PURE__ */ new Map(), this.signalREvents = /* @__PURE__ */ new Map(), this.groups = [],
|
|
177
|
+
this.internalEvents = /* @__PURE__ */ new Map(), this.signalREvents = /* @__PURE__ */ new Map(), this.groups = [], e.enableLogging && (this.logger = e.logger), this.hubConnection = new d().withUrl(`${e.signalRApiUrl}/${e.hub}`).configureLogging(u.None).build(), e.serverTimeoutInMilliseconds && (this.hubConnection.serverTimeoutInMilliseconds = e.serverTimeoutInMilliseconds), this.buildInitialListeners();
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
export {
|
package/signalr/types.d.ts
CHANGED