akeyless-client-commons 1.1.69 → 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.
@@ -259,12 +259,12 @@ function _ts_generator(thisArg, body) {
259
259
  };
260
260
  }
261
261
  }
262
- import moment from "moment";
262
+ import moment2 from "moment";
263
263
  import { initializeApp } from "firebase/app";
264
264
  import { getStorage } from "firebase/storage";
265
265
  import { getAuth, GoogleAuthProvider, signInWithPopup } from "firebase/auth";
266
266
  import { initializeAppCheck, ReCaptchaEnterpriseProvider } from "firebase/app-check";
267
- import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
267
+ import { addDoc, collection, deleteDoc, doc, getDoc, getDocs, query, setDoc, Timestamp as Timestamp2, where, getFirestore, onSnapshot, orderBy } from "firebase/firestore";
268
268
  // src/helpers/cars.ts
269
269
  var formatCarNumber = function(car_number) {
270
270
  var cn2 = car_number;
@@ -430,6 +430,134 @@ var initializeUserPermissions = /*#__PURE__*/ function() {
430
430
  }();
431
431
  // src/helpers/firebase.ts
432
432
  import { ref, getDownloadURL, uploadBytes } from "firebase/storage";
433
+ // src/helpers/time_helpers.ts
434
+ import { Timestamp } from "firebase/firestore";
435
+ import moment from "moment-timezone";
436
+ function timestamp_to_string(firebaseTimestamp, options) {
437
+ var _options_defaultReturnedValue, _options_format, _options_fromFormat, _options_debug;
438
+ var _ref = {
439
+ defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-",
440
+ format: (_options_format = options === null || options === void 0 ? void 0 : options.format) !== null && _options_format !== void 0 ? _options_format : "DD/MM/YYYY HH:mm:ss",
441
+ fromFormat: (_options_fromFormat = options === null || options === void 0 ? void 0 : options.fromFormat) !== null && _options_fromFormat !== void 0 ? _options_fromFormat : "DD/MM/YYYY HH:mm:ss",
442
+ tz: options === null || options === void 0 ? void 0 : options.tz,
443
+ debug: (_options_debug = options === null || options === void 0 ? void 0 : options.debug) !== null && _options_debug !== void 0 ? _options_debug : false
444
+ }, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz, debug = _ref.debug;
445
+ var date;
446
+ switch(true){
447
+ case !firebaseTimestamp:
448
+ {
449
+ return defaultReturnedValue;
450
+ }
451
+ case _instanceof(firebaseTimestamp, Timestamp):
452
+ {
453
+ date = firebaseTimestamp.toDate();
454
+ break;
455
+ }
456
+ case _instanceof(firebaseTimestamp, Date):
457
+ {
458
+ date = firebaseTimestamp;
459
+ break;
460
+ }
461
+ case typeof firebaseTimestamp === "string":
462
+ {
463
+ var m = moment.utc(firebaseTimestamp, fromFormat);
464
+ switch(m.isValid()){
465
+ case true:
466
+ date = m.toDate();
467
+ break;
468
+ default:
469
+ return defaultReturnedValue;
470
+ }
471
+ break;
472
+ }
473
+ case !!firebaseTimestamp._seconds:
474
+ {
475
+ var ft = firebaseTimestamp;
476
+ var _ft__nanoseconds;
477
+ date = new Date(ft._seconds * 1e3 + ((_ft__nanoseconds = ft._nanoseconds) !== null && _ft__nanoseconds !== void 0 ? _ft__nanoseconds : 0) / 1e6);
478
+ break;
479
+ }
480
+ case !!firebaseTimestamp.seconds:
481
+ {
482
+ var ft1 = firebaseTimestamp;
483
+ date = new Date(ft1.seconds * 1e3 + ft1.nanoseconds / 1e6);
484
+ break;
485
+ }
486
+ default:
487
+ {
488
+ if (debug) {
489
+ console.error("Invalid timestamp format: ", firebaseTimestamp);
490
+ }
491
+ return defaultReturnedValue;
492
+ }
493
+ }
494
+ switch(Boolean(tz)){
495
+ case true:
496
+ return moment(date).tz(tz).format(format);
497
+ default:
498
+ return moment.utc(date).format(format);
499
+ }
500
+ }
501
+ function timestamp_to_millis(firebaseTimestamp, options) {
502
+ var _options_defaultReturnedValue, _options_fromFormat, _options_debug;
503
+ var _ref = {
504
+ defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : 0,
505
+ fromFormat: (_options_fromFormat = options === null || options === void 0 ? void 0 : options.fromFormat) !== null && _options_fromFormat !== void 0 ? _options_fromFormat : "DD/MM/YYYY HH:mm:ss",
506
+ tz: options === null || options === void 0 ? void 0 : options.tz,
507
+ debug: (_options_debug = options === null || options === void 0 ? void 0 : options.debug) !== null && _options_debug !== void 0 ? _options_debug : false
508
+ }, defaultReturnedValue = _ref.defaultReturnedValue, fromFormat = _ref.fromFormat, tz = _ref.tz, debug = _ref.debug;
509
+ switch(true){
510
+ case !firebaseTimestamp:
511
+ {
512
+ return defaultReturnedValue;
513
+ }
514
+ case _instanceof(firebaseTimestamp, Timestamp):
515
+ {
516
+ return firebaseTimestamp.toMillis();
517
+ }
518
+ case _instanceof(firebaseTimestamp, Date):
519
+ {
520
+ var ms = firebaseTimestamp.getTime();
521
+ return isNaN(ms) ? defaultReturnedValue : ms;
522
+ }
523
+ case typeof firebaseTimestamp === "string":
524
+ {
525
+ var m = tz ? moment.tz(firebaseTimestamp, fromFormat, tz) : moment.utc(firebaseTimestamp, fromFormat);
526
+ switch(m.isValid()){
527
+ case true:
528
+ return m.valueOf();
529
+ default:
530
+ return defaultReturnedValue;
531
+ }
532
+ }
533
+ case !!firebaseTimestamp._seconds:
534
+ {
535
+ var seconds = firebaseTimestamp._seconds;
536
+ var _firebaseTimestamp__nanoseconds;
537
+ var nanos = (_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0;
538
+ return seconds * 1e3 + Math.floor(nanos / 1e6);
539
+ }
540
+ case !!firebaseTimestamp.seconds:
541
+ {
542
+ var seconds1 = firebaseTimestamp.seconds;
543
+ var _firebaseTimestamp_nanoseconds;
544
+ var nanos1 = (_firebaseTimestamp_nanoseconds = firebaseTimestamp.nanoseconds) !== null && _firebaseTimestamp_nanoseconds !== void 0 ? _firebaseTimestamp_nanoseconds : 0;
545
+ return seconds1 * 1e3 + Math.floor(nanos1 / 1e6);
546
+ }
547
+ default:
548
+ {
549
+ if (debug) {
550
+ console.error("Invalid timestamp format: ", firebaseTimestamp);
551
+ }
552
+ return defaultReturnedValue;
553
+ }
554
+ }
555
+ }
556
+ function sort_by_timestamp(a, b) {
557
+ var reverse = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
558
+ return reverse ? timestamp_to_millis(b) - timestamp_to_millis(a) : timestamp_to_millis(a) - timestamp_to_millis(b);
559
+ }
560
+ // src/helpers/firebase.ts
433
561
  var initApp = function() {
434
562
  var isNodeEnv2 = typeof process !== "undefined" && process.env;
435
563
  var firebaseConfig = {
@@ -520,13 +648,13 @@ var collections = {
520
648
  board_types: collection(db, "boardTypes"),
521
649
  charge_capacities: collection(db, "nx-charge-capacities")
522
650
  };
523
- var fire_base_TIME_TEMP = Timestamp.now;
651
+ var fire_base_TIME_TEMP = Timestamp2.now;
524
652
  var extractAlertsData = function(doc2) {
525
653
  var data = doc2.data();
526
654
  var car_number = data.car_number, timestamp = data.timestamp;
527
655
  return _object_spread_props(_object_spread({}, data), {
528
656
  timestamp_seconds: timestamp.seconds,
529
- timestamp_ui: moment.unix(timestamp.seconds).format("DD/MM/YY HH:mm"),
657
+ timestamp_ui: moment2.unix(timestamp.seconds).format("DD/MM/YY HH:mm"),
530
658
  car_number: formatCarNumber(car_number)
531
659
  });
532
660
  };
@@ -537,34 +665,26 @@ var simpleExtractData = function(doc2) {
537
665
  });
538
666
  };
539
667
  var extractSiteData = function(doc2) {
540
- var _data_updated, _data_created;
541
668
  var data = doc2.data();
542
- var dateUpdated = new Date(((_data_updated = data.updated) === null || _data_updated === void 0 ? void 0 : _data_updated.seconds) * 1e3 + data.updated.nanoseconds / 1e6);
543
- var dateCreated = new Date(((_data_created = data.created) === null || _data_created === void 0 ? void 0 : _data_created.seconds) * 1e3 + data.created.nanoseconds / 1e6);
544
669
  return _object_spread_props(_object_spread({}, data), {
545
670
  id: doc2.id,
546
- created: moment(dateCreated).format("DD.MM.YYYY - HH:mm"),
547
- updated: moment(dateUpdated).format("DD.MM.YYYY - HH:mm")
671
+ created: timestamp_to_string(data.created),
672
+ updated: timestamp_to_string(data.updated)
548
673
  });
549
674
  };
550
675
  var extractClientData = function(doc2) {
551
- var _data_updated, _data_created;
552
676
  var data = doc2.data();
553
- var dateUpdated = new Date(((_data_updated = data.updated) === null || _data_updated === void 0 ? void 0 : _data_updated.seconds) * 1e3 + data.updated.nanoseconds / 1e6);
554
- var dateCreated = new Date(((_data_created = data.created) === null || _data_created === void 0 ? void 0 : _data_created.seconds) * 1e3 + data.created.nanoseconds / 1e6);
555
677
  return _object_spread_props(_object_spread({}, data), {
556
678
  id: doc2.id,
557
- created: moment(dateCreated).format("HH:mm DD/MM/YY"),
558
- updated: moment(dateUpdated).format("HH:mm DD/MM/YY")
679
+ created: timestamp_to_string(data.created),
680
+ updated: timestamp_to_string(data.updated)
559
681
  });
560
682
  };
561
683
  var extractBoardsData = function(doc2) {
562
- var _data_uploaded;
563
684
  var data = doc2.data();
564
- var dateUploaded = typeof data.uploaded === "string" ? data.uploaded : moment.unix((_data_uploaded = data.uploaded) === null || _data_uploaded === void 0 ? void 0 : _data_uploaded.seconds).format("DD/MM/YY HH:mm");
565
685
  return _object_spread_props(_object_spread({}, data), {
566
686
  id: doc2.id,
567
- uploaded: dateUploaded
687
+ uploaded: timestamp_to_string(data.uploaded)
568
688
  });
569
689
  };
570
690
  var extractCarsData = function(doc2) {
@@ -598,7 +718,7 @@ var extractCanbusData = function(doc2) {
598
718
  newDate = new Date(data.timestamp.seconds * 1e3);
599
719
  }
600
720
  return _object_spread_props(_object_spread({}, data), {
601
- date_ui: newDate ? moment(newDate).format("DD/MM/YYYY - HH:mm") : "N/A"
721
+ date_ui: newDate ? moment2(newDate).format("DD/MM/YYYY - HH:mm") : "N/A"
602
722
  });
603
723
  };
604
724
  var extractLocationData = function(doc2) {
@@ -1952,133 +2072,6 @@ function cn() {
1952
2072
  }
1953
2073
  return twMerge(clsx(inputs));
1954
2074
  }
1955
- // src/helpers/time_helpers.ts
1956
- import { Timestamp as Timestamp2 } from "firebase/firestore";
1957
- import moment2 from "moment-timezone";
1958
- function timestamp_to_string(firebaseTimestamp, options) {
1959
- var _options_defaultReturnedValue, _options_format, _options_fromFormat, _options_debug;
1960
- var _ref = {
1961
- defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-",
1962
- format: (_options_format = options === null || options === void 0 ? void 0 : options.format) !== null && _options_format !== void 0 ? _options_format : "DD/MM/YYYY HH:mm:ss",
1963
- fromFormat: (_options_fromFormat = options === null || options === void 0 ? void 0 : options.fromFormat) !== null && _options_fromFormat !== void 0 ? _options_fromFormat : "DD/MM/YYYY HH:mm:ss",
1964
- tz: options === null || options === void 0 ? void 0 : options.tz,
1965
- debug: (_options_debug = options === null || options === void 0 ? void 0 : options.debug) !== null && _options_debug !== void 0 ? _options_debug : false
1966
- }, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz, debug = _ref.debug;
1967
- var date;
1968
- switch(true){
1969
- case !firebaseTimestamp:
1970
- {
1971
- return defaultReturnedValue;
1972
- }
1973
- case _instanceof(firebaseTimestamp, Timestamp2):
1974
- {
1975
- date = firebaseTimestamp.toDate();
1976
- break;
1977
- }
1978
- case _instanceof(firebaseTimestamp, Date):
1979
- {
1980
- date = firebaseTimestamp;
1981
- break;
1982
- }
1983
- case typeof firebaseTimestamp === "string":
1984
- {
1985
- var m = moment2.utc(firebaseTimestamp, fromFormat);
1986
- switch(m.isValid()){
1987
- case true:
1988
- date = m.toDate();
1989
- break;
1990
- default:
1991
- return defaultReturnedValue;
1992
- }
1993
- break;
1994
- }
1995
- case !!firebaseTimestamp._seconds:
1996
- {
1997
- var ft = firebaseTimestamp;
1998
- var _ft__nanoseconds;
1999
- date = new Date(ft._seconds * 1e3 + ((_ft__nanoseconds = ft._nanoseconds) !== null && _ft__nanoseconds !== void 0 ? _ft__nanoseconds : 0) / 1e6);
2000
- break;
2001
- }
2002
- case !!firebaseTimestamp.seconds:
2003
- {
2004
- var ft1 = firebaseTimestamp;
2005
- date = new Date(ft1.seconds * 1e3 + ft1.nanoseconds / 1e6);
2006
- break;
2007
- }
2008
- default:
2009
- {
2010
- if (debug) {
2011
- console.error("Invalid timestamp format: ", firebaseTimestamp);
2012
- }
2013
- return defaultReturnedValue;
2014
- }
2015
- }
2016
- switch(Boolean(tz)){
2017
- case true:
2018
- return moment2(date).tz(tz).format(format);
2019
- default:
2020
- return moment2.utc(date).format(format);
2021
- }
2022
- }
2023
- function timestamp_to_millis(firebaseTimestamp, options) {
2024
- var _options_defaultReturnedValue, _options_fromFormat, _options_debug;
2025
- var _ref = {
2026
- defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : 0,
2027
- fromFormat: (_options_fromFormat = options === null || options === void 0 ? void 0 : options.fromFormat) !== null && _options_fromFormat !== void 0 ? _options_fromFormat : "DD/MM/YYYY HH:mm:ss",
2028
- tz: options === null || options === void 0 ? void 0 : options.tz,
2029
- debug: (_options_debug = options === null || options === void 0 ? void 0 : options.debug) !== null && _options_debug !== void 0 ? _options_debug : false
2030
- }, defaultReturnedValue = _ref.defaultReturnedValue, fromFormat = _ref.fromFormat, tz = _ref.tz, debug = _ref.debug;
2031
- switch(true){
2032
- case !firebaseTimestamp:
2033
- {
2034
- return defaultReturnedValue;
2035
- }
2036
- case _instanceof(firebaseTimestamp, Timestamp2):
2037
- {
2038
- return firebaseTimestamp.toMillis();
2039
- }
2040
- case _instanceof(firebaseTimestamp, Date):
2041
- {
2042
- var ms = firebaseTimestamp.getTime();
2043
- return isNaN(ms) ? defaultReturnedValue : ms;
2044
- }
2045
- case typeof firebaseTimestamp === "string":
2046
- {
2047
- var m = tz ? moment2.tz(firebaseTimestamp, fromFormat, tz) : moment2.utc(firebaseTimestamp, fromFormat);
2048
- switch(m.isValid()){
2049
- case true:
2050
- return m.valueOf();
2051
- default:
2052
- return defaultReturnedValue;
2053
- }
2054
- }
2055
- case !!firebaseTimestamp._seconds:
2056
- {
2057
- var seconds = firebaseTimestamp._seconds;
2058
- var _firebaseTimestamp__nanoseconds;
2059
- var nanos = (_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0;
2060
- return seconds * 1e3 + Math.floor(nanos / 1e6);
2061
- }
2062
- case !!firebaseTimestamp.seconds:
2063
- {
2064
- var seconds1 = firebaseTimestamp.seconds;
2065
- var _firebaseTimestamp_nanoseconds;
2066
- var nanos1 = (_firebaseTimestamp_nanoseconds = firebaseTimestamp.nanoseconds) !== null && _firebaseTimestamp_nanoseconds !== void 0 ? _firebaseTimestamp_nanoseconds : 0;
2067
- return seconds1 * 1e3 + Math.floor(nanos1 / 1e6);
2068
- }
2069
- default:
2070
- {
2071
- if (debug) {
2072
- console.error("Invalid timestamp format: ", firebaseTimestamp);
2073
- }
2074
- return defaultReturnedValue;
2075
- }
2076
- }
2077
- }
2078
- function sort_by_timestamp(a, b) {
2079
- var reverse = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
2080
- return reverse ? timestamp_to_millis(b) - timestamp_to_millis(a) : timestamp_to_millis(a) - timestamp_to_millis(b);
2081
- }
2082
2075
  // src/helpers/api.ts
2083
2076
  import axios2 from "axios";
2084
2077
  var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
@@ -350,7 +350,7 @@ var import_app = require("firebase/app");
350
350
  var import_storage = require("firebase/storage");
351
351
  var import_auth = require("firebase/auth");
352
352
  var import_app_check = require("firebase/app-check");
353
- var import_firestore = require("firebase/firestore");
353
+ var import_firestore2 = require("firebase/firestore");
354
354
  var import_react = require("react");
355
355
  // src/helpers/phoneNumber.ts
356
356
  var import_libphonenumber_js = require("libphonenumber-js");
@@ -375,6 +375,10 @@ var checkUserPermissions = function(userPermissions, entity, permissions, mode2)
375
375
  checkUserPermissions({}, "dashboard", []);
376
376
  // src/helpers/firebase.ts
377
377
  var import_storage2 = require("firebase/storage");
378
+ // src/helpers/time_helpers.ts
379
+ var import_firestore = require("firebase/firestore");
380
+ var import_moment_timezone = __toESM(require("moment-timezone"));
381
+ // src/helpers/firebase.ts
378
382
  var import_meta = {};
379
383
  var initApp = function() {
380
384
  var isNodeEnv2 = typeof process !== "undefined" && process.env;
@@ -390,7 +394,7 @@ var initApp = function() {
390
394
  var app2 = (0, import_app.initializeApp)(firebaseConfig);
391
395
  var auth2 = (0, import_auth.getAuth)(app2);
392
396
  auth2.settings.appVerificationDisabledForTesting = false;
393
- var db2 = (0, import_firestore.getFirestore)(app2);
397
+ var db2 = (0, import_firestore2.getFirestore)(app2);
394
398
  var storage2 = (0, import_storage.getStorage)(app2);
395
399
  var googleLoginProvider2 = new import_auth.GoogleAuthProvider();
396
400
  var recaptchaSiteKey = isNodeEnv2 ? process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY : import_meta.env.VITE_RECAPTCHA_SITE_KEY;
@@ -415,33 +419,33 @@ var initApp = function() {
415
419
  };
416
420
  var _initApp = initApp(), db = _initApp.db, auth = _initApp.auth, storage = _initApp.storage, app = _initApp.app, appCheck = _initApp.appCheck, googleLoginProvider = _initApp.googleLoginProvider;
417
421
  var collections = {
418
- clients: (0, import_firestore.collection)(db, "nx-clients"),
419
- sites: (0, import_firestore.collection)(db, "nx-sites"),
420
- cars: (0, import_firestore.collection)(db, "units"),
421
- users: (0, import_firestore.collection)(db, "nx-users"),
422
- lastLocations: (0, import_firestore.collection)(db, "last_locations"),
423
- ermEvents: (0, import_firestore.collection)(db, "erm_events_general"),
424
- erm2Events: (0, import_firestore.collection)(db, "erm2_events_general"),
425
- ruptelaEvents: (0, import_firestore.collection)(db, "ruptela_events_general"),
426
- polygons: (0, import_firestore.collection)(db, "nx-polygons"),
427
- polygonEvents: (0, import_firestore.collection)(db, "polygon_events"),
428
- polygonCars: (0, import_firestore.collection)(db, "polygon_cars"),
429
- canbus: (0, import_firestore.collection)(db, "erm_canbus_parameters"),
430
- states: (0, import_firestore.collection)(db, "erm_states"),
431
- app_pro_commands_queue: (0, import_firestore.collection)(db, "app_pro_commands_queue"),
432
- trips: (0, import_firestore.collection)(db, "erm2_trip"),
433
- tripsDetails: (0, import_firestore.collection)(db, "erm2_trip_details"),
434
- audit: (0, import_firestore.collection)(db, "nx-audit"),
435
- nx_settings: (0, import_firestore.collection)(db, "nx-settings"),
436
- settings: (0, import_firestore.collection)(db, "settings"),
437
- translations: (0, import_firestore.collection)(db, "nx-translations"),
438
- nx_cars: (0, import_firestore.collection)(db, "nx-cars"),
439
- boards: (0, import_firestore.collection)(db, "boards"),
440
- protection_types: (0, import_firestore.collection)(db, "protectionTypes"),
441
- board_types: (0, import_firestore.collection)(db, "boardTypes"),
442
- charge_capacities: (0, import_firestore.collection)(db, "nx-charge-capacities")
422
+ clients: (0, import_firestore2.collection)(db, "nx-clients"),
423
+ sites: (0, import_firestore2.collection)(db, "nx-sites"),
424
+ cars: (0, import_firestore2.collection)(db, "units"),
425
+ users: (0, import_firestore2.collection)(db, "nx-users"),
426
+ lastLocations: (0, import_firestore2.collection)(db, "last_locations"),
427
+ ermEvents: (0, import_firestore2.collection)(db, "erm_events_general"),
428
+ erm2Events: (0, import_firestore2.collection)(db, "erm2_events_general"),
429
+ ruptelaEvents: (0, import_firestore2.collection)(db, "ruptela_events_general"),
430
+ polygons: (0, import_firestore2.collection)(db, "nx-polygons"),
431
+ polygonEvents: (0, import_firestore2.collection)(db, "polygon_events"),
432
+ polygonCars: (0, import_firestore2.collection)(db, "polygon_cars"),
433
+ canbus: (0, import_firestore2.collection)(db, "erm_canbus_parameters"),
434
+ states: (0, import_firestore2.collection)(db, "erm_states"),
435
+ app_pro_commands_queue: (0, import_firestore2.collection)(db, "app_pro_commands_queue"),
436
+ trips: (0, import_firestore2.collection)(db, "erm2_trip"),
437
+ tripsDetails: (0, import_firestore2.collection)(db, "erm2_trip_details"),
438
+ audit: (0, import_firestore2.collection)(db, "nx-audit"),
439
+ nx_settings: (0, import_firestore2.collection)(db, "nx-settings"),
440
+ settings: (0, import_firestore2.collection)(db, "settings"),
441
+ translations: (0, import_firestore2.collection)(db, "nx-translations"),
442
+ nx_cars: (0, import_firestore2.collection)(db, "nx-cars"),
443
+ boards: (0, import_firestore2.collection)(db, "boards"),
444
+ protection_types: (0, import_firestore2.collection)(db, "protectionTypes"),
445
+ board_types: (0, import_firestore2.collection)(db, "boardTypes"),
446
+ charge_capacities: (0, import_firestore2.collection)(db, "nx-charge-capacities")
443
447
  };
444
- var fire_base_TIME_TEMP = import_firestore.Timestamp.now;
448
+ var fire_base_TIME_TEMP = import_firestore2.Timestamp.now;
445
449
  var simpleExtractData = function(doc2) {
446
450
  var docData = doc2.data();
447
451
  return _object_spread_props(_object_spread({}, docData), {
@@ -460,10 +464,10 @@ var get_document_by_id = /*#__PURE__*/ function() {
460
464
  ,
461
465
  3
462
466
  ]);
463
- doc_ref = (0, import_firestore.doc)(db, collection_path, doc_id);
467
+ doc_ref = (0, import_firestore2.doc)(db, collection_path, doc_id);
464
468
  return [
465
469
  4,
466
- (0, import_firestore.getDoc)(doc_ref)
470
+ (0, import_firestore2.getDoc)(doc_ref)
467
471
  ];
468
472
  case 1:
469
473
  doc_snap = _state.sent();
@@ -506,18 +510,18 @@ var snapshot = function(config, snapshotsFirstTime, settings) {
506
510
  }
507
511
  };
508
512
  });
509
- var collectionRef = (0, import_firestore.collection)(db, config.collectionName);
513
+ var collectionRef = (0, import_firestore2.collection)(db, config.collectionName);
510
514
  if (config.conditions) {
511
515
  config.conditions.forEach(function(condition) {
512
- collectionRef = (0, import_firestore.query)(collectionRef, (0, import_firestore.where)(condition.field_name, condition.operator, condition.value));
516
+ collectionRef = (0, import_firestore2.query)(collectionRef, (0, import_firestore2.where)(condition.field_name, condition.operator, condition.value));
513
517
  });
514
518
  }
515
519
  if (config.orderBy) {
516
520
  config.orderBy.forEach(function(order) {
517
- collectionRef = (0, import_firestore.query)(collectionRef, (0, import_firestore.orderBy)(order.fieldName, order.direction));
521
+ collectionRef = (0, import_firestore2.query)(collectionRef, (0, import_firestore2.orderBy)(order.fieldName, order.direction));
518
522
  });
519
523
  }
520
- var unsubscribe = (0, import_firestore.onSnapshot)(collectionRef, function(snapshot3) {
524
+ var unsubscribe = (0, import_firestore2.onSnapshot)(collectionRef, function(snapshot3) {
521
525
  var firstTimeKey = JSON.stringify({
522
526
  collectionName: config.collectionName,
523
527
  conditions: config.conditions || [],
@@ -633,9 +637,6 @@ var chartsRegex = (0, import_xregexp.default)("[^\\p{L}0-9\\s.,_@!+-\\-]", "gu")
633
637
  // src/lib/utils.ts
634
638
  var import_clsx = require("clsx");
635
639
  var import_tailwind_merge = require("tailwind-merge");
636
- // src/helpers/time_helpers.ts
637
- var import_firestore2 = require("firebase/firestore");
638
- var import_moment_timezone = __toESM(require("moment-timezone"));
639
640
  // src/helpers/api.ts
640
641
  var import_axios2 = __toESM(require("axios"));
641
642
  var baseDomain = mode === "qa" ? "https://nx-api.xyz/api" : "https://nx-api.info/api";
@@ -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 moment from "moment";
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 = Timestamp.now;
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeyless-client-commons",
3
- "version": "1.1.69",
3
+ "version": "1.1.71",
4
4
  "scripts": {
5
5
  "build": "tsup",
6
6
  "deploy": "npm run build && npm version patch --no-git-tag-version && npm publish",