akeyless-client-commons 1.1.17-test.8 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +6 -300
- package/dist/components/index.mjs +6 -300
- package/dist/helpers/index.d.mts +3 -42
- package/dist/helpers/index.d.ts +3 -42
- package/dist/helpers/index.js +0 -331
- package/dist/helpers/index.mjs +1 -320
- package/dist/hooks/index.d.mts +1 -20
- package/dist/hooks/index.d.ts +1 -20
- package/dist/hooks/index.js +15 -549
- package/dist/hooks/index.mjs +12 -538
- package/dist/types/index.d.mts +0 -2
- package/dist/types/index.d.ts +0 -2
- package/package.json +2 -5
package/dist/helpers/index.mjs
CHANGED
|
@@ -39,25 +39,6 @@ function _async_to_generator(fn) {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function _class_call_check(instance, Constructor) {
|
|
43
|
-
if (!(instance instanceof Constructor)) {
|
|
44
|
-
throw new TypeError("Cannot call a class as a function");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function _defineProperties(target, props) {
|
|
48
|
-
for(var i = 0; i < props.length; i++){
|
|
49
|
-
var descriptor = props[i];
|
|
50
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
51
|
-
descriptor.configurable = true;
|
|
52
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
53
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
57
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
58
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
59
|
-
return Constructor;
|
|
60
|
-
}
|
|
61
42
|
function _define_property(obj, key, value) {
|
|
62
43
|
if (key in obj) {
|
|
63
44
|
Object.defineProperty(obj, key, {
|
|
@@ -1846,8 +1827,6 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
1846
1827
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
1847
1828
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
1848
1829
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
1849
|
-
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
1850
|
-
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
1851
1830
|
var akeylessOnlineDomain = mode === "qa" ? "https://akeyless-online.xyz" : "https://akeyless-online.info";
|
|
1852
1831
|
var nxApiCall = /*#__PURE__*/ function() {
|
|
1853
1832
|
var _ref = _async_to_generator(function(serverName, method, url, data) {
|
|
@@ -1878,12 +1857,6 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
1878
1857
|
case "call-center-geo":
|
|
1879
1858
|
urlResult = "".concat(callCenterGeoDomain, "/").concat(url);
|
|
1880
1859
|
break;
|
|
1881
|
-
case "data-socket":
|
|
1882
|
-
urlResult = "".concat(dataSocketDomain, "/").concat(url);
|
|
1883
|
-
break;
|
|
1884
|
-
case "data-sync":
|
|
1885
|
-
urlResult = "".concat(dataSyncDomain, "/").concat(url);
|
|
1886
|
-
break;
|
|
1887
1860
|
default:
|
|
1888
1861
|
break;
|
|
1889
1862
|
}
|
|
@@ -1933,297 +1906,5 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
1933
1906
|
return _ref.apply(this, arguments);
|
|
1934
1907
|
};
|
|
1935
1908
|
}();
|
|
1936
|
-
|
|
1937
|
-
import { io } from "socket.io-client";
|
|
1938
|
-
var SocketService = /*#__PURE__*/ function() {
|
|
1939
|
-
"use strict";
|
|
1940
|
-
function _SocketService() {
|
|
1941
|
-
_class_call_check(this, _SocketService);
|
|
1942
|
-
this.socket = null;
|
|
1943
|
-
this.connectCallbacks = [];
|
|
1944
|
-
this.disconnectCallbacks = [];
|
|
1945
|
-
this.authToken = null;
|
|
1946
|
-
}
|
|
1947
|
-
_create_class(_SocketService, [
|
|
1948
|
-
{
|
|
1949
|
-
/// Initialize the socket connection
|
|
1950
|
-
key: "initSocket",
|
|
1951
|
-
value: function initSocket() {
|
|
1952
|
-
var _this = this;
|
|
1953
|
-
if (!this.socket) {
|
|
1954
|
-
var socketUrl = isLocal ? "http://localhost:9009" : mode === "qa" ? "https://nx-api.xyz" : "https://nx-api.info";
|
|
1955
|
-
this.socket = io(socketUrl, {
|
|
1956
|
-
path: "/api/data-socket/connect",
|
|
1957
|
-
transports: [
|
|
1958
|
-
"websocket"
|
|
1959
|
-
],
|
|
1960
|
-
auth: this.authToken ? {
|
|
1961
|
-
token: this.authToken
|
|
1962
|
-
} : void 0
|
|
1963
|
-
});
|
|
1964
|
-
this.socket.on("connect", function() {
|
|
1965
|
-
var _this_socket;
|
|
1966
|
-
console.log("Socket connected:", (_this_socket = _this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.id);
|
|
1967
|
-
});
|
|
1968
|
-
this.connectCallbacks.forEach(function(cb) {
|
|
1969
|
-
return cb();
|
|
1970
|
-
});
|
|
1971
|
-
this.socket.on("disconnect", function(reason) {
|
|
1972
|
-
console.log("Socket disconnected:", reason);
|
|
1973
|
-
_this.disconnectCallbacks.forEach(function(cb) {
|
|
1974
|
-
return cb();
|
|
1975
|
-
});
|
|
1976
|
-
});
|
|
1977
|
-
this.socket.on("connect_error", function(error) {
|
|
1978
|
-
console.error("Socket connection error:", error);
|
|
1979
|
-
});
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
},
|
|
1983
|
-
{
|
|
1984
|
-
/// get socket instance
|
|
1985
|
-
key: "getSocketInstance",
|
|
1986
|
-
value: function getSocketInstance() {
|
|
1987
|
-
if (!this.socket) {
|
|
1988
|
-
this.initSocket();
|
|
1989
|
-
}
|
|
1990
|
-
if (!this.socket) {
|
|
1991
|
-
throw new Error("Socket not initialized");
|
|
1992
|
-
}
|
|
1993
|
-
if (!this.socket.connected) {
|
|
1994
|
-
this.socket.connect();
|
|
1995
|
-
}
|
|
1996
|
-
return this.socket;
|
|
1997
|
-
}
|
|
1998
|
-
},
|
|
1999
|
-
{
|
|
2000
|
-
/// subscribe to collections
|
|
2001
|
-
key: "subscribeToCollections",
|
|
2002
|
-
value: function subscribeToCollections(config) {
|
|
2003
|
-
if (config.length === 0) {
|
|
2004
|
-
return function() {};
|
|
2005
|
-
}
|
|
2006
|
-
var s = this.getSocketInstance();
|
|
2007
|
-
var collectionsNames = config.map(function(c) {
|
|
2008
|
-
return c.collectionName;
|
|
2009
|
-
});
|
|
2010
|
-
var eventHandlers = [];
|
|
2011
|
-
config.forEach(function(configuration) {
|
|
2012
|
-
var collectionName = configuration.collectionName, onAdd = configuration.onAdd, onFirstTime = configuration.onFirstTime, onModify = configuration.onModify, onRemove = configuration.onRemove, extraParsers = configuration.extraParsers, conditions = configuration.conditions, orderBy2 = configuration.orderBy;
|
|
2013
|
-
s.on("initial:".concat(collectionName), onFirstTime);
|
|
2014
|
-
eventHandlers.push({
|
|
2015
|
-
eventName: "initial:".concat(collectionName),
|
|
2016
|
-
handler: onFirstTime
|
|
2017
|
-
});
|
|
2018
|
-
s.on("add:".concat(collectionName), onAdd);
|
|
2019
|
-
eventHandlers.push({
|
|
2020
|
-
eventName: "add:".concat(collectionName),
|
|
2021
|
-
handler: onAdd
|
|
2022
|
-
});
|
|
2023
|
-
s.on("update:".concat(collectionName), onModify);
|
|
2024
|
-
eventHandlers.push({
|
|
2025
|
-
eventName: "update:".concat(collectionName),
|
|
2026
|
-
handler: onModify
|
|
2027
|
-
});
|
|
2028
|
-
s.on("delete:".concat(collectionName), onRemove);
|
|
2029
|
-
eventHandlers.push({
|
|
2030
|
-
eventName: "delete:".concat(collectionName),
|
|
2031
|
-
handler: onRemove
|
|
2032
|
-
});
|
|
2033
|
-
extraParsers === null || extraParsers === void 0 ? void 0 : extraParsers.forEach(function(parsers) {
|
|
2034
|
-
var extraOnAdd = parsers.onAdd, extraOnFirstTime = parsers.onFirstTime, extraOnModify = parsers.onModify, extraOnRemove = parsers.onRemove;
|
|
2035
|
-
s.on("initial:".concat(collectionName), extraOnFirstTime);
|
|
2036
|
-
eventHandlers.push({
|
|
2037
|
-
eventName: "initial:".concat(collectionName),
|
|
2038
|
-
handler: extraOnFirstTime
|
|
2039
|
-
});
|
|
2040
|
-
s.on("add:".concat(collectionName), extraOnAdd);
|
|
2041
|
-
eventHandlers.push({
|
|
2042
|
-
eventName: "add:".concat(collectionName),
|
|
2043
|
-
handler: extraOnAdd
|
|
2044
|
-
});
|
|
2045
|
-
s.on("update:".concat(collectionName), extraOnModify);
|
|
2046
|
-
eventHandlers.push({
|
|
2047
|
-
eventName: "update:".concat(collectionName),
|
|
2048
|
-
handler: extraOnModify
|
|
2049
|
-
});
|
|
2050
|
-
s.on("delete:".concat(collectionName), extraOnRemove);
|
|
2051
|
-
eventHandlers.push({
|
|
2052
|
-
eventName: "delete:".concat(collectionName),
|
|
2053
|
-
handler: extraOnRemove
|
|
2054
|
-
});
|
|
2055
|
-
});
|
|
2056
|
-
});
|
|
2057
|
-
s.emit("subscribe_collections", collectionsNames, function(callback) {
|
|
2058
|
-
if (callback.success) {
|
|
2059
|
-
console.log("Successfully subscribed to: ".concat(collectionsNames.join(", ")));
|
|
2060
|
-
} else {
|
|
2061
|
-
console.error("Failed to subscribe to ".concat(config.join(", "), ": ").concat(callback.message));
|
|
2062
|
-
}
|
|
2063
|
-
});
|
|
2064
|
-
return function() {
|
|
2065
|
-
console.log("Cleaning up subscriptions for: ".concat(collectionsNames.join(", ")));
|
|
2066
|
-
s.emit("unsubscribe_collections", collectionsNames);
|
|
2067
|
-
eventHandlers.forEach(function(eh) {
|
|
2068
|
-
s.off(eh.eventName, eh.handler);
|
|
2069
|
-
});
|
|
2070
|
-
};
|
|
2071
|
-
}
|
|
2072
|
-
},
|
|
2073
|
-
{
|
|
2074
|
-
/// set data
|
|
2075
|
-
key: "setData",
|
|
2076
|
-
value: function setData(payload) {
|
|
2077
|
-
var s = this.getSocketInstance();
|
|
2078
|
-
return new Promise(function(resolve, reject) {
|
|
2079
|
-
s.emit("set_data", payload, function(callback) {
|
|
2080
|
-
if (callback.success) {
|
|
2081
|
-
console.log("Data saved successfully:", payload);
|
|
2082
|
-
console.log("ack", callback);
|
|
2083
|
-
resolve(callback);
|
|
2084
|
-
} else {
|
|
2085
|
-
reject(new Error(callback.message || "Save operation failed"));
|
|
2086
|
-
}
|
|
2087
|
-
});
|
|
2088
|
-
});
|
|
2089
|
-
}
|
|
2090
|
-
},
|
|
2091
|
-
{
|
|
2092
|
-
/// get data
|
|
2093
|
-
key: "getCollectionData",
|
|
2094
|
-
value: function getCollectionData(payload) {
|
|
2095
|
-
var s = this.getSocketInstance();
|
|
2096
|
-
s.emit("get_data", {
|
|
2097
|
-
collection_name: payload.collection_name
|
|
2098
|
-
}, function(socketCallback) {
|
|
2099
|
-
if (socketCallback.success && socketCallback.data) {
|
|
2100
|
-
payload.callback(socketCallback.data);
|
|
2101
|
-
} else {
|
|
2102
|
-
payload.callback(payload.defaultValue);
|
|
2103
|
-
}
|
|
2104
|
-
});
|
|
2105
|
-
}
|
|
2106
|
-
},
|
|
2107
|
-
{
|
|
2108
|
-
key: "getDocumentData",
|
|
2109
|
-
value: function getDocumentData(payload) {
|
|
2110
|
-
var s = this.getSocketInstance();
|
|
2111
|
-
s.emit("get_data", {
|
|
2112
|
-
collection_name: payload.collection_name,
|
|
2113
|
-
key: payload.key
|
|
2114
|
-
}, function(socketCallback) {
|
|
2115
|
-
if (socketCallback.success && socketCallback.data) {
|
|
2116
|
-
payload.callback(socketCallback.data);
|
|
2117
|
-
} else {
|
|
2118
|
-
payload.callback(payload.defaultValue);
|
|
2119
|
-
}
|
|
2120
|
-
});
|
|
2121
|
-
}
|
|
2122
|
-
},
|
|
2123
|
-
{
|
|
2124
|
-
/// delete data
|
|
2125
|
-
key: "deleteData",
|
|
2126
|
-
value: function deleteData(payload) {
|
|
2127
|
-
var s = this.getSocketInstance();
|
|
2128
|
-
return new Promise(function(resolve, reject) {
|
|
2129
|
-
s.emit("delete_data", payload, function(callback) {
|
|
2130
|
-
if (callback.success) {
|
|
2131
|
-
console.log("Data deleted successfully:", payload);
|
|
2132
|
-
console.log("delete ack", callback);
|
|
2133
|
-
resolve(callback);
|
|
2134
|
-
} else {
|
|
2135
|
-
reject(new Error(callback.message || "Delete operation failed"));
|
|
2136
|
-
}
|
|
2137
|
-
});
|
|
2138
|
-
});
|
|
2139
|
-
}
|
|
2140
|
-
},
|
|
2141
|
-
{
|
|
2142
|
-
key: "clearAllRedisData",
|
|
2143
|
-
value: function clearAllRedisData() {
|
|
2144
|
-
var s = this.getSocketInstance();
|
|
2145
|
-
return new Promise(function(resolve, reject) {
|
|
2146
|
-
s.emit("clear_all_redis_data", function(ack) {
|
|
2147
|
-
if (ack.success) {
|
|
2148
|
-
resolve(ack);
|
|
2149
|
-
} else {
|
|
2150
|
-
reject(new Error(ack.message || "Clear all Redis data operation failed"));
|
|
2151
|
-
}
|
|
2152
|
-
});
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
},
|
|
2156
|
-
{
|
|
2157
|
-
/// connection management methods
|
|
2158
|
-
key: "onConnect",
|
|
2159
|
-
value: function onConnect(callback) {
|
|
2160
|
-
var _this_socket;
|
|
2161
|
-
this.connectCallbacks.push(callback);
|
|
2162
|
-
if ((_this_socket = this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.connected) {
|
|
2163
|
-
callback();
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2166
|
-
},
|
|
2167
|
-
{
|
|
2168
|
-
key: "offConnect",
|
|
2169
|
-
value: function offConnect(callback) {
|
|
2170
|
-
this.connectCallbacks = this.connectCallbacks.filter(function(cb) {
|
|
2171
|
-
return cb !== callback;
|
|
2172
|
-
});
|
|
2173
|
-
}
|
|
2174
|
-
},
|
|
2175
|
-
{
|
|
2176
|
-
key: "onDisconnect",
|
|
2177
|
-
value: function onDisconnect(callback) {
|
|
2178
|
-
this.disconnectCallbacks.push(callback);
|
|
2179
|
-
if (this.socket && !this.socket.connected) {
|
|
2180
|
-
callback();
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
},
|
|
2184
|
-
{
|
|
2185
|
-
key: "offDisconnect",
|
|
2186
|
-
value: function offDisconnect(callback) {
|
|
2187
|
-
this.disconnectCallbacks = this.disconnectCallbacks.filter(function(cb) {
|
|
2188
|
-
return cb !== callback;
|
|
2189
|
-
});
|
|
2190
|
-
}
|
|
2191
|
-
},
|
|
2192
|
-
{
|
|
2193
|
-
key: "isConnected",
|
|
2194
|
-
value: function isConnected() {
|
|
2195
|
-
var _this_socket;
|
|
2196
|
-
return ((_this_socket = this.socket) === null || _this_socket === void 0 ? void 0 : _this_socket.connected) || false;
|
|
2197
|
-
}
|
|
2198
|
-
},
|
|
2199
|
-
{
|
|
2200
|
-
key: "setAuthToken",
|
|
2201
|
-
value: function setAuthToken(token) {
|
|
2202
|
-
this.authToken = token;
|
|
2203
|
-
if (this.socket) {
|
|
2204
|
-
this.socket.auth = {
|
|
2205
|
-
token: token
|
|
2206
|
-
};
|
|
2207
|
-
if (this.socket.connected) {
|
|
2208
|
-
this.socket.disconnect();
|
|
2209
|
-
}
|
|
2210
|
-
this.socket.connect();
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
|
-
], [
|
|
2215
|
-
{
|
|
2216
|
-
key: "getInstance",
|
|
2217
|
-
value: function getInstance() {
|
|
2218
|
-
if (!_SocketService.instance) {
|
|
2219
|
-
_SocketService.instance = new _SocketService();
|
|
2220
|
-
}
|
|
2221
|
-
return _SocketService.instance;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
]);
|
|
2225
|
-
return _SocketService;
|
|
2226
|
-
}();
|
|
2227
|
-
var socketServiceInstance = SocketService.getInstance();
|
|
2228
|
-
export { addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createSelectors, dataSocketDomain, dataSyncDomain, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, socketServiceInstance, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
1909
|
+
export { addAuditRecord, addLoginAudit, add_document, addressRegex, akeylessOnlineDomain, app, appCheck, auth, baseDomain, biDomain, calculateBearing, callCenterEventsDomain, callCenterGeoDomain, carsRegex, chartsRegex, checkUserPermissions, cleanNxSites, cn, collections, colorRegex, createSelectors, db, delete_document, devicesDomain, displayFormatPhoneNumber, durationToSeconds, emailRegex, extractAlertsData, extractBoardsData, extractCanbusData, extractCarsData, extractClientData, extractLocationData, extractSiteData, fire_base_TIME_TEMP, formatCarNumber, getAddressByGeo, getFixedNumber, getFormCheckboxValue, getFormElementValue, getLocationUrl, getUserByEmail, getUserByIdentifier, getUserByPhone, getUserCountryByIp, get_all_documents, get_document_by_id, get_international_phone_number, googleLoginProvider, handleChange, handleInvalid, handlePaste, initializeUserPermissions, international_israel_phone_format, isInternational, isInternationalIsraelPhone, isLocal, isNodeEnv, is_iccid, local_israel_phone_format, mode, multiStringFormat, notificationsDomain, numbersOnlyRegex, numbersRegex, nxApiCall, parseMultiSelectInput, parsePermissions, parseSnapshotAsArray, priceRegex, propsAreEqual, query_document, query_document_by_conditions, query_documents, query_documents_by_conditions, renderOnce, secondsToDuration, setFormElementValue, setState, set_document, simpleExtractData, snapshot, snapshotDocument, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
2229
1910
|
//# sourceMappingURL=index.mjs.map
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -22,8 +22,6 @@ interface OnSnapshotConfig extends OnSnapshotParsers {
|
|
|
22
22
|
fieldName: string;
|
|
23
23
|
direction: "asc" | "desc";
|
|
24
24
|
}[];
|
|
25
|
-
parseAs?: "object" | "array";
|
|
26
|
-
subscribeTo?: "cache" | "db";
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
declare const useDocumentTitle: (title: string) => any;
|
|
@@ -31,27 +29,10 @@ declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string, set
|
|
|
31
29
|
cleanupForConfigChange?: boolean;
|
|
32
30
|
disableLogs?: boolean;
|
|
33
31
|
}) => void;
|
|
34
|
-
declare const useSmartSnapshot: (configs: OnSnapshotConfig[], label?: string, settings?: {
|
|
35
|
-
cleanupForConfigChange?: boolean;
|
|
36
|
-
disableLogs?: boolean;
|
|
37
|
-
}) => {
|
|
38
|
-
groupedConfig: {
|
|
39
|
-
configForDb: OnSnapshotConfig[];
|
|
40
|
-
configForCache: OnSnapshotConfig[];
|
|
41
|
-
};
|
|
42
|
-
socketConnected: boolean;
|
|
43
|
-
};
|
|
44
32
|
declare const useSetUserCountry: (setUserCountry: Dispatch<SetStateAction<CountryOptions>>, changLang: (lang: string) => void) => any;
|
|
45
33
|
|
|
46
34
|
declare function useSafeEffect(callback: () => void, dependencies: any[], error_message?: string): void;
|
|
47
35
|
declare const useDeepCompareMemo: <T>(factory: () => T, dependencies: any[]) => T;
|
|
48
36
|
declare function useDeepCompareEffect(effect: EffectCallback, dependencies: any[]): void;
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
cleanupForConfigChange?: boolean;
|
|
52
|
-
disableLogs?: boolean;
|
|
53
|
-
}) => {
|
|
54
|
-
socketConnected: boolean;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export { useDeepCompareEffect, useDeepCompareMemo, useDocumentTitle, useSafeEffect, useSetUserCountry, useSmartSnapshot, useSnapshotBulk, useSocketSubscription };
|
|
38
|
+
export { useDeepCompareEffect, useDeepCompareMemo, useDocumentTitle, useSafeEffect, useSetUserCountry, useSnapshotBulk };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -22,8 +22,6 @@ interface OnSnapshotConfig extends OnSnapshotParsers {
|
|
|
22
22
|
fieldName: string;
|
|
23
23
|
direction: "asc" | "desc";
|
|
24
24
|
}[];
|
|
25
|
-
parseAs?: "object" | "array";
|
|
26
|
-
subscribeTo?: "cache" | "db";
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
declare const useDocumentTitle: (title: string) => any;
|
|
@@ -31,27 +29,10 @@ declare const useSnapshotBulk: (configs: OnSnapshotConfig[], label?: string, set
|
|
|
31
29
|
cleanupForConfigChange?: boolean;
|
|
32
30
|
disableLogs?: boolean;
|
|
33
31
|
}) => void;
|
|
34
|
-
declare const useSmartSnapshot: (configs: OnSnapshotConfig[], label?: string, settings?: {
|
|
35
|
-
cleanupForConfigChange?: boolean;
|
|
36
|
-
disableLogs?: boolean;
|
|
37
|
-
}) => {
|
|
38
|
-
groupedConfig: {
|
|
39
|
-
configForDb: OnSnapshotConfig[];
|
|
40
|
-
configForCache: OnSnapshotConfig[];
|
|
41
|
-
};
|
|
42
|
-
socketConnected: boolean;
|
|
43
|
-
};
|
|
44
32
|
declare const useSetUserCountry: (setUserCountry: Dispatch<SetStateAction<CountryOptions>>, changLang: (lang: string) => void) => any;
|
|
45
33
|
|
|
46
34
|
declare function useSafeEffect(callback: () => void, dependencies: any[], error_message?: string): void;
|
|
47
35
|
declare const useDeepCompareMemo: <T>(factory: () => T, dependencies: any[]) => T;
|
|
48
36
|
declare function useDeepCompareEffect(effect: EffectCallback, dependencies: any[]): void;
|
|
49
37
|
|
|
50
|
-
|
|
51
|
-
cleanupForConfigChange?: boolean;
|
|
52
|
-
disableLogs?: boolean;
|
|
53
|
-
}) => {
|
|
54
|
-
socketConnected: boolean;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export { useDeepCompareEffect, useDeepCompareMemo, useDocumentTitle, useSafeEffect, useSetUserCountry, useSmartSnapshot, useSnapshotBulk, useSocketSubscription };
|
|
38
|
+
export { useDeepCompareEffect, useDeepCompareMemo, useDocumentTitle, useSafeEffect, useSetUserCountry, useSnapshotBulk };
|