akeyless-client-commons 1.1.48 → 1.1.50

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.
@@ -1284,6 +1284,18 @@ var SocketService = /*#__PURE__*/ function() {
1284
1284
  return cb();
1285
1285
  });
1286
1286
  });
1287
+ this.socket.io.on("close", function(reason) {
1288
+ console.log("Socket Manager close:", reason);
1289
+ _this.disconnectCallbacks.forEach(function(cb) {
1290
+ return cb();
1291
+ });
1292
+ });
1293
+ this.socket.io.engine.on("close", function(reason) {
1294
+ console.log("Socket Engine close:", reason);
1295
+ _this.disconnectCallbacks.forEach(function(cb) {
1296
+ return cb();
1297
+ });
1298
+ });
1287
1299
  this.socket.on("session", function(param) {
1288
1300
  var session_id = param.session_id;
1289
1301
  if (session_id) {
@@ -1388,6 +1400,7 @@ var SocketService = /*#__PURE__*/ function() {
1388
1400
  value: function disconnectSocket() {
1389
1401
  if (this.socket) {
1390
1402
  this.socket.disconnect();
1403
+ this.socket.io.engine.close();
1391
1404
  }
1392
1405
  }
1393
1406
  },
@@ -1062,6 +1062,18 @@ var SocketService = /*#__PURE__*/ function() {
1062
1062
  return cb();
1063
1063
  });
1064
1064
  });
1065
+ this.socket.io.on("close", function(reason) {
1066
+ console.log("Socket Manager close:", reason);
1067
+ _this.disconnectCallbacks.forEach(function(cb) {
1068
+ return cb();
1069
+ });
1070
+ });
1071
+ this.socket.io.engine.on("close", function(reason) {
1072
+ console.log("Socket Engine close:", reason);
1073
+ _this.disconnectCallbacks.forEach(function(cb) {
1074
+ return cb();
1075
+ });
1076
+ });
1065
1077
  this.socket.on("session", function(param) {
1066
1078
  var session_id = param.session_id;
1067
1079
  if (session_id) {
@@ -1166,6 +1178,7 @@ var SocketService = /*#__PURE__*/ function() {
1166
1178
  value: function disconnectSocket() {
1167
1179
  if (this.socket) {
1168
1180
  this.socket.disconnect();
1181
+ this.socket.io.engine.close();
1169
1182
  }
1170
1183
  }
1171
1184
  },
@@ -2714,6 +2714,18 @@ var SocketService = /*#__PURE__*/ function() {
2714
2714
  return cb();
2715
2715
  });
2716
2716
  });
2717
+ this.socket.io.on("close", function(reason) {
2718
+ console.log("Socket Manager close:", reason);
2719
+ _this.disconnectCallbacks.forEach(function(cb) {
2720
+ return cb();
2721
+ });
2722
+ });
2723
+ this.socket.io.engine.on("close", function(reason) {
2724
+ console.log("Socket Engine close:", reason);
2725
+ _this.disconnectCallbacks.forEach(function(cb) {
2726
+ return cb();
2727
+ });
2728
+ });
2717
2729
  this.socket.on("session", function(param) {
2718
2730
  var session_id = param.session_id;
2719
2731
  if (session_id) {
@@ -2818,6 +2830,7 @@ var SocketService = /*#__PURE__*/ function() {
2818
2830
  value: function disconnectSocket() {
2819
2831
  if (this.socket) {
2820
2832
  this.socket.disconnect();
2833
+ this.socket.io.engine.close();
2821
2834
  }
2822
2835
  }
2823
2836
  },
@@ -2332,6 +2332,18 @@ var SocketService = /*#__PURE__*/ function() {
2332
2332
  return cb();
2333
2333
  });
2334
2334
  });
