akeyless-client-commons 1.1.70 → 1.1.71
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.css.map +1 -1
- package/dist/components/index.js +105 -155
- package/dist/components/index.mjs +74 -124
- package/dist/helpers/index.js +191 -249
- package/dist/helpers/index.mjs +140 -198
- package/dist/hooks/index.js +40 -90
- package/dist/hooks/index.mjs +9 -59
- package/package.json +1 -1
package/dist/hooks/index.mjs
CHANGED
|
@@ -250,12 +250,12 @@ function _ts_generator(thisArg, body) {
|
|
|
250
250
|
import { CountryOptions as CountryOptions2 } from "akeyless-types-commons";
|
|
251
251
|
import { useEffect, useLayoutEffect } from "react";
|
|
252
252
|
// src/helpers/firebase.ts
|
|
253
|
-
import
|
|
253
|
+
import moment2 from "moment";
|
|
254
254
|
import { initializeApp } from "firebase/app";
|
|
255
255
|
import { getStorage } from "firebase/storage";
|
|
256
256
|
import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
|
|
257
257
|
import { initializeAppCheck, ReCaptchaEnterpriseProvider } from "firebase/app-check";
|
|
258
|
-
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
|
|
258
|
+
import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp as Timestamp2, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
|
|
259
259
|
import { useCallback } from "react";
|
|
260
260
|
// src/helpers/phoneNumber.ts
|
|
261
261
|
import { parsePhoneNumberFromString } from "libphonenumber-js";
|
|
@@ -280,6 +280,10 @@ var checkUserPermissions = function(userPermissions, entity, permissions, mode2)
|
|
|
280
280
|
checkUserPermissions({}, "dashboard", []);
|
|
281
281
|
// src/helpers/firebase.ts
|
|
282
282
|
import { ref, getDownloadURL, uploadBytes } from "firebase/storage";
|
|
283
|
+
// src/helpers/time_helpers.ts
|
|
284
|
+
import { Timestamp } from "firebase/firestore";
|
|
285
|
+
import moment from "moment-timezone";
|
|
286
|
+
// src/helpers/firebase.ts
|
|
283
287
|
var initApp = function() {
|
|
284
288
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
285
289
|
var firebaseConfig = {
|
|
@@ -345,7 +349,7 @@ var collections = {
|
|
|
345
349
|
board_types: collection(db, "boardTypes"),
|
|
346
350
|
charge_capacities: collection(db, "nx-charge-capacities")
|
|
347
351
|
};
|
|
348
|
-
var fire_base_TIME_TEMP =
|
|
352
|
+
var fire_base_TIME_TEMP = Timestamp2.now;
|
|
349
353
|
var simpleExtractData = function(doc2) {
|
|
350
354
|
var docData = doc2.data();
|
|
351
355
|
return _object_spread_props(_object_spread({}, docData), {
|
|
@@ -536,9 +540,6 @@ var chartsRegex = XRegExp("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu");
|
|
|
536
540
|
// src/lib/utils.ts
|
|
537
541
|
import { clsx } from "clsx";
|
|
538
542
|
import { twMerge } from "tailwind-merge";
|
|
539
|
-
// src/helpers/time_helpers.ts
|
|
540
|
-
import { Timestamp as Timestamp2 } from "firebase/firestore";
|
|
541
|
-
import moment2 from "moment-timezone";
|
|
542
543
|
// src/helpers/api.ts
|
|
543
544
|
import axios2 from "axios";
|
|
544
545
|
var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
|
|
@@ -555,57 +556,6 @@ import axios3 from "axios";
|
|
|
555
556
|
// src/helpers/socket.ts
|
|
556
557
|
import { io } from "socket.io-client";
|
|
557
558
|
var SESSION_STORAGE_KEY = "sessionId";
|
|
558
|
-
var safeSessionStorage = function() {
|
|
559
|
-
var memoryValue;
|
|
560
|
-
var canUseStorage = function() {
|
|
561
|
-
if (typeof window === "undefined") return false;
|
|
562
|
-
try {
|
|
563
|
-
var testKey = "".concat(SESSION_STORAGE_KEY, "_test");
|
|
564
|
-
window.localStorage.setItem(testKey, "1");
|
|
565
|
-
window.localStorage.removeItem(testKey);
|
|
566
|
-
return true;
|
|
567
|
-
} catch (error) {
|
|
568
|
-
console.warn("localStorage check failed, falling back to memory store", error);
|
|
569
|
-
return false;
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
var storageAvailable = canUseStorage();
|
|
573
|
-
return {
|
|
574
|
-
read: function read() {
|
|
575
|
-
if (!storageAvailable) {
|
|
576
|
-
return memoryValue;
|
|
577
|
-
}
|
|
578
|
-
try {
|
|
579
|
-
return window.localStorage.getItem(SESSION_STORAGE_KEY) || memoryValue;
|
|
580
|
-
} catch (error) {
|
|
581
|
-
console.warn("localStorage read failed, using memory store", error);
|
|
582
|
-
return memoryValue;
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
write: function write(value) {
|
|
586
|
-
memoryValue = value;
|
|
587
|
-
if (!storageAvailable || typeof value === "undefined") {
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
try {
|
|
591
|
-
window.localStorage.setItem(SESSION_STORAGE_KEY, value);
|
|
592
|
-
} catch (error) {
|
|
593
|
-
console.warn("localStorage write failed, persisting in memory store", error);
|
|
594
|
-
}
|
|
595
|
-
},
|
|
596
|
-
clear: function clear() {
|
|
597
|
-
memoryValue = void 0;
|
|
598
|
-
if (!storageAvailable) {
|
|
599
|
-
return;
|
|
600
|
-
}
|
|
601
|
-
try {
|
|
602
|
-
window.localStorage.removeItem(SESSION_STORAGE_KEY);
|
|
603
|
-
} catch (error) {
|
|
604
|
-
console.warn("localStorage clear failed", error);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
}();
|
|
609
559
|
var SocketService = /*#__PURE__*/ function() {
|
|
610
560
|
"use strict";
|
|
611
561
|
function _SocketService() {
|
|
@@ -626,7 +576,7 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
626
576
|
this.socket = io(socketUrl, {
|
|
627
577
|
path: "/api/data-socket/connect",
|
|
628
578
|
auth: function(cb) {
|
|
629
|
-
var sessionId =
|
|
579
|
+
var sessionId = localStorage.getItem(SESSION_STORAGE_KEY) || void 0;
|
|
630
580
|
var token = _this.authToken;
|
|
631
581
|
var authPayload = {};
|
|
632
582
|
if (token) authPayload.token = token;
|
|
@@ -668,7 +618,7 @@ var SocketService = /*#__PURE__*/ function() {
|
|
|
668
618
|
this.socket.on("session", function(param) {
|
|
669
619
|
var session_id = param.session_id;
|
|
670
620
|
if (session_id) {
|
|
671
|
-
|
|
621
|
+
localStorage.setItem(SESSION_STORAGE_KEY, session_id);
|
|
672
622
|
}
|
|
673
623
|
});
|
|
674
624
|
this.socket.on("connect_error", function(error) {
|