akeyless-client-commons 1.1.12 → 1.1.14
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 +4 -4
- package/dist/components/index.mjs +4 -4
- package/dist/helpers/index.d.mts +4 -2
- package/dist/helpers/index.d.ts +4 -2
- package/dist/helpers/index.js +18 -4
- package/dist/helpers/index.mjs +11 -5
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +26 -20
- package/dist/hooks/index.mjs +27 -21
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1189,6 +1189,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
1189
1189
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
1190
1190
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
1191
1191
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
1192
|
+
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
1193
|
+
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
1192
1194
|
// src/helpers/socket.ts
|
|
1193
1195
|
var import_socket = require("socket.io-client");
|
|
1194
1196
|
var SocketService = /*#__PURE__*/ function() {
|
|
@@ -1206,10 +1208,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
1206
1208
|
value: function initSocket() {
|
|
1207
1209
|
var _this = this;
|
|
1208
1210
|
if (!this.socket) {
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
this.socket = (0, import_socket.io)(SOCKET_SERVER_URL, {
|
|
1212
|
-
path: SOCKET_PATH,
|
|
1211
|
+
this.socket = (0, import_socket.io)(dataSocketDomain, {
|
|
1212
|
+
path: "/connect",
|
|
1213
1213
|
transports: [
|
|
1214
1214
|
"websocket"
|
|
1215
1215
|
]
|
|
@@ -967,6 +967,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
967
967
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
968
968
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
969
969
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
970
|
+
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
971
|
+
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
970
972
|
// src/helpers/socket.ts
|
|
971
973
|
import { io } from "socket.io-client";
|
|
972
974
|
var SocketService = /*#__PURE__*/ function() {
|
|
@@ -984,10 +986,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
984
986
|
value: function initSocket() {
|
|
985
987
|
var _this = this;
|
|
986
988
|
if (!this.socket) {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
this.socket = io(SOCKET_SERVER_URL, {
|
|
990
|
-
path: SOCKET_PATH,
|
|
989
|
+
this.socket = io(dataSocketDomain, {
|
|
990
|
+
path: "/connect",
|
|
991
991
|
transports: [
|
|
992
992
|
"websocket"
|
|
993
993
|
]
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -243,9 +243,11 @@ declare const biDomain: string;
|
|
|
243
243
|
declare const notificationsDomain: string;
|
|
244
244
|
declare const callCenterGeoDomain: string;
|
|
245
245
|
declare const callCenterEventsDomain: string;
|
|
246
|
+
declare const dataSocketDomain: string;
|
|
247
|
+
declare const dataSyncDomain: string;
|
|
246
248
|
declare const akeylessOnlineDomain: string;
|
|
247
249
|
type Method = "GET" | "POST" | "PUT" | "DELETE";
|
|
248
|
-
type ServerName = "devices" | "bi" | "call-center-geo" | "call-center-events" | "notifications";
|
|
250
|
+
type ServerName = "devices" | "bi" | "call-center-geo" | "call-center-events" | "notifications" | "data-socket" | "data-sync";
|
|
249
251
|
declare const nxApiCall: (serverName: ServerName, method: Method, url: string, data?: TObject<any>) => Promise<any>;
|
|
250
252
|
|
|
251
253
|
declare const checkUserPermissions: <T extends keyof UserPermissionsObject>(userPermissions: UserPermissionsObject, entity: T, permissions?: userPermissionsObjectValue<T>[], mode?: "some" | "every") => boolean;
|
|
@@ -293,4 +295,4 @@ declare class SocketService {
|
|
|
293
295
|
}
|
|
294
296
|
declare const socketServiceInstance: SocketService;
|
|
295
297
|
|
|
296
|
-
export { type ValidationType, 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, socketServiceInstance, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
298
|
+
export { type ValidationType, 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 };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -243,9 +243,11 @@ declare const biDomain: string;
|
|
|
243
243
|
declare const notificationsDomain: string;
|
|
244
244
|
declare const callCenterGeoDomain: string;
|
|
245
245
|
declare const callCenterEventsDomain: string;
|
|
246
|
+
declare const dataSocketDomain: string;
|
|
247
|
+
declare const dataSyncDomain: string;
|
|
246
248
|
declare const akeylessOnlineDomain: string;
|
|
247
249
|
type Method = "GET" | "POST" | "PUT" | "DELETE";
|
|
248
|
-
type ServerName = "devices" | "bi" | "call-center-geo" | "call-center-events" | "notifications";
|
|
250
|
+
type ServerName = "devices" | "bi" | "call-center-geo" | "call-center-events" | "notifications" | "data-socket" | "data-sync";
|
|
249
251
|
declare const nxApiCall: (serverName: ServerName, method: Method, url: string, data?: TObject<any>) => Promise<any>;
|
|
250
252
|
|
|
251
253
|
declare const checkUserPermissions: <T extends keyof UserPermissionsObject>(userPermissions: UserPermissionsObject, entity: T, permissions?: userPermissionsObjectValue<T>[], mode?: "some" | "every") => boolean;
|
|
@@ -293,4 +295,4 @@ declare class SocketService {
|
|
|
293
295
|
}
|
|
294
296
|
declare const socketServiceInstance: SocketService;
|
|
295
297
|
|
|
296
|
-
export { type ValidationType, 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, socketServiceInstance, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
298
|
+
export { type ValidationType, 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 };
|
package/dist/helpers/index.js
CHANGED
|
@@ -387,6 +387,12 @@ __export(index_exports, {
|
|
|
387
387
|
createSelectors: function() {
|
|
388
388
|
return createSelectors;
|
|
389
389
|
},
|
|
390
|
+
dataSocketDomain: function() {
|
|
391
|
+
return dataSocketDomain;
|
|
392
|
+
},
|
|
393
|
+
dataSyncDomain: function() {
|
|
394
|
+
return dataSyncDomain;
|
|
395
|
+
},
|
|
390
396
|
db: function() {
|
|
391
397
|
return db;
|
|
392
398
|
},
|
|
@@ -2204,6 +2210,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
2204
2210
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
2205
2211
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
2206
2212
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
2213
|
+
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
2214
|
+
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
2207
2215
|
var akeylessOnlineDomain = mode === "qa" ? "https://akeyless-online.xyz" : "https://akeyless-online.info";
|
|
2208
2216
|
var nxApiCall = /*#__PURE__*/ function() {
|
|
2209
2217
|
var _ref = _async_to_generator(function(serverName, method, url, data) {
|
|
@@ -2234,6 +2242,12 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2234
2242
|
case "call-center-geo":
|
|
2235
2243
|
urlResult = "".concat(callCenterGeoDomain, "/").concat(url);
|
|
2236
2244
|
break;
|
|
2245
|
+
case "data-socket":
|
|
2246
|
+
urlResult = "".concat(dataSocketDomain, "/").concat(url);
|
|
2247
|
+
break;
|
|
2248
|
+
case "data-sync":
|
|
2249
|
+
urlResult = "".concat(dataSyncDomain, "/").concat(url);
|
|
2250
|
+
break;
|
|
2237
2251
|
default:
|
|
2238
2252
|
break;
|
|
2239
2253
|
}
|
|
@@ -2300,10 +2314,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
2300
2314
|
value: function initSocket() {
|
|
2301
2315
|
var _this = this;
|
|
2302
2316
|
if (!this.socket) {
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
this.socket = (0, import_socket.io)(SOCKET_SERVER_URL, {
|
|
2306
|
-
path: SOCKET_PATH,
|
|
2317
|
+
this.socket = (0, import_socket.io)(dataSocketDomain, {
|
|
2318
|
+
path: "/connect",
|
|
2307
2319
|
transports: [
|
|
2308
2320
|
"websocket"
|
|
2309
2321
|
]
|
|
@@ -2577,6 +2589,8 @@ var socketServiceInstance = SocketService.getInstance();
|
|
|
2577
2589
|
collections: collections,
|
|
2578
2590
|
colorRegex: colorRegex,
|
|
2579
2591
|
createSelectors: createSelectors,
|
|
2592
|
+
dataSocketDomain: dataSocketDomain,
|
|
2593
|
+
dataSyncDomain: dataSyncDomain,
|
|
2580
2594
|
db: db,
|
|
2581
2595
|
delete_document: delete_document,
|
|
2582
2596
|
devicesDomain: devicesDomain,
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1846,6 +1846,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
1846
1846
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
1847
1847
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
1848
1848
|
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";
|
|
1849
1851
|
var akeylessOnlineDomain = mode === "qa" ? "https://akeyless-online.xyz" : "https://akeyless-online.info";
|
|
1850
1852
|
var nxApiCall = /*#__PURE__*/ function() {
|
|
1851
1853
|
var _ref = _async_to_generator(function(serverName, method, url, data) {
|
|
@@ -1876,6 +1878,12 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
1876
1878
|
case "call-center-geo":
|
|
1877
1879
|
urlResult = "".concat(callCenterGeoDomain, "/").concat(url);
|
|
1878
1880
|
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;
|
|
1879
1887
|
default:
|
|
1880
1888
|
break;
|
|
1881
1889
|
}
|
|
@@ -1942,10 +1950,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
1942
1950
|
value: function initSocket() {
|
|
1943
1951
|
var _this = this;
|
|
1944
1952
|
if (!this.socket) {
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
this.socket = io(SOCKET_SERVER_URL, {
|
|
1948
|
-
path: SOCKET_PATH,
|
|
1953
|
+
this.socket = io(dataSocketDomain, {
|
|
1954
|
+
path: "/connect",
|
|
1949
1955
|
transports: [
|
|
1950
1956
|
"websocket"
|
|
1951
1957
|
]
|
|
@@ -2196,5 +2202,5 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
2196
2202
|
return _SocketService;
|
|
2197
2203
|
}();
|
|
2198
2204
|
var socketServiceInstance = SocketService.getInstance();
|
|
2199
|
-
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, socketServiceInstance, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
2205
|
+
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 };
|
|
2200
2206
|
//# sourceMappingURL=index.mjs.map
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -36,8 +36,8 @@ declare const useSmartSnapshot: (configs: OnSnapshotConfig[], label?: string, se
|
|
|
36
36
|
disableLogs?: boolean;
|
|
37
37
|
}) => {
|
|
38
38
|
groupedConfig: {
|
|
39
|
-
configForDb:
|
|
40
|
-
configForCache:
|
|
39
|
+
configForDb: OnSnapshotConfig[];
|
|
40
|
+
configForCache: OnSnapshotConfig[];
|
|
41
41
|
};
|
|
42
42
|
socketConnected: boolean;
|
|
43
43
|
};
|
|
@@ -47,7 +47,7 @@ declare function useSafeEffect(callback: () => void, dependencies: any[], error_
|
|
|
47
47
|
declare const useDeepCompareMemo: <T>(factory: () => T, dependencies: any[]) => T;
|
|
48
48
|
declare function useDeepCompareEffect(effect: EffectCallback, dependencies: any[]): void;
|
|
49
49
|
|
|
50
|
-
declare const useSocketSubscription: (
|
|
50
|
+
declare const useSocketSubscription: (configs: OnSnapshotConfig[], label?: string, settings?: {
|
|
51
51
|
cleanupForConfigChange?: boolean;
|
|
52
52
|
disableLogs?: boolean;
|
|
53
53
|
}) => {
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ declare const useSmartSnapshot: (configs: OnSnapshotConfig[], label?: string, se
|
|
|
36
36
|
disableLogs?: boolean;
|
|
37
37
|
}) => {
|
|
38
38
|
groupedConfig: {
|
|
39
|
-
configForDb:
|
|
40
|
-
configForCache:
|
|
39
|
+
configForDb: OnSnapshotConfig[];
|
|
40
|
+
configForCache: OnSnapshotConfig[];
|
|
41
41
|
};
|
|
42
42
|
socketConnected: boolean;
|
|
43
43
|
};
|
|
@@ -47,7 +47,7 @@ declare function useSafeEffect(callback: () => void, dependencies: any[], error_
|
|
|
47
47
|
declare const useDeepCompareMemo: <T>(factory: () => T, dependencies: any[]) => T;
|
|
48
48
|
declare function useDeepCompareEffect(effect: EffectCallback, dependencies: any[]): void;
|
|
49
49
|
|
|
50
|
-
declare const useSocketSubscription: (
|
|
50
|
+
declare const useSocketSubscription: (configs: OnSnapshotConfig[], label?: string, settings?: {
|
|
51
51
|
cleanupForConfigChange?: boolean;
|
|
52
52
|
disableLogs?: boolean;
|
|
53
53
|
}) => {
|
package/dist/hooks/index.js
CHANGED
|
@@ -640,6 +640,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
640
640
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
641
641
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
642
642
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
643
|
+
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
644
|
+
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
643
645
|
// src/helpers/socket.ts
|
|
644
646
|
var import_socket = require("socket.io-client");
|
|
645
647
|
var SocketService = /*#__PURE__*/ function() {
|
|
@@ -657,10 +659,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
657
659
|
value: function initSocket() {
|
|
658
660
|
var _this = this;
|
|
659
661
|
if (!this.socket) {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
this.socket = (0, import_socket.io)(SOCKET_SERVER_URL, {
|
|
663
|
-
path: SOCKET_PATH,
|
|
662
|
+
this.socket = (0, import_socket.io)(dataSocketDomain, {
|
|
663
|
+
path: "/connect",
|
|
664
664
|
transports: [
|
|
665
665
|
"websocket"
|
|
666
666
|
]
|
|
@@ -941,21 +941,26 @@ function useDeepCompareEffect(effect, dependencies) {
|
|
|
941
941
|
}
|
|
942
942
|
// src/hooks/socket.ts
|
|
943
943
|
var import_react3 = require("react");
|
|
944
|
-
var useSocketSubscription = function(
|
|
944
|
+
var useSocketSubscription = function(configs, label, settings) {
|
|
945
945
|
var _ref = _sliced_to_array((0, import_react3.useState)(socketServiceInstance.isConnected()), 2), socketConnected = _ref[0], setSocketConnected = _ref[1];
|
|
946
946
|
var _ref1 = _sliced_to_array((0, import_react3.useState)([]), 2), cleanupSubscriptions = _ref1[0], setCleanupSubscriptions = _ref1[1];
|
|
947
947
|
useDeepCompareEffect(function() {
|
|
948
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
949
|
-
console.log("==> ".concat(label || "Custom snapshots", " started from cache... "));
|
|
950
|
-
}
|
|
951
948
|
if (socketConnected) {
|
|
952
949
|
setCleanupSubscriptions(function(prev) {
|
|
953
950
|
return _to_consumable_array(prev).concat([
|
|
954
|
-
socketServiceInstance.subscribeToCollections(
|
|
951
|
+
socketServiceInstance.subscribeToCollections(configs)
|
|
955
952
|
]);
|
|
956
953
|
});
|
|
954
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
955
|
+
console.log("==> ".concat(label || "Cache snapshots", " subscribed to ").concat(configs.map(function(c) {
|
|
956
|
+
return c.collectionName;
|
|
957
|
+
}).join(", ")));
|
|
958
|
+
}
|
|
957
959
|
} else {
|
|
958
960
|
socketServiceInstance.getSocketInstance();
|
|
961
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
962
|
+
console.log("==> ".concat(label || "Cache snapshots", " started... "));
|
|
963
|
+
}
|
|
959
964
|
}
|
|
960
965
|
var uiOnConnect = function() {
|
|
961
966
|
setSocketConnected(true);
|
|
@@ -970,8 +975,8 @@ var useSocketSubscription = function(config, label, settings) {
|
|
|
970
975
|
socketServiceInstance.onDisconnect(uiOnDisconnect);
|
|
971
976
|
setSocketConnected(socketServiceInstance.isConnected());
|
|
972
977
|
return function() {
|
|
973
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
974
|
-
console.log("==> ".concat(label || "
|
|
978
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
979
|
+
console.log("==> ".concat(label || "Cache snapshots", " stopped. "));
|
|
975
980
|
}
|
|
976
981
|
if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
|
|
977
982
|
cleanupSubscriptions.forEach(function(cleanup) {
|
|
@@ -982,7 +987,8 @@ var useSocketSubscription = function(config, label, settings) {
|
|
|
982
987
|
}
|
|
983
988
|
};
|
|
984
989
|
}, [
|
|
985
|
-
socketConnected
|
|
990
|
+
socketConnected,
|
|
991
|
+
configs
|
|
986
992
|
]);
|
|
987
993
|
(0, import_react3.useEffect)(function() {
|
|
988
994
|
return function() {
|
|
@@ -1009,8 +1015,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
1009
1015
|
var unsubscribeFunctions = (0, import_react5.useRef)([]);
|
|
1010
1016
|
useDeepCompareEffect(function() {
|
|
1011
1017
|
var start = performance.now();
|
|
1012
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
1013
|
-
console.log("==> ".concat(label || "
|
|
1018
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
1019
|
+
console.log("==> ".concat(label || "DB snapshots", " started from db... "));
|
|
1014
1020
|
}
|
|
1015
1021
|
var snapshotResults = configs.map(function(config) {
|
|
1016
1022
|
return snapshot(config, snapshotsFirstTime.current, settings);
|
|
@@ -1021,8 +1027,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
1021
1027
|
Promise.all(snapshotResults.map(function(result) {
|
|
1022
1028
|
return result.promise;
|
|
1023
1029
|
})).then(function() {
|
|
1024
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
1025
|
-
console.log("==> ".concat(label || "
|
|
1030
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
1031
|
+
console.log("==> ".concat(label || "DB snapshots", " ended from db. It took ").concat((performance.now() - start).toFixed(2), " ms"));
|
|
1026
1032
|
}
|
|
1027
1033
|
});
|
|
1028
1034
|
if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
|
|
@@ -1032,8 +1038,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
1032
1038
|
unsubscribe();
|
|
1033
1039
|
}
|
|
1034
1040
|
});
|
|
1035
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
1036
|
-
console.log("==> ".concat(label || "
|
|
1041
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
1042
|
+
console.log("==> ".concat(label || "DB snapshots", " unsubscribed from db"));
|
|
1037
1043
|
}
|
|
1038
1044
|
};
|
|
1039
1045
|
}
|
|
@@ -1050,7 +1056,7 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
1050
1056
|
}
|
|
1051
1057
|
});
|
|
1052
1058
|
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
1053
|
-
console.log("==> ".concat(label || "
|
|
1059
|
+
console.log("==> ".concat(label || "DB snapshots", " unsubscribed"));
|
|
1054
1060
|
}
|
|
1055
1061
|
};
|
|
1056
1062
|
}, []);
|
|
@@ -1065,7 +1071,7 @@ var useSmartSnapshot = function(configs, label, settings) {
|
|
|
1065
1071
|
return setCacheCollectionsConfig(null);
|
|
1066
1072
|
};
|
|
1067
1073
|
}, []);
|
|
1068
|
-
var groupedConfig =
|
|
1074
|
+
var groupedConfig = (0, import_react5.useMemo)(function() {
|
|
1069
1075
|
if (!cacheCollectionsConfig) {
|
|
1070
1076
|
return {
|
|
1071
1077
|
configForDb: [],
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -253,7 +253,7 @@ function _ts_generator(thisArg, body) {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
import { CountryOptions as CountryOptions2 } from "akeyless-types-commons";
|
|
256
|
-
import { useEffect as useEffect3, useLayoutEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
256
|
+
import { useEffect as useEffect3, useLayoutEffect, useMemo as useMemo2, useRef as useRef2, useState as useState2 } from "react";
|
|
257
257
|
// src/helpers/firebase.ts
|
|
258
258
|
import moment from "moment";
|
|
259
259
|
import { initializeApp } from "firebase/app";
|
|
@@ -546,6 +546,8 @@ var biDomain = isLocal ? "http://localhost:9002/api/bi" : baseDomain + "/bi";
|
|
|
546
546
|
var notificationsDomain = isLocal ? "http://localhost:9006/api/notifications" : baseDomain + "/notifications";
|
|
547
547
|
var callCenterGeoDomain = isLocal ? "http://localhost:9007/api/call-center/geo" : baseDomain + "/call-center/geo";
|
|
548
548
|
var callCenterEventsDomain = isLocal ? "http://localhost:9008/api/call-center/events" : baseDomain + "/call-center/events";
|
|
549
|
+
var dataSocketDomain = isLocal ? "http://localhost:9009/api/data-socket" : baseDomain + "/data-socket";
|
|
550
|
+
var dataSyncDomain = isLocal ? "http://localhost:9010/api/data-sync" : baseDomain + "/data-sync";
|
|
549
551
|
// src/helpers/socket.ts
|
|
550
552
|
import { io } from "socket.io-client";
|
|
551
553
|
var SocketService = /*#__PURE__*/ function() {
|
|
@@ -563,10 +565,8 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
563
565
|
value: function initSocket() {
|
|
564
566
|
var _this = this;
|
|
565
567
|
if (!this.socket) {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
this.socket = io(SOCKET_SERVER_URL, {
|
|
569
|
-
path: SOCKET_PATH,
|
|
568
|
+
this.socket = io(dataSocketDomain, {
|
|
569
|
+
path: "/connect",
|
|
570
570
|
transports: [
|
|
571
571
|
"websocket"
|
|
572
572
|
]
|
|
@@ -847,21 +847,26 @@ function useDeepCompareEffect(effect, dependencies) {
|
|
|
847
847
|
}
|
|
848
848
|
// src/hooks/socket.ts
|
|
849
849
|
import { useEffect as useEffect2, useState } from "react";
|
|
850
|
-
var useSocketSubscription = function(
|
|
850
|
+
var useSocketSubscription = function(configs, label, settings) {
|
|
851
851
|
var _useState = _sliced_to_array(useState(socketServiceInstance.isConnected()), 2), socketConnected = _useState[0], setSocketConnected = _useState[1];
|
|
852
852
|
var _useState1 = _sliced_to_array(useState([]), 2), cleanupSubscriptions = _useState1[0], setCleanupSubscriptions = _useState1[1];
|
|
853
853
|
useDeepCompareEffect(function() {
|
|
854
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
855
|
-
console.log("==> ".concat(label || "Custom snapshots", " started from cache... "));
|
|
856
|
-
}
|
|
857
854
|
if (socketConnected) {
|
|
858
855
|
setCleanupSubscriptions(function(prev) {
|
|
859
856
|
return _to_consumable_array(prev).concat([
|
|
860
|
-
socketServiceInstance.subscribeToCollections(
|
|
857
|
+
socketServiceInstance.subscribeToCollections(configs)
|
|
861
858
|
]);
|
|
862
859
|
});
|
|
860
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
861
|
+
console.log("==> ".concat(label || "Cache snapshots", " subscribed to ").concat(configs.map(function(c) {
|
|
862
|
+
return c.collectionName;
|
|
863
|
+
}).join(", ")));
|
|
864
|
+
}
|
|
863
865
|
} else {
|
|
864
866
|
socketServiceInstance.getSocketInstance();
|
|
867
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
868
|
+
console.log("==> ".concat(label || "Cache snapshots", " started... "));
|
|
869
|
+
}
|
|
865
870
|
}
|
|
866
871
|
var uiOnConnect = function() {
|
|
867
872
|
setSocketConnected(true);
|
|
@@ -876,8 +881,8 @@ var useSocketSubscription = function(config, label, settings) {
|
|
|
876
881
|
socketServiceInstance.onDisconnect(uiOnDisconnect);
|
|
877
882
|
setSocketConnected(socketServiceInstance.isConnected());
|
|
878
883
|
return function() {
|
|
879
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
880
|
-
console.log("==> ".concat(label || "
|
|
884
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
885
|
+
console.log("==> ".concat(label || "Cache snapshots", " stopped. "));
|
|
881
886
|
}
|
|
882
887
|
if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
|
|
883
888
|
cleanupSubscriptions.forEach(function(cleanup) {
|
|
@@ -888,7 +893,8 @@ var useSocketSubscription = function(config, label, settings) {
|
|
|
888
893
|
}
|
|
889
894
|
};
|
|
890
895
|
}, [
|
|
891
|
-
socketConnected
|
|
896
|
+
socketConnected,
|
|
897
|
+
configs
|
|
892
898
|
]);
|
|
893
899
|
useEffect2(function() {
|
|
894
900
|
return function() {
|
|
@@ -915,8 +921,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
915
921
|
var unsubscribeFunctions = useRef2([]);
|
|
916
922
|
useDeepCompareEffect(function() {
|
|
917
923
|
var start = performance.now();
|
|
918
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
919
|
-
console.log("==> ".concat(label || "
|
|
924
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
925
|
+
console.log("==> ".concat(label || "DB snapshots", " started from db... "));
|
|
920
926
|
}
|
|
921
927
|
var snapshotResults = configs.map(function(config) {
|
|
922
928
|
return snapshot(config, snapshotsFirstTime.current, settings);
|
|
@@ -927,8 +933,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
927
933
|
Promise.all(snapshotResults.map(function(result) {
|
|
928
934
|
return result.promise;
|
|
929
935
|
})).then(function() {
|
|
930
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
931
|
-
console.log("==> ".concat(label || "
|
|
936
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
937
|
+
console.log("==> ".concat(label || "DB snapshots", " ended from db. It took ").concat((performance.now() - start).toFixed(2), " ms"));
|
|
932
938
|
}
|
|
933
939
|
});
|
|
934
940
|
if (settings === null || settings === void 0 ? void 0 : settings.cleanupForConfigChange) {
|
|
@@ -938,8 +944,8 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
938
944
|
unsubscribe();
|
|
939
945
|
}
|
|
940
946
|
});
|
|
941
|
-
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
942
|
-
console.log("==> ".concat(label || "
|
|
947
|
+
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs) && configs.length > 0) {
|
|
948
|
+
console.log("==> ".concat(label || "DB snapshots", " unsubscribed from db"));
|
|
943
949
|
}
|
|
944
950
|
};
|
|
945
951
|
}
|
|
@@ -956,7 +962,7 @@ var useSnapshotBulk = function(configs, label, settings) {
|
|
|
956
962
|
}
|
|
957
963
|
});
|
|
958
964
|
if (!(settings === null || settings === void 0 ? void 0 : settings.disableLogs)) {
|
|
959
|
-
console.log("==> ".concat(label || "
|
|
965
|
+
console.log("==> ".concat(label || "DB snapshots", " unsubscribed"));
|
|
960
966
|
}
|
|
961
967
|
};
|
|
962
968
|
}, []);
|
|
@@ -971,7 +977,7 @@ var useSmartSnapshot = function(configs, label, settings) {
|
|
|
971
977
|
return setCacheCollectionsConfig(null);
|
|
972
978
|
};
|
|
973
979
|
}, []);
|
|
974
|
-
var groupedConfig =
|
|
980
|
+
var groupedConfig = useMemo2(function() {
|
|
975
981
|
if (!cacheCollectionsConfig) {
|
|
976
982
|
return {
|
|
977
983
|
configForDb: [],
|