2335
+ this.socket.io.on("close", function(reason) {
2336
+ console.log("Socket Manager close:", reason);
2337
+ _this.disconnectCallbacks.forEach(function(cb) {
2338
+ return cb();
2339
+ });
2340
+ });
2341
+ this.socket.io.engine.on("close", function(reason) {
2342
+ console.log("Socket Engine close:", reason);
2343
+ _this.disconnectCallbacks.forEach(function(cb) {
2344
+ return cb();
2345
+ });
2346
+ });
2335
2347
  this.socket.on("session", function(param) {
2336
2348
  var session_id = param.session_id;
2337
2349
  if (session_id) {
@@ -2436,6 +2448,7 @@ var SocketService = /*#__PURE__*/ function() {
2436
2448
  value: function disconnectSocket() {
2437
2449
  if (this.socket) {
2438
2450
  this.socket.disconnect();
2451
+ this.socket.io.engine.close();
2439
2452
  }
2440
2453
  }
2441
2454
  },
@@ -90,9 +90,6 @@ interface UseDbSnapshotsSettings {
90
90
  disableLogs?: boolean;
91
91
  worker?: UseWebWorkerOptions;
92
92
  socket?: {
93
- onDisconnect?: (unsubscribe: () => void) => void;
94
- onConnect?: (unsubscribe: () => void) => void;
95
- callback?: () => void;
96
93
  getSocket?: (socket: typeof socketServiceInstance) => void;
97
94
  };
98
95
  }
@@ -90,9 +90,6 @@ interface UseDbSnapshotsSettings {
90
90
  disableLogs?: boolean;
91
91
  worker?: UseWebWorkerOptions;
92
92
  socket?: {
93
- onDisconnect?: (unsubscribe: () => void) => void;
94
- onConnect?: (unsubscribe: () => void) => void;
95
- callback?: () => void;
96
93
  getSocket?: (socket: typeof socketServiceInstance) => void;
97
94
  };
98
95
  }
@@ -699,6 +699,18 @@ var SocketService = /*#__PURE__*/ function() {
699
699
  return cb();
700
700
  });
701
701
  });
702
+ this.socket.io.on("close", function(reason) {
703
+ console.log("Socket Manager close:", reason);
704
+ _this.disconnectCallbacks.forEach(function(cb) {
705
+ return cb();
706
+ });
707
+ });
708
+ this.socket.io.engine.on("close", function(reason) {
709
+ console.log("Socket Engine close:", reason);
710
+ _this.disconnectCallbacks.forEach(function(cb) {
711
+ return cb();
712
+ });
713
+ });
702
714
  this.socket.on("session", function(param) {
703
715
  var session_id = param.session_id;
704
716
  if (session_id) {
@@ -803,6 +815,7 @@ var SocketService = /*#__PURE__*/ function() {
803
815
  value: function disconnectSocket() {
804
816
  if (this.socket) {
805
817
  this.socket.disconnect();
818
+ this.socket.io.engine.close();
806
819
  }
807
820
  }
808
821
  },
@@ -1555,7 +1568,7 @@ var useSocketSnapshots = function(configs, label, settings) {
1555
1568
  });
1556
1569
  };
1557
1570
  useDeepCompareEffect(function() {
1558
- var _offConnectRef_current, _offDisconnectRef_current, _settings_socket_callback, _settings_socket, _settings_socket_getSocket, _settings_socket1;
1571
+ var _offConnectRef_current, _offDisconnectRef_current;
1559
1572
  if (!auth.currentUser) {
1560
1573
  return;
1561
1574
  }
@@ -1623,14 +1636,11 @@ var useSocketSnapshots = function(configs, label, settings) {
1623
1636
  (_offConnectRef_current = offConnectRef.current) === null || _offConnectRef_current === void 0 ? void 0 : _offConnectRef_current.call(offConnectRef);
1624
1637
  (_offDisconnectRef_current = offDisconnectRef.current) === null || _offDisconnectRef_current === void 0 ? void 0 : _offDisconnectRef_current.call(offDisconnectRef);
1625
1638
  offConnectRef.current = socketServiceInstance.onConnect(function() {
1626
- var _settings_socket_onConnect, _settings_socket;
1627
1639
  setSocketConnected(true);
1628
1640
  socketStarted.current = false;
1629
1641
  subscribe();
1630
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_onConnect = _settings_socket.onConnect) === null || _settings_socket_onConnect === void 0 ? void 0 : _settings_socket_onConnect.call(_settings_socket, offConnectRef.current);
1631
1642
  });
1632
1643
  offDisconnectRef.current = socketServiceInstance.onDisconnect(function() {
1633
- var _settings_socket_onDisconnect, _settings_socket;
1634
1644
  setSocketConnected(false);
1635
1645
  cleanupSubscriptionsRef.current.forEach(function(cleanup) {
1636
1646
  return cleanup();
@@ -1638,10 +1648,7 @@ var useSocketSnapshots = function(configs, label, settings) {
1638
1648
  cleanupSubscriptionsRef.current = [];
1639
1649
  activeSubscriptionKeyRef.current = null;
1640
1650
  activeCollectionsRef.current = /* @__PURE__ */ new Set();
1641
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_onDisconnect = _settings_socket.onDisconnect) === null || _settings_socket_onDisconnect === void 0 ? void 0 : _settings_socket_onDisconnect.call(_settings_socket, offDisconnectRef.current);
1642
1651
  });
1643
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_callback = _settings_socket.callback) === null || _settings_socket_callback === void 0 ? void 0 : _settings_socket_callback.call(_settings_socket);
1644
- settings === null || settings === void 0 ? void 0 : (_settings_socket1 = settings.socket) === null || _settings_socket1 === void 0 ? void 0 : (_settings_socket_getSocket = _settings_socket1.getSocket) === null || _settings_socket_getSocket === void 0 ? void 0 : _settings_socket_getSocket.call(_settings_socket1, socketServiceInstance);
1645
1652
  if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
1646
1653
  return function() {
1647
1654
  var _offConnectRef_current, _offDisconnectRef_current;
@@ -1665,6 +1672,8 @@ var useSocketSnapshots = function(configs, label, settings) {
1665
1672
  (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.uid
1666
1673
  ]);
1667
1674
  (0, import_react5.useEffect)(function() {
1675
+ var _settings_socket_getSocket, _settings_socket;
1676
+ settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_getSocket = _settings_socket.getSocket) === null || _settings_socket_getSocket === void 0 ? void 0 : _settings_socket_getSocket.call(_settings_socket, socketServiceInstance);
1668
1677
  return function() {
1669
1678
  var _offConnectRef_current, _offDisconnectRef_current;
1670
1679
  cleanupSubscriptionsRef.current.forEach(function(cleanup) {
@@ -602,6 +602,18 @@ var SocketService = /*#__PURE__*/ function() {
602
602
  return cb();
603
603
  });
604
604
  });
605
+ this.socket.io.on("close", function(reason) {
606
+ console.log("Socket Manager close:", reason);
607
+ _this.disconnectCallbacks.forEach(function(cb) {
608
+ return cb();
609
+ });
610
+ });
611
+ this.socket.io.engine.on("close", function(reason) {
612
+ console.log("Socket Engine close:", reason);
613
+ _this.disconnectCallbacks.forEach(function(cb) {
614
+ return cb();
615
+ });
616
+ });
605
617
  this.socket.on("session", function(param) {
606
618
  var session_id = param.session_id;
607
619
  if (session_id) {
@@ -706,6 +718,7 @@ var SocketService = /*#__PURE__*/ function() {
706
718
  value: function disconnectSocket() {
707
719
  if (this.socket) {
708
720
  this.socket.disconnect();
721
+ this.socket.io.engine.close();
709
722
  }
710
723
  }
711
724
  },
@@ -1458,7 +1471,7 @@ var useSocketSnapshots = function(configs, label, settings) {
1458
1471
  });
1459
1472
  };
1460
1473
  useDeepCompareEffect(function() {
1461
- var _offConnectRef_current, _offDisconnectRef_current, _settings_socket_callback, _settings_socket, _settings_socket_getSocket, _settings_socket1;
1474
+ var _offConnectRef_current, _offDisconnectRef_current;
1462
1475
  if (!auth.currentUser) {
1463
1476
  return;
1464
1477
  }
@@ -1526,14 +1539,11 @@ var useSocketSnapshots = function(configs, label, settings) {
1526
1539
  (_offConnectRef_current = offConnectRef.current) === null || _offConnectRef_current === void 0 ? void 0 : _offConnectRef_current.call(offConnectRef);
1527
1540
  (_offDisconnectRef_current = offDisconnectRef.current) === null || _offDisconnectRef_current === void 0 ? void 0 : _offDisconnectRef_current.call(offDisconnectRef);
1528
1541
  offConnectRef.current = socketServiceInstance.onConnect(function() {
1529
- var _settings_socket_onConnect, _settings_socket;
1530
1542
  setSocketConnected(true);
1531
1543
  socketStarted.current = false;
1532
1544
  subscribe();
1533
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_onConnect = _settings_socket.onConnect) === null || _settings_socket_onConnect === void 0 ? void 0 : _settings_socket_onConnect.call(_settings_socket, offConnectRef.current);
1534
1545
  });
1535
1546
  offDisconnectRef.current = socketServiceInstance.onDisconnect(function() {
1536
- var _settings_socket_onDisconnect, _settings_socket;
1537
1547
  setSocketConnected(false);
1538
1548
  cleanupSubscriptionsRef.current.forEach(function(cleanup) {
1539
1549
  return cleanup();
@@ -1541,10 +1551,7 @@ var useSocketSnapshots = function(configs, label, settings) {
1541
1551
  cleanupSubscriptionsRef.current = [];
1542
1552
  activeSubscriptionKeyRef.current = null;
1543
1553
  activeCollectionsRef.current = /* @__PURE__ */ new Set();
1544
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_onDisconnect = _settings_socket.onDisconnect) === null || _settings_socket_onDisconnect === void 0 ? void 0 : _settings_socket_onDisconnect.call(_settings_socket, offDisconnectRef.current);
1545
1554
  });
1546
- settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_callback = _settings_socket.callback) === null || _settings_socket_callback === void 0 ? void 0 : _settings_socket_callback.call(_settings_socket);
1547
- settings === null || settings === void 0 ? void 0 : (_settings_socket1 = settings.socket) === null || _settings_socket1 === void 0 ? void 0 : (_settings_socket_getSocket = _settings_socket1.getSocket) === null || _settings_socket_getSocket === void 0 ? void 0 : _settings_socket_getSocket.call(_settings_socket1, socketServiceInstance);
1548
1555
  if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
1549
1556
  return function() {
1550
1557
  var _offConnectRef_current, _offDisconnectRef_current;
@@ -1568,6 +1575,8 @@ var useSocketSnapshots = function(configs, label, settings) {
1568
1575
  (_auth_currentUser = auth.currentUser) === null || _auth_currentUser === void 0 ? void 0 : _auth_currentUser.uid
1569
1576
  ]);
1570
1577
  useEffect4(function() {
1578
+ var _settings_socket_getSocket, _settings_socket;
1579
+ settings === null || settings === void 0 ? void 0 : (_settings_socket = settings.socket) === null || _settings_socket === void 0 ? void 0 : (_settings_socket_getSocket = _settings_socket.getSocket) === null || _settings_socket_getSocket === void 0 ? void 0 : _settings_socket_getSocket.call(_settings_socket, socketServiceInstance);
1571
1580
  return function() {
1572
1581
  var _offConnectRef_current, _offDisconnectRef_current;
1573
1582
  cleanupSubscriptionsRef.current.forEach(function(cleanup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.48",
3
+ "version": "1.1.50",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",