@ancon/wildcat-utils 1.50.21 → 1.50.23
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/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 +21 -20
- 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/{identity-cf449299.mjs → identity-41198897.mjs} +1 -1
- package/{identity-2a048185.js → identity-58f9497d.js} +1 -1
- package/index.js +1 -1
- package/index.mjs +372 -371
- package/isObject-361bd834.js +1 -0
- package/isObject-b8638513.mjs +7 -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.js +1 -1
- package/outlet/index.mjs +71 -70
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +29 -28
- package/package.json +6 -1
- package/signalr/SignalR.js +1 -1
- package/signalr/SignalR.mjs +1 -1
- package/_baseIteratee-ae97e42e.js +0 -1
- package/_getTag-d4cd1660.js +0 -1
|
@@ -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.50.
|
|
3
|
+
"version": "1.50.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -81,6 +81,11 @@
|
|
|
81
81
|
"require": "./card/getGiftCardStatus.js",
|
|
82
82
|
"types": "./card/getGiftCardStatus.d.ts"
|
|
83
83
|
},
|
|
84
|
+
"./card/getPrepaidWalletScanReadingInfo": {
|
|
85
|
+
"import": "./card/getPrepaidWalletScanReadingInfo.mjs",
|
|
86
|
+
"require": "./card/getPrepaidWalletScanReadingInfo.js",
|
|
87
|
+
"types": "./card/getPrepaidWalletScanReadingInfo.d.ts"
|
|
88
|
+
},
|
|
84
89
|
"./card/getScannedWalletReadingInfo": {
|
|
85
90
|
"import": "./card/getScannedWalletReadingInfo.mjs",
|
|
86
91
|
"require": "./card/getScannedWalletReadingInfo.js",
|
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(),this.hubConnection.serverTimeoutInMilliseconds=6e4,this.buildInitialListeners()}}module.exports=g;
|
package/signalr/SignalR.mjs
CHANGED
|
@@ -174,7 +174,7 @@ class L {
|
|
|
174
174
|
await Promise.all(t), 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 = [], t.enableLogging && (this.logger = t.logger), this.hubConnection = new d().withUrl(`${t.signalRApiUrl}/${t.hub}`).configureLogging(u.None).build(), this.buildInitialListeners();
|
|
177
|
+
this.internalEvents = /* @__PURE__ */ new Map(), this.signalREvents = /* @__PURE__ */ new Map(), this.groups = [], t.enableLogging && (this.logger = t.logger), this.hubConnection = new d().withUrl(`${t.signalRApiUrl}/${t.hub}`).configureLogging(u.None).build(), this.hubConnection.serverTimeoutInMilliseconds = 6e4, this.buildInitialListeners();
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
export {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const a=require("./_getTag-d4cd1660.js"),I=require("./_baseIsEqual-ad544573.js"),u=require("./identity-2a048185.js"),O=require("./isObjectLike-963267e9.js");var R=1,_=2;function o(n,r,e,i){var t=e.length,s=t,l=!i;if(n==null)return!s;for(n=Object(n);t--;){var f=e[t];if(l&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++t<s;){f=e[t];var A=f[0],g=n[A],h=f[1];if(l&&f[2]){if(g===void 0&&!(A in n))return!1}else{var d=new a.Stack;if(i)var E=i(g,h,A,n,r,d);if(!(E===void 0?I.baseIsEqual(h,g,R|_,i,d):E))return!1}}return!0}function P(n){return n===n&&!a.isObject(n)}function L(n){for(var r=a.keys(n),e=r.length;e--;){var i=r[e],t=n[i];r[e]=[i,t,P(t)]}return r}function y(n,r){return function(e){return e==null?!1:e[n]===r&&(r!==void 0||n in Object(e))}}function M(n){var r=L(n);return r.length==1&&r[0][2]?y(r[0][0],r[0][1]):function(e){return e===n||o(e,n,r)}}function q(n,r,e){var i=n==null?void 0:u.baseGet(n,r);return i===void 0?e:i}function C(n,r){return n!=null&&r in Object(n)}function G(n,r,e){r=u.castPath(r,n);for(var i=-1,t=r.length,s=!1;++i<t;){var l=u.toKey(r[i]);if(!(s=n!=null&&e(n,l)))break;n=n[l]}return s||++i!=t?s:(t=n==null?0:n.length,!!t&&a.isLength(t)&&a.isIndex(l,t)&&(O.isArray(n)||a.isArguments(n)))}function w(n,r){return n!=null&&G(n,r,C)}var D=1,K=2;function c(n,r){return u.isKey(n)&&P(r)?y(u.toKey(n),r):function(e){var i=q(e,n);return i===void 0&&i===r?w(e,n):I.baseIsEqual(r,i,D|K)}}function F(n){return function(r){return r==null?void 0:r[n]}}function v(n){return function(r){return u.baseGet(r,n)}}function x(n){return u.isKey(n)?F(u.toKey(n)):v(n)}function S(n){return typeof n=="function"?n:n==null?u.identity:typeof n=="object"?O.isArray(n)?c(n[0],n[1]):M(n):x(n)}exports.baseIteratee=S;
|
package/_getTag-d4cd1660.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("./isObjectLike-963267e9.js");function x(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ut="[object AsyncFunction]",pt="[object Function]",ft="[object GeneratorFunction]",ht="[object Proxy]";function H(t){if(!x(t))return!1;var e=o.baseGetTag(t);return e==pt||e==ft||e==ut||e==ht}var lt=o.root["__core-js_shared__"];const m=lt;var E=function(){var t=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function gt(t){return!!E&&E in t}var yt=Function.prototype,_t=yt.toString;function f(t){if(t!=null){try{return _t.call(t)}catch{}try{return t+""}catch{}}return""}var dt=/[\\^$.*+?()[\]{}|]/g,bt=/^\[object .+?Constructor\]$/,vt=Function.prototype,jt=Object.prototype,Tt=vt.toString,At=jt.hasOwnProperty,$t=RegExp("^"+Tt.call(At).replace(dt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mt(t){if(!x(t)||gt(t))return!1;var e=H(t)?$t:bt;return e.test(f(t))}function wt(t,e){return t==null?void 0:t[e]}function h(t,e){var r=wt(t,e);return mt(r)?r:void 0}var Ot=h(Object,"create");const b=Ot;function St(){this.__data__=b?b(null):{},this.size=0}function Pt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ct="__lodash_hash_undefined__",xt=Object.prototype,It=xt.hasOwnProperty;function Et(t){var e=this.__data__;if(b){var r=e[t];return r===Ct?void 0:r}return It.call(e,t)?e[t]:void 0}var zt=Object.prototype,Mt=zt.hasOwnProperty;function Dt(t){var e=this.__data__;return b?e[t]!==void 0:Mt.call(e,t)}var Gt="__lodash_hash_undefined__";function Ut(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=b&&e===void 0?Gt:e,this}function p(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}p.prototype.clear=St;p.prototype.delete=Pt;p.prototype.get=Et;p.prototype.has=Dt;p.prototype.set=Ut;function Ft(){this.__data__=[],this.size=0}function k(t,e){return t===e||t!==t&&e!==e}function T(t,e){for(var r=t.length;r--;)if(k(t[r][0],e))return r;return-1}var Lt=Array.prototype,Bt=Lt.splice;function Kt(t){var e=this.__data__,r=T(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():Bt.call(e,r,1),--this.size,!0}function Nt(t){var e=this.__data__,r=T(e,t);return r<0?void 0:e[r][1]}function Ht(t){return T(this.__data__,t)>-1}function kt(t,e){var r=this.__data__,a=T(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}function i(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}i.prototype.clear=Ft;i.prototype.delete=Kt;i.prototype.get=Nt;i.prototype.has=Ht;i.prototype.set=kt;var Rt=h(o.root,"Map");const v=Rt;function Vt(){this.size=0,this.__data__={hash:new p,map:new(v||i),string:new p}}function qt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function A(t,e){var r=t.__data__;return qt(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Wt(t){var e=A(this,t).delete(t);return this.size-=e?1:0,e}function Jt(t){return A(this,t).get(t)}function Xt(t){return A(this,t).has(t)}function Yt(t,e){var r=A(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}function l(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}l.prototype.clear=Vt;l.prototype.delete=Wt;l.prototype.get=Jt;l.prototype.has=Xt;l.prototype.set=Yt;function Zt(){this.__data__=new i,this.size=0}function Qt(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function te(t){return this.__data__.get(t)}function ee(t){return this.__data__.has(t)}var re=200;function ae(t,e){var r=this.__data__;if(r instanceof i){var a=r.__data__;if(!v||a.length<re-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new l(a)}return r.set(t,e),this.size=r.size,this}function g(t){var e=this.__data__=new i(t);this.size=e.size}g.prototype.clear=Zt;g.prototype.delete=Qt;g.prototype.get=te;g.prototype.has=ee;g.prototype.set=ae;var ne=o.root.Uint8Array;const oe=ne;function R(t,e){for(var r=-1,a=e.length,c=t.length;++r<a;)t[c+r]=e[r];return t}function V(t,e,r){var a=e(t);return o.isArray(t)?a:R(a,r(t))}function se(t,e){for(var r=-1,a=t==null?0:t.length,c=0,y=[];++r<a;){var _=t[r];e(_,r,t)&&(y[c++]=_)}return y}function q(){return[]}var ie=Object.prototype,ce=ie.propertyIsEnumerable,z=Object.getOwnPropertySymbols,ue=z?function(t){return t==null?[]:(t=Object(t),se(z(t),function(e){return ce.call(t,e)}))}:q;const W=ue;function pe(t,e){for(var r=-1,a=Array(t);++r<t;)a[r]=e(r);return a}var fe="[object Arguments]";function M(t){return o.isObjectLike(t)&&o.baseGetTag(t)==fe}var J=Object.prototype,he=J.hasOwnProperty,le=J.propertyIsEnumerable,ge=M(function(){return arguments}())?M:function(t){return o.isObjectLike(t)&&he.call(t,"callee")&&!le.call(t,"callee")};const X=ge;function ye(){return!1}var Y=typeof exports=="object"&&exports&&!exports.nodeType&&exports,D=Y&&typeof module=="object"&&module&&!module.nodeType&&module,_e=D&&D.exports===Y,G=_e?o.root.Buffer:void 0,de=G?G.isBuffer:void 0,be=de||ye;const Z=be;var ve=9007199254740991,je=/^(?:0|[1-9]\d*)$/;function Q(t,e){var r=typeof t;return e=e??ve,!!e&&(r=="number"||r!="symbol"&&je.test(t))&&t>-1&&t%1==0&&t<e}var Te=9007199254740991;function I(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Te}var Ae="[object Arguments]",$e="[object Array]",me="[object Boolean]",we="[object Date]",Oe="[object Error]",Se="[object Function]",Pe="[object Map]",Ce="[object Number]",xe="[object Object]",Ie="[object RegExp]",Ee="[object Set]",ze="[object String]",Me="[object WeakMap]",De="[object ArrayBuffer]",Ge="[object DataView]",Ue="[object Float32Array]",Fe="[object Float64Array]",Le="[object Int8Array]",Be="[object Int16Array]",Ke="[object Int32Array]",Ne="[object Uint8Array]",He="[object Uint8ClampedArray]",ke="[object Uint16Array]",Re="[object Uint32Array]",n={};n[Ue]=n[Fe]=n[Le]=n[Be]=n[Ke]=n[Ne]=n[He]=n[ke]=n[Re]=!0;n[Ae]=n[$e]=n[De]=n[me]=n[Ge]=n[we]=n[Oe]=n[Se]=n[Pe]=n[Ce]=n[xe]=n[Ie]=n[Ee]=n[ze]=n[Me]=!1;function Ve(t){return o.isObjectLike(t)&&I(t.length)&&!!n[o.baseGetTag(t)]}function tt(t){return function(e){return t(e)}}var et=typeof exports=="object"&&exports&&!exports.nodeType&&exports,d=et&&typeof module=="object"&&module&&!module.nodeType&&module,qe=d&&d.exports===et,w=qe&&o.freeGlobal.process,We=function(){try{var t=d&&d.require&&d.require("util").types;return t||w&&w.binding&&w.binding("util")}catch{}}();const O=We;var U=O&&O.isTypedArray,Je=U?tt(U):Ve;const rt=Je;var Xe=Object.prototype,Ye=Xe.hasOwnProperty;function at(t,e){var r=o.isArray(t),a=!r&&X(t),c=!r&&!a&&Z(t),y=!r&&!a&&!c&&rt(t),_=r||a||c||y,$=_?pe(t.length,String):[],ct=$.length;for(var s in t)(e||Ye.call(t,s))&&!(_&&(s=="length"||c&&(s=="offset"||s=="parent")||y&&(s=="buffer"||s=="byteLength"||s=="byteOffset")||Q(s,ct)))&&$.push(s);return $}var Ze=Object.prototype;function nt(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ze;return t===r}function ot(t,e){return function(r){return t(e(r))}}var Qe=ot(Object.keys,Object);const tr=Qe;var er=Object.prototype,rr=er.hasOwnProperty;function ar(t){if(!nt(t))return tr(t);var e=[];for(var r in Object(t))rr.call(t,r)&&r!="constructor"&&e.push(r);return e}function st(t){return t!=null&&I(t.length)&&!H(t)}function it(t){return st(t)?at(t):ar(t)}function nr(t){return V(t,it,W)}var or=h(o.root,"DataView");const S=or;var sr=h(o.root,"Promise");const P=sr;var ir=h(o.root,"Set");const j=ir;var cr=h(o.root,"WeakMap");const C=cr;var F="[object Map]",ur="[object Object]",L="[object Promise]",B="[object Set]",K="[object WeakMap]",N="[object DataView]",pr=f(S),fr=f(v),hr=f(P),lr=f(j),gr=f(C),u=o.baseGetTag;(S&&u(new S(new ArrayBuffer(1)))!=N||v&&u(new v)!=F||P&&u(P.resolve())!=L||j&&u(new j)!=B||C&&u(new C)!=K)&&(u=function(t){var e=o.baseGetTag(t),r=e==ur?t.constructor:void 0,a=r?f(r):"";if(a)switch(a){case pr:return N;case fr:return F;case hr:return L;case lr:return B;case gr:return K}return e});const yr=u;exports.MapCache=l;exports.Set=j;exports.Stack=g;exports.Uint8Array=oe;exports.arrayLikeKeys=at;exports.arrayPush=R;exports.baseGetAllKeys=V;exports.baseUnary=tt;exports.eq=k;exports.getAllKeys=nr;exports.getNative=h;exports.getSymbols=W;exports.getTag=yr;exports.isArguments=X;exports.isArrayLike=st;exports.isBuffer=Z;exports.isIndex=Q;exports.isLength=I;exports.isObject=x;exports.isPrototype=nt;exports.isTypedArray=rt;exports.keys=it;exports.nodeUtil=O;exports.overArg=ot;exports.stubArray=q;
|