akeyless-client-commons 1.1.38 → 1.1.39
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 +18 -13
- package/dist/components/index.mjs +18 -13
- package/dist/helpers/index.js +18 -13
- package/dist/helpers/index.mjs +18 -13
- package/dist/hooks/index.js +3 -3
- package/dist/hooks/index.mjs +3 -3
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1157,32 +1157,37 @@ function cn() {
|
|
|
1157
1157
|
var import_firestore2 = require("firebase/firestore");
|
|
1158
1158
|
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
1159
1159
|
function timestamp_to_string(firebaseTimestamp, options) {
|
|
1160
|
+
var _options_defaultReturnedValue, _options_format, _options_fromFormat;
|
|
1161
|
+
var _ref = {
|
|
1162
|
+
defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-",
|
|
1163
|
+
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",
|
|
1164
|
+
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",
|
|
1165
|
+
tz: options === null || options === void 0 ? void 0 : options.tz
|
|
1166
|
+
}, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz;
|
|
1160
1167
|
if (!firebaseTimestamp) {
|
|
1161
|
-
|
|
1162
|
-
return (_options_defaultReturnedValue = options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-";
|
|
1168
|
+
return defaultReturnedValue;
|
|
1163
1169
|
}
|
|
1164
1170
|
var date;
|
|
1165
1171
|
if (_instanceof(firebaseTimestamp, import_firestore2.Timestamp)) {
|
|
1166
1172
|
date = firebaseTimestamp.toDate();
|
|
1167
1173
|
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
1168
1174
|
date = firebaseTimestamp;
|
|
1169
|
-
} else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
|
|
1170
|
-
date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
|
|
1171
1175
|
} else if (typeof firebaseTimestamp === "string") {
|
|
1172
|
-
date = import_moment_timezone.default.utc(firebaseTimestamp,
|
|
1176
|
+
date = import_moment_timezone.default.utc(firebaseTimestamp, fromFormat).toDate();
|
|
1173
1177
|
if (isNaN(date.getTime())) {
|
|
1174
|
-
|
|
1175
|
-
return (_options_defaultReturnedValue1 = options.defaultReturnedValue) !== null && _options_defaultReturnedValue1 !== void 0 ? _options_defaultReturnedValue1 : "-";
|
|
1178
|
+
return defaultReturnedValue;
|
|
1176
1179
|
}
|
|
1180
|
+
} else if (firebaseTimestamp._seconds) {
|
|
1181
|
+
var _firebaseTimestamp__nanoseconds;
|
|
1182
|
+
date = new Date(firebaseTimestamp._seconds * 1e3 + ((_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0) / 1e6);
|
|
1177
1183
|
} else {
|
|
1178
|
-
|
|
1179
|
-
return
|
|
1184
|
+
console.error("Invalid timestamp format: ", firebaseTimestamp);
|
|
1185
|
+
return defaultReturnedValue;
|
|
1180
1186
|
}
|
|
1181
|
-
if (
|
|
1182
|
-
|
|
1183
|
-
return result;
|
|
1187
|
+
if (tz) {
|
|
1188
|
+
return (0, import_moment_timezone.default)(date).tz(tz).format(format);
|
|
1184
1189
|
}
|
|
1185
|
-
return import_moment_timezone.default.utc(date).format(
|
|
1190
|
+
return import_moment_timezone.default.utc(date).format(format);
|
|
1186
1191
|
}
|
|
1187
1192
|
// src/helpers/api.ts
|
|
1188
1193
|
var import_axios2 = __toESM(require("axios"));
|
|
@@ -935,32 +935,37 @@ function cn() {
|
|
|
935
935
|
import { Timestamp as Timestamp2 } from "firebase/firestore";
|
|
936
936
|
import moment2 from "moment-timezone";
|
|
937
937
|
function timestamp_to_string(firebaseTimestamp, options) {
|
|
938
|
+
var _options_defaultReturnedValue, _options_format, _options_fromFormat;
|
|
939
|
+
var _ref = {
|
|
940
|
+
defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-",
|
|
941
|
+
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",
|
|
942
|
+
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",
|
|
943
|
+
tz: options === null || options === void 0 ? void 0 : options.tz
|
|
944
|
+
}, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz;
|
|
938
945
|
if (!firebaseTimestamp) {
|
|
939
|
-
|
|
940
|
-
return (_options_defaultReturnedValue = options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-";
|
|
946
|
+
return defaultReturnedValue;
|
|
941
947
|
}
|
|
942
948
|
var date;
|
|
943
949
|
if (_instanceof(firebaseTimestamp, Timestamp2)) {
|
|
944
950
|
date = firebaseTimestamp.toDate();
|
|
945
951
|
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
946
952
|
date = firebaseTimestamp;
|
|
947
|
-
} else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
|
|
948
|
-
date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
|
|
949
953
|
} else if (typeof firebaseTimestamp === "string") {
|
|
950
|
-
date = moment2.utc(firebaseTimestamp,
|
|
954
|
+
date = moment2.utc(firebaseTimestamp, fromFormat).toDate();
|
|
951
955
|
if (isNaN(date.getTime())) {
|
|
952
|
-
|
|
953
|
-
return (_options_defaultReturnedValue1 = options.defaultReturnedValue) !== null && _options_defaultReturnedValue1 !== void 0 ? _options_defaultReturnedValue1 : "-";
|
|
956
|
+
return defaultReturnedValue;
|
|
954
957
|
}
|
|
958
|
+
} else if (firebaseTimestamp._seconds) {
|
|
959
|
+
var _firebaseTimestamp__nanoseconds;
|
|
960
|
+
date = new Date(firebaseTimestamp._seconds * 1e3 + ((_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0) / 1e6);
|
|
955
961
|
} else {
|
|
956
|
-
|
|
957
|
-
return
|
|
962
|
+
console.error("Invalid timestamp format: ", firebaseTimestamp);
|
|
963
|
+
return defaultReturnedValue;
|
|
958
964
|
}
|
|
959
|
-
if (
|
|
960
|
-
|
|
961
|
-
return result;
|
|
965
|
+
if (tz) {
|
|
966
|
+
return moment2(date).tz(tz).format(format);
|
|
962
967
|
}
|
|
963
|
-
return moment2.utc(date).format(
|
|
968
|
+
return moment2.utc(date).format(format);
|
|
964
969
|
}
|
|
965
970
|
// src/helpers/api.ts
|
|
966
971
|
import axios2 from "axios";
|
package/dist/helpers/index.js
CHANGED
|
@@ -2335,32 +2335,37 @@ function cn() {
|
|
|
2335
2335
|
var import_firestore2 = require("firebase/firestore");
|
|
2336
2336
|
var import_moment_timezone = __toESM(require("moment-timezone"));
|
|
2337
2337
|
function timestamp_to_string(firebaseTimestamp, options) {
|
|
2338
|
+
var _options_defaultReturnedValue, _options_format, _options_fromFormat;
|
|
2339
|
+
var _ref = {
|
|
2340
|
+
defaultReturnedValue: (_options_defaultReturnedValue = options === null || options === void 0 ? void 0 : options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-",
|
|
2341
|
+
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",
|
|
2342
|
+
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",
|
|
2343
|
+
tz: options === null || options === void 0 ? void 0 : options.tz
|
|
2344
|
+
}, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz;
|
|
2338
2345
|
if (!firebaseTimestamp) {
|
|
2339
|
-
|
|
2340
|
-
return (_options_defaultReturnedValue = options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-";
|
|
2346
|
+
return defaultReturnedValue;
|
|
2341
2347
|
}
|
|
2342
2348
|
var date;
|
|
2343
2349
|
if (_instanceof(firebaseTimestamp, import_firestore2.Timestamp)) {
|
|
2344
2350
|
date = firebaseTimestamp.toDate();
|
|
2345
2351
|
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
2346
2352
|
date = firebaseTimestamp;
|
|
2347
|
-
} else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
|
|
2348
|
-
date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
|
|
2349
2353
|
} else if (typeof firebaseTimestamp === "string") {
|
|
2350
|
-
date = import_moment_timezone.default.utc(firebaseTimestamp,
|
|
2354
|
+
date = import_moment_timezone.default.utc(firebaseTimestamp, fromFormat).toDate();
|
|
2351
2355
|
if (isNaN(date.getTime())) {
|
|
2352
|
-
|
|
2353
|
-
return (_options_defaultReturnedValue1 = options.defaultReturnedValue) !== null && _options_defaultReturnedValue1 !== void 0 ? _options_defaultReturnedValue1 : "-";
|
|
2356
|
+
return defaultReturnedValue;
|
|
2354
2357
|
}
|
|
2358
|
+
} else if (firebaseTimestamp._seconds) {
|
|
2359
|
+
var _firebaseTimestamp__nanoseconds;
|
|
2360
|
+
date = new Date(firebaseTimestamp._seconds * 1e3 + ((_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0) / 1e6);
|
|
2355
2361
|
} else {
|
|
2356
|
-
|
|
2357
|
-
return
|
|
2362
|
+
console.error("Invalid timestamp format: ", firebaseTimestamp);
|
|
2363
|
+
return defaultReturnedValue;
|
|
2358
2364
|
}
|
|
2359
|
-
if (
|
|
2360
|
-
|
|
2361
|
-
return result;
|
|
2365
|
+
if (tz) {
|
|
2366
|
+
return (0, import_moment_timezone.default)(date).tz(tz).format(format);
|
|
2362
2367
|
}
|
|
2363
|
-
return import_moment_timezone.default.utc(date).format(
|
|
2368
|
+
return import_moment_timezone.default.utc(date).format(format);
|
|
2364
2369
|
}
|
|
2365
2370
|
function timestamp_to_millis(firebaseTimestamp) {
|
|
2366
2371
|
if (!firebaseTimestamp) {
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1956,32 +1956,37 @@ function cn() {
|
|
|
1956
1956
|
import { Timestamp as Timestamp2 } from "firebase/firestore";
|
|
1957
1957
|
import moment2 from "moment-timezone";
|
|
1958
1958
|
function timestamp_to_string(firebaseTimestamp, options) {
|
|
1959
|
+
var _options_defaultReturnedValue, _options_format, _options_fromFormat;
|
|
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
|
+
}, defaultReturnedValue = _ref.defaultReturnedValue, format = _ref.format, fromFormat = _ref.fromFormat, tz = _ref.tz;
|
|
1959
1966
|
if (!firebaseTimestamp) {
|
|
1960
|
-
|
|
1961
|
-
return (_options_defaultReturnedValue = options.defaultReturnedValue) !== null && _options_defaultReturnedValue !== void 0 ? _options_defaultReturnedValue : "-";
|
|
1967
|
+
return defaultReturnedValue;
|
|
1962
1968
|
}
|
|
1963
1969
|
var date;
|
|
1964
1970
|
if (_instanceof(firebaseTimestamp, Timestamp2)) {
|
|
1965
1971
|
date = firebaseTimestamp.toDate();
|
|
1966
1972
|
} else if (_instanceof(firebaseTimestamp, Date)) {
|
|
1967
1973
|
date = firebaseTimestamp;
|
|
1968
|
-
} else if (firebaseTimestamp._seconds && firebaseTimestamp._nanoseconds) {
|
|
1969
|
-
date = new Date(firebaseTimestamp._seconds * 1e3 + firebaseTimestamp._nanoseconds / 1e6);
|
|
1970
1974
|
} else if (typeof firebaseTimestamp === "string") {
|
|
1971
|
-
date = moment2.utc(firebaseTimestamp,
|
|
1975
|
+
date = moment2.utc(firebaseTimestamp, fromFormat).toDate();
|
|
1972
1976
|
if (isNaN(date.getTime())) {
|
|
1973
|
-
|
|
1974
|
-
return (_options_defaultReturnedValue1 = options.defaultReturnedValue) !== null && _options_defaultReturnedValue1 !== void 0 ? _options_defaultReturnedValue1 : "-";
|
|
1977
|
+
return defaultReturnedValue;
|
|
1975
1978
|
}
|
|
1979
|
+
} else if (firebaseTimestamp._seconds) {
|
|
1980
|
+
var _firebaseTimestamp__nanoseconds;
|
|
1981
|
+
date = new Date(firebaseTimestamp._seconds * 1e3 + ((_firebaseTimestamp__nanoseconds = firebaseTimestamp._nanoseconds) !== null && _firebaseTimestamp__nanoseconds !== void 0 ? _firebaseTimestamp__nanoseconds : 0) / 1e6);
|
|
1976
1982
|
} else {
|
|
1977
|
-
|
|
1978
|
-
return
|
|
1983
|
+
console.error("Invalid timestamp format: ", firebaseTimestamp);
|
|
1984
|
+
return defaultReturnedValue;
|
|
1979
1985
|
}
|
|
1980
|
-
if (
|
|
1981
|
-
|
|
1982
|
-
return result;
|
|
1986
|
+
if (tz) {
|
|
1987
|
+
return moment2(date).tz(tz).format(format);
|
|
1983
1988
|
}
|
|
1984
|
-
return moment2.utc(date).format(
|
|
1989
|
+
return moment2.utc(date).format(format);
|
|
1985
1990
|
}
|
|
1986
1991
|
function timestamp_to_millis(firebaseTimestamp) {
|
|
1987
1992
|
if (!firebaseTimestamp) {
|
package/dist/hooks/index.js
CHANGED
|
@@ -1285,9 +1285,9 @@ var useWebWorker = function(fn, options) {
|
|
|
1285
1285
|
};
|
|
1286
1286
|
return runWorker;
|
|
1287
1287
|
};
|
|
1288
|
-
// src/hooks/snapshots.ts
|
|
1288
|
+
// src/hooks/snapshots/index.ts
|
|
1289
1289
|
var import_react5 = require("react");
|
|
1290
|
-
// src/hooks/snapshotWorker.ts
|
|
1290
|
+
// src/hooks/snapshots/snapshotWorker.ts
|
|
1291
1291
|
var wrapConfigsWithWorker = function(cfgs, runProcessor, options) {
|
|
1292
1292
|
var recentEvents = /* @__PURE__ */ new Map();
|
|
1293
1293
|
var _options_eventTtlMs;
|
|
@@ -1411,7 +1411,7 @@ var wrapConfigsWithWorker = function(cfgs, runProcessor, options) {
|
|
|
1411
1411
|
return wrapped;
|
|
1412
1412
|
});
|
|
1413
1413
|
};
|
|
1414
|
-
// src/hooks/snapshots.ts
|
|
1414
|
+
// src/hooks/snapshots/index.ts
|
|
1415
1415
|
var useDbSnapshots = function(configs, label, settings) {
|
|
1416
1416
|
var snapshotsFirstTime = (0, import_react5.useRef)([]);
|
|
1417
1417
|
var unsubscribeFunctions = (0, import_react5.useRef)([]);
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1188,9 +1188,9 @@ var useWebWorker = function(fn, options) {
|
|
|
1188
1188
|
};
|
|
1189
1189
|
return runWorker;
|
|
1190
1190
|
};
|
|
1191
|
-
// src/hooks/snapshots.ts
|
|
1191
|
+
// src/hooks/snapshots/index.ts
|
|
1192
1192
|
import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef4, useState as useState2 } from "react";
|
|
1193
|
-
// src/hooks/snapshotWorker.ts
|
|
1193
|
+
// src/hooks/snapshots/snapshotWorker.ts
|
|
1194
1194
|
var wrapConfigsWithWorker = function(cfgs, runProcessor, options) {
|
|
1195
1195
|
var recentEvents = /* @__PURE__ */ new Map();
|
|
1196
1196
|
var _options_eventTtlMs;
|
|
@@ -1314,7 +1314,7 @@ var wrapConfigsWithWorker = function(cfgs, runProcessor, options) {
|
|
|
1314
1314
|
return wrapped;
|
|
1315
1315
|
});
|
|
1316
1316
|
};
|
|
1317
|
-
// src/hooks/snapshots.ts
|
|
1317
|
+
// src/hooks/snapshots/index.ts
|
|
1318
1318
|
var useDbSnapshots = function(configs, label, settings) {
|
|
1319
1319
|
var snapshotsFirstTime = useRef4([]);
|
|
1320
1320
|
var unsubscribeFunctions = useRef4([]);
|