akeyless-client-commons 1.1.9 → 1.1.11

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.
@@ -6,6 +6,7 @@ import { WhereFilterOp, Unsubscribe, Firestore, CollectionReference, DocumentDat
6
6
  import { TObject, NxUser, CountryOptions, LanguageOptions, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
7
7
  import React, { Dispatch, SetStateAction } from 'react';
8
8
  import { ClassValue } from 'clsx';
9
+ import { Socket } from 'socket.io-client';
9
10
 
10
11
  type SetState<T> = (updater: ((prev: T) => T) | T) => void;
11
12
  type AppName = "installer" | "toolbox" | "dashboard";
@@ -274,7 +275,7 @@ declare class SocketService {
274
275
  private initSocket;
275
276
  private constructor();
276
277
  static getInstance(): SocketService;
277
- private getSocketInstance;
278
+ getSocketInstance(): Socket;
278
279
  subscribeToCollections(config: OnSnapshotConfig[]): () => void;
279
280
  setData<UpdateType extends RedisUpdateType, DataType = any>(payload: RedisUpdatePayload<UpdateType, DataType>): Promise<SocketCallbackResponse>;
280
281
  getCollectionData<T>(payload: Omit<GetDataPayload<T>, "key">): void;
@@ -6,6 +6,7 @@ import { WhereFilterOp, Unsubscribe, Firestore, CollectionReference, DocumentDat
6
6
  import { TObject, NxUser, CountryOptions, LanguageOptions, UserPermissionsObject, userPermissionsObjectValue, Client, RedisUpdateType, RedisUpdatePayload, SocketCallbackResponse } from 'akeyless-types-commons';
7
7
  import React, { Dispatch, SetStateAction } from 'react';
8
8
  import { ClassValue } from 'clsx';
9
+ import { Socket } from 'socket.io-client';
9
10
 
10
11
  type SetState<T> = (updater: ((prev: T) => T) | T) => void;
11
12
  type AppName = "installer" | "toolbox" | "dashboard";
@@ -274,7 +275,7 @@ declare class SocketService {
274
275
  private initSocket;
275
276
  private constructor();
276
277
  static getInstance(): SocketService;
277
- private getSocketInstance;
278
+ getSocketInstance(): Socket;
278
279
  subscribeToCollections(config: OnSnapshotConfig[]): () => void;
279
280
  setData<UpdateType extends RedisUpdateType, DataType = any>(payload: RedisUpdatePayload<UpdateType, DataType>): Promise<SocketCallbackResponse>;
280
281
  getCollectionData<T>(payload: Omit<GetDataPayload<T>, "key">): void;
@@ -1065,7 +1065,7 @@ var useSmartSnapshot = function(configs, options) {
1065
1065
  return setCacheCollectionsConfig(null);
1066
1066
  };
1067
1067
  }, []);
1068
- var groupedConfig = useDeepCompareMemo(function() {
1068
+ var groupedConfig = (0, import_react6.useMemo)(function() {
1069
1069
  if (!cacheCollectionsConfig) {
1070
1070
  return {
1071
1071
  configForDb: [],
@@ -1091,10 +1091,10 @@ var useSmartSnapshot = function(configs, options) {
1091
1091
  cacheCollectionsConfig
1092
1092
  ]);
1093
1093
  useSnapshotBulk(groupedConfig.configForDb, options === null || options === void 0 ? void 0 : options.label, options === null || options === void 0 ? void 0 : options.settings);
1094
- useSocketSubscription(groupedConfig.configForCache);
1094
+ var socketConnected = useSocketSubscription(groupedConfig.configForCache).socketConnected;
1095
1095
  return {
1096
1096
  groupedConfig: groupedConfig,
1097
- socketConnected: socketServiceInstance.isConnected()
1097
+ socketConnected: socketConnected
1098
1098
  };
1099
1099
  };
1100
1100
  // Annotate the CommonJS export names for ESM import in node:
@@ -930,7 +930,7 @@ var useSetUserCountry = function(setUserCountry, changLang) {
930
930
  // src/hooks/WebWorker.ts
931
931
  import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef3 } from "react";
932
932
  // src/hooks/socket.ts
933
- import { useEffect as useEffect4, useState } from "react";
933
+ import { useEffect as useEffect4, useMemo as useMemo2, useState } from "react";
934
934
  var useSocketSubscription = function(config) {
935
935
  var _useState = _sliced_to_array(useState(socketServiceInstance.isConnected()), 2), socketConnected = _useState[0], setSocketConnected = _useState[1];
936
936
  useDeepCompareEffect(function() {
@@ -971,7 +971,7 @@ var useSmartSnapshot = function(configs, options) {
971
971
  return setCacheCollectionsConfig(null);
972
972
  };
973
973
  }, []);
974
- var groupedConfig = useDeepCompareMemo(function() {
974
+ var groupedConfig = useMemo2(function() {
975
975
  if (!cacheCollectionsConfig) {
976
976
  return {
977
977
  configForDb: [],
@@ -997,10 +997,10 @@ var useSmartSnapshot = function(configs, options) {
997
997
  cacheCollectionsConfig
998
998
  ]);
999
999
  useSnapshotBulk(groupedConfig.configForDb, options === null || options === void 0 ? void 0 : options.label, options === null || options === void 0 ? void 0 : options.settings);
1000
- useSocketSubscription(groupedConfig.configForCache);
1000
+ var socketConnected = useSocketSubscription(groupedConfig.configForCache).socketConnected;
1001
1001
  return {
1002
1002
  groupedConfig: groupedConfig,
1003
- socketConnected: socketServiceInstance.isConnected()
1003
+ socketConnected: socketConnected
1004
1004
  };
1005
1005
  };
1006
1006
  export { useDeepCompareEffect, useDeepCompareMemo, useDocumentTitle, useSafeEffect, useSetUserCountry, useSmartSnapshot, useSnapshotBulk, useSocketSubscription };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",