akeyless-client-commons 1.1.19 → 1.1.20
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 +43 -41
- package/dist/components/index.mjs +43 -41
- package/dist/helpers/index.d.mts +3 -1
- package/dist/helpers/index.d.ts +3 -1
- package/dist/helpers/index.js +95 -3
- package/dist/helpers/index.mjs +88 -4
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.mjs +2 -0
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -631,6 +631,7 @@ var parsePermissions = function(object) {
|
|
|
631
631
|
return result;
|
|
632
632
|
};
|
|
633
633
|
// src/helpers/firebase.ts
|
|
634
|
+
var import_storage2 = require("firebase/storage");
|
|
634
635
|
var import_meta = {};
|
|
635
636
|
var initApp = function() {
|
|
636
637
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
@@ -643,6 +644,7 @@ var initApp = function() {
|
|
|
643
644
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID
|
|
644
645
|
};
|
|
645
646
|
try {
|
|
647
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
646
648
|
var app2 = (0, import_app.initializeApp)(firebaseConfig);
|
|
647
649
|
var auth2 = (0, import_auth.getAuth)(app2);
|
|
648
650
|
auth2.settings.appVerificationDisabledForTesting = false;
|
|
@@ -946,7 +948,7 @@ var addLoginAudit = /*#__PURE__*/ function() {
|
|
|
946
948
|
}();
|
|
947
949
|
var addAuditRecord = /*#__PURE__*/ function() {
|
|
948
950
|
var _ref = _async_to_generator(function(action, entity, details, user) {
|
|
949
|
-
var
|
|
951
|
+
var ref2, data, error;
|
|
950
952
|
return _ts_generator(this, function(_state) {
|
|
951
953
|
switch(_state.label){
|
|
952
954
|
case 0:
|
|
@@ -956,7 +958,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
956
958
|
,
|
|
957
959
|
3
|
|
958
960
|
]);
|
|
959
|
-
|
|
961
|
+
ref2 = (0, import_firestore.doc)(collections.audit);
|
|
960
962
|
data = {
|
|
961
963
|
action: action,
|
|
962
964
|
entity: entity,
|
|
@@ -971,7 +973,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
971
973
|
};
|
|
972
974
|
return [
|
|
973
975
|
4,
|
|
974
|
-
(0, import_firestore.setDoc)(
|
|
976
|
+
(0, import_firestore.setDoc)(ref2, _object_spread_props(_object_spread({}, data), {
|
|
975
977
|
datetime: fire_base_TIME_TEMP()
|
|
976
978
|
}))
|
|
977
979
|
];
|
|
@@ -2068,7 +2070,7 @@ var buttonVariants = (0, import_class_variance_authority2.cva)("inline-flex item
|
|
|
2068
2070
|
size: "default"
|
|
2069
2071
|
}
|
|
2070
2072
|
});
|
|
2071
|
-
var Button = React4.forwardRef(function(_param,
|
|
2073
|
+
var Button = React4.forwardRef(function(_param, ref2) {
|
|
2072
2074
|
var className = _param.className, variant = _param.variant, size3 = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties(_param, [
|
|
2073
2075
|
"className",
|
|
2074
2076
|
"variant",
|
|
@@ -2077,7 +2079,7 @@ var Button = React4.forwardRef(function(_param, ref) {
|
|
|
2077
2079
|
]);
|
|
2078
2080
|
var Comp = asChild ? import_react_slot.Slot : "button";
|
|
2079
2081
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Comp, _object_spread({
|
|
2080
|
-
ref:
|
|
2082
|
+
ref: ref2,
|
|
2081
2083
|
"data-slot": "button",
|
|
2082
2084
|
className: cn(buttonVariants({
|
|
2083
2085
|
variant: variant,
|
|
@@ -2090,7 +2092,7 @@ Button.displayName = "Button";
|
|
|
2090
2092
|
// src/components/ui/input.tsx
|
|
2091
2093
|
var React5 = __toESM(require("react"));
|
|
2092
2094
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2093
|
-
var Input = React5.forwardRef(function(_param,
|
|
2095
|
+
var Input = React5.forwardRef(function(_param, ref2) {
|
|
2094
2096
|
var className = _param.className, type = _param.type, props = _object_without_properties(_param, [
|
|
2095
2097
|
"className",
|
|
2096
2098
|
"type"
|
|
@@ -2098,7 +2100,7 @@ var Input = React5.forwardRef(function(_param, ref) {
|
|
|
2098
2100
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", _object_spread({
|
|
2099
2101
|
type: type,
|
|
2100
2102
|
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
2101
|
-
ref:
|
|
2103
|
+
ref: ref2
|
|
2102
2104
|
}, props));
|
|
2103
2105
|
});
|
|
2104
2106
|
Input.displayName = "Input";
|
|
@@ -2106,7 +2108,7 @@ Input.displayName = "Input";
|
|
|
2106
2108
|
var React6 = __toESM(require("react"));
|
|
2107
2109
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
|
2108
2110
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2109
|
-
var ProgressComponent = React6.forwardRef(function(_param,
|
|
2111
|
+
var ProgressComponent = React6.forwardRef(function(_param, ref2) {
|
|
2110
2112
|
var className = _param.className, value = _param.value, containerClassName = _param.containerClassName, indicatorClassName = _param.indicatorClassName, showValueClassName = _param.showValueClassName, _param_showValue = _param.showValue, showValue = _param_showValue === void 0 ? false : _param_showValue, props = _object_without_properties(_param, [
|
|
2111
2113
|
"className",
|
|
2112
2114
|
"value",
|
|
@@ -2118,7 +2120,7 @@ var ProgressComponent = React6.forwardRef(function(_param, ref) {
|
|
|
2118
2120
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", {
|
|
2119
2121
|
className: cn("relative w-full", containerClassName),
|
|
2120
2122
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProgressPrimitive.Root, _object_spread_props(_object_spread({
|
|
2121
|
-
ref:
|
|
2123
|
+
ref: ref2,
|
|
2122
2124
|
className: cn("w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full", className)
|
|
2123
2125
|
}, props), {
|
|
2124
2126
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProgressPrimitive.Indicator, {
|
|
@@ -2151,17 +2153,17 @@ var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
|
2151
2153
|
var import_lucide_react = require("lucide-react");
|
|
2152
2154
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2153
2155
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2154
|
-
var DialogOverlay = React7.forwardRef(function(_param,
|
|
2156
|
+
var DialogOverlay = React7.forwardRef(function(_param, ref2) {
|
|
2155
2157
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2156
2158
|
"className"
|
|
2157
2159
|
]);
|
|
2158
2160
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Overlay, _object_spread({
|
|
2159
|
-
ref:
|
|
2161
|
+
ref: ref2,
|
|
2160
2162
|
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
2161
2163
|
}, props));
|
|
2162
2164
|
});
|
|
2163
2165
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2164
|
-
var DialogContent = React7.forwardRef(function(_param,
|
|
2166
|
+
var DialogContent = React7.forwardRef(function(_param, ref2) {
|
|
2165
2167
|
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
2166
2168
|
"className",
|
|
2167
2169
|
"children"
|
|
@@ -2170,7 +2172,7 @@ var DialogContent = React7.forwardRef(function(_param, ref) {
|
|
|
2170
2172
|
children: [
|
|
2171
2173
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, {}),
|
|
2172
2174
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPrimitive.Content, _object_spread_props(_object_spread({
|
|
2173
|
-
ref:
|
|
2175
|
+
ref: ref2,
|
|
2174
2176
|
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className)
|
|
2175
2177
|
}, props), {
|
|
2176
2178
|
children: [
|
|
@@ -2211,39 +2213,39 @@ var DialogFooter = function(_param) {
|
|
|
2211
2213
|
}, props));
|
|
2212
2214
|
};
|
|
2213
2215
|
DialogFooter.displayName = "DialogFooter";
|
|
2214
|
-
var DialogTitle = React7.forwardRef(function(_param,
|
|
2216
|
+
var DialogTitle = React7.forwardRef(function(_param, ref2) {
|
|
2215
2217
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2216
2218
|
"className"
|
|
2217
2219
|
]);
|
|
2218
2220
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Title, _object_spread({
|
|
2219
|
-
ref:
|
|
2221
|
+
ref: ref2,
|
|
2220
2222
|
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
2221
2223
|
}, props));
|
|
2222
2224
|
});
|
|
2223
2225
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2224
|
-
var DialogDescription = React7.forwardRef(function(_param,
|
|
2226
|
+
var DialogDescription = React7.forwardRef(function(_param, ref2) {
|
|
2225
2227
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2226
2228
|
"className"
|
|
2227
2229
|
]);
|
|
2228
2230
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Description, _object_spread({
|
|
2229
|
-
ref:
|
|
2231
|
+
ref: ref2,
|
|
2230
2232
|
className: cn("text-sm text-muted-foreground", className)
|
|
2231
2233
|
}, props));
|
|
2232
2234
|
});
|
|
2233
2235
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2234
2236
|
// src/components/ui/command.tsx
|
|
2235
2237
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2236
|
-
var Command = React8.forwardRef(function(_param,
|
|
2238
|
+
var Command = React8.forwardRef(function(_param, ref2) {
|
|
2237
2239
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2238
2240
|
"className"
|
|
2239
2241
|
]);
|
|
2240
2242
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command, _object_spread({
|
|
2241
|
-
ref:
|
|
2243
|
+
ref: ref2,
|
|
2242
2244
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground", className)
|
|
2243
2245
|
}, props));
|
|
2244
2246
|
});
|
|
2245
2247
|
Command.displayName = import_cmdk.Command.displayName;
|
|
2246
|
-
var CommandInput = React8.forwardRef(function(_param,
|
|
2248
|
+
var CommandInput = React8.forwardRef(function(_param, ref2) {
|
|
2247
2249
|
var className = _param.className, withSearchIcon = _param.withSearchIcon, props = _object_without_properties(_param, [
|
|
2248
2250
|
"className",
|
|
2249
2251
|
"withSearchIcon"
|
|
@@ -2258,56 +2260,56 @@ var CommandInput = React8.forwardRef(function(_param, ref) {
|
|
|
2258
2260
|
className: "me-3 text-muted-foreground/80"
|
|
2259
2261
|
}),
|
|
2260
2262
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Input, _object_spread({
|
|
2261
|
-
ref:
|
|
2263
|
+
ref: ref2,
|
|
2262
2264
|
className: cn("flex h-10 w-full rounded-lg bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
2263
2265
|
}, props))
|
|
2264
2266
|
]
|
|
2265
2267
|
});
|
|
2266
2268
|
});
|
|
2267
2269
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
2268
|
-
var CommandList = React8.forwardRef(function(_param,
|
|
2270
|
+
var CommandList = React8.forwardRef(function(_param, ref2) {
|
|
2269
2271
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2270
2272
|
"className"
|
|
2271
2273
|
]);
|
|
2272
2274
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.List, _object_spread({
|
|
2273
|
-
ref:
|
|
2275
|
+
ref: ref2,
|
|
2274
2276
|
className: cn("max-h-80 overflow-y-auto overflow-x-hidden", className)
|
|
2275
2277
|
}, props));
|
|
2276
2278
|
});
|
|
2277
2279
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
2278
|
-
var CommandEmpty = React8.forwardRef(function(props,
|
|
2280
|
+
var CommandEmpty = React8.forwardRef(function(props, ref2) {
|
|
2279
2281
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Empty, _object_spread({
|
|
2280
|
-
ref:
|
|
2282
|
+
ref: ref2,
|
|
2281
2283
|
className: "py-6 text-center text-sm"
|
|
2282
2284
|
}, props));
|
|
2283
2285
|
});
|
|
2284
2286
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
2285
|
-
var CommandGroup = React8.forwardRef(function(_param,
|
|
2287
|
+
var CommandGroup = React8.forwardRef(function(_param, ref2) {
|
|
2286
2288
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2287
2289
|
"className"
|
|
2288
2290
|
]);
|
|
2289
2291
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Group, _object_spread({
|
|
2290
|
-
ref:
|
|
2292
|
+
ref: ref2,
|
|
2291
2293
|
className: cn("overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)
|
|
2292
2294
|
}, props));
|
|
2293
2295
|
});
|
|
2294
2296
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
2295
|
-
var CommandSeparator = React8.forwardRef(function(_param,
|
|
2297
|
+
var CommandSeparator = React8.forwardRef(function(_param, ref2) {
|
|
2296
2298
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2297
2299
|
"className"
|
|
2298
2300
|
]);
|
|
2299
2301
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Separator, _object_spread({
|
|
2300
|
-
ref:
|
|
2302
|
+
ref: ref2,
|
|
2301
2303
|
className: cn("-mx-1 h-px bg-border", className)
|
|
2302
2304
|
}, props));
|
|
2303
2305
|
});
|
|
2304
2306
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
2305
|
-
var CommandItem = React8.forwardRef(function(_param,
|
|
2307
|
+
var CommandItem = React8.forwardRef(function(_param, ref2) {
|
|
2306
2308
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2307
2309
|
"className"
|
|
2308
2310
|
]);
|
|
2309
2311
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_cmdk.Command.Item, _object_spread({
|
|
2310
|
-
ref:
|
|
2312
|
+
ref: ref2,
|
|
2311
2313
|
className: cn("relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className)
|
|
2312
2314
|
}, props));
|
|
2313
2315
|
});
|
|
@@ -3949,11 +3951,11 @@ function roundByDPR(element, value) {
|
|
|
3949
3951
|
return Math.round(value * dpr) / dpr;
|
|
3950
3952
|
}
|
|
3951
3953
|
function useLatestRef(value) {
|
|
3952
|
-
var
|
|
3954
|
+
var ref2 = React9.useRef(value);
|
|
3953
3955
|
index(function() {
|
|
3954
|
-
|
|
3956
|
+
ref2.current = value;
|
|
3955
3957
|
});
|
|
3956
|
-
return
|
|
3958
|
+
return ref2;
|
|
3957
3959
|
}
|
|
3958
3960
|
function useFloating(options) {
|
|
3959
3961
|
if (options === void 0) {
|
|
@@ -4262,7 +4264,7 @@ function useDebounce(value, delay) {
|
|
|
4262
4264
|
]);
|
|
4263
4265
|
return debouncedValue;
|
|
4264
4266
|
}
|
|
4265
|
-
var MultipleSelector = (0, import_react9.forwardRef)(function(param,
|
|
4267
|
+
var MultipleSelector = (0, import_react9.forwardRef)(function(param, ref2) {
|
|
4266
4268
|
var value = param.value, onChange = param.onChange, placeholder = param.placeholder, tmp = param.defaultOptions, arrayDefaultOptions = tmp === void 0 ? [] : tmp, arrayOptions = param.options, delay = param.delay, onSearch = param.onSearch, onSearchSync = param.onSearchSync, loadingIndicator = param.loadingIndicator, emptyIndicator = param.emptyIndicator, _param_maxSelected = param.maxSelected, maxSelected = _param_maxSelected === void 0 ? Number.MAX_SAFE_INTEGER : _param_maxSelected, onMaxSelected = param.onMaxSelected, _param_hidePlaceholderWhenSelected = param.hidePlaceholderWhenSelected, hidePlaceholderWhenSelected = _param_hidePlaceholderWhenSelected === void 0 ? true : _param_hidePlaceholderWhenSelected, disabled = param.disabled, groupBy = param.groupBy, className = param.className, badgeClassName = param.badgeClassName, _param_selectFirstItem = param.selectFirstItem, selectFirstItem = _param_selectFirstItem === void 0 ? true : _param_selectFirstItem, createNewOptionLabel = param.createNewOptionLabel, _param_triggerSearchOnFocus = param.triggerSearchOnFocus, triggerSearchOnFocus = _param_triggerSearchOnFocus === void 0 ? true : _param_triggerSearchOnFocus, commandProps = param.commandProps, inputProps = param.inputProps, _param_hideClearAllButton = param.hideClearAllButton, hideClearAllButton = _param_hideClearAllButton === void 0 ? false : _param_hideClearAllButton, _param_closeDropdownOnSelect = param.closeDropdownOnSelect, closeDropdownOnSelect = _param_closeDropdownOnSelect === void 0 ? false : _param_closeDropdownOnSelect, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, emptyIndicatorClassName = param.emptyIndicatorClassName, _param_unremovableOptions = param.unremovableOptions, unremovableOptions = _param_unremovableOptions === void 0 ? [] : _param_unremovableOptions, name = param.name, _param_dropdownContainerClassName = param.dropdownContainerClassName, dropdownContainerClassName = _param_dropdownContainerClassName === void 0 ? "" : _param_dropdownContainerClassName;
|
|
4267
4269
|
var _containerRef_current;
|
|
4268
4270
|
var _import_react8_default_useState = _sliced_to_array(import_react8.default.useState(false), 2), isLoading = _import_react8_default_useState[0], setIsLoading = _import_react8_default_useState[1];
|
|
@@ -4288,7 +4290,7 @@ var MultipleSelector = (0, import_react9.forwardRef)(function(param, ref) {
|
|
|
4288
4290
|
var _import_react8_default_useState4 = _sliced_to_array(import_react8.default.useState(transToGroupOption(arrayDefaultOptions, groupBy)), 2), options = _import_react8_default_useState4[0], setOptions = _import_react8_default_useState4[1];
|
|
4289
4291
|
var _import_react8_default_useState5 = _sliced_to_array(import_react8.default.useState(""), 2), inputValue = _import_react8_default_useState5[0], setInputValue = _import_react8_default_useState5[1];
|
|
4290
4292
|
var debouncedSearchTerm = useDebounce(inputValue, delay || 500);
|
|
4291
|
-
import_react8.default.useImperativeHandle(
|
|
4293
|
+
import_react8.default.useImperativeHandle(ref2, function() {
|
|
4292
4294
|
return {
|
|
4293
4295
|
selectedValue: _to_consumable_array(selected),
|
|
4294
4296
|
input: inputRef.current,
|
|
@@ -5684,7 +5686,7 @@ function InternationalPhonePicker(param) {
|
|
|
5684
5686
|
]
|
|
5685
5687
|
});
|
|
5686
5688
|
}
|
|
5687
|
-
var PhoneInput = (0, import_react13.forwardRef)(function(_param,
|
|
5689
|
+
var PhoneInput = (0, import_react13.forwardRef)(function(_param, ref2) {
|
|
5688
5690
|
var className = _param.className, onKeyDown = _param.onKeyDown, defaultValue = _param.defaultValue, style = _param.style, defaultFocus = _param.defaultFocus, disabled = _param.disabled, props = _object_without_properties(_param, [
|
|
5689
5691
|
"className",
|
|
5690
5692
|
"onKeyDown",
|
|
@@ -5708,10 +5710,10 @@ var PhoneInput = (0, import_react13.forwardRef)(function(_param, ref) {
|
|
|
5708
5710
|
disabled: disabled,
|
|
5709
5711
|
ref: function(el) {
|
|
5710
5712
|
inputRef.current = el;
|
|
5711
|
-
if (typeof
|
|
5712
|
-
|
|
5713
|
-
} else if (
|
|
5714
|
-
|
|
5713
|
+
if (typeof ref2 === "function") {
|
|
5714
|
+
ref2(el);
|
|
5715
|
+
} else if (ref2) {
|
|
5716
|
+
ref2.current = el;
|
|
5715
5717
|
}
|
|
5716
5718
|
}
|
|
5717
5719
|
}, props));
|
|
@@ -411,6 +411,7 @@ var parsePermissions = function(object) {
|
|
|
411
411
|
return result;
|
|
412
412
|
};
|
|
413
413
|
// src/helpers/firebase.ts
|
|
414
|
+
import { ref, getDownloadURL, uploadBytes } from "firebase/storage";
|
|
414
415
|
var initApp = function() {
|
|
415
416
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
416
417
|
var firebaseConfig = {
|
|
@@ -422,6 +423,7 @@ var initApp = function() {
|
|
|
422
423
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID
|
|
423
424
|
};
|
|
424
425
|
try {
|
|
426
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
425
427
|
var app2 = initializeApp(firebaseConfig);
|
|
426
428
|
var auth2 = getAuth(app2);
|
|
427
429
|
auth2.settings.appVerificationDisabledForTesting = false;
|
|
@@ -725,7 +727,7 @@ var addLoginAudit = /*#__PURE__*/ function() {
|
|
|
725
727
|
}();
|
|
726
728
|
var addAuditRecord = /*#__PURE__*/ function() {
|
|
727
729
|
var _ref = _async_to_generator(function(action, entity, details, user) {
|
|
728
|
-
var
|
|
730
|
+
var ref2, data, error;
|
|
729
731
|
return _ts_generator(this, function(_state) {
|
|
730
732
|
switch(_state.label){
|
|
731
733
|
case 0:
|
|
@@ -735,7 +737,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
735
737
|
,
|
|
736
738
|
3
|
|
737
739
|
]);
|
|
738
|
-
|
|
740
|
+
ref2 = doc(collections.audit);
|
|
739
741
|
data = {
|
|
740
742
|
action: action,
|
|
741
743
|
entity: entity,
|
|
@@ -750,7 +752,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
750
752
|
};
|
|
751
753
|
return [
|
|
752
754
|
4,
|
|
753
|
-
setDoc(
|
|
755
|
+
setDoc(ref2, _object_spread_props(_object_spread({}, data), {
|
|
754
756
|
datetime: fire_base_TIME_TEMP()
|
|
755
757
|
}))
|
|
756
758
|
];
|
|
@@ -1846,7 +1848,7 @@ var buttonVariants = cva2("inline-flex items-center justify-center gap-2 whitesp
|
|
|
1846
1848
|
size: "default"
|
|
1847
1849
|
}
|
|
1848
1850
|
});
|
|
1849
|
-
var Button = React4.forwardRef(function(_param,
|
|
1851
|
+
var Button = React4.forwardRef(function(_param, ref2) {
|
|
1850
1852
|
var className = _param.className, variant = _param.variant, size3 = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties(_param, [
|
|
1851
1853
|
"className",
|
|
1852
1854
|
"variant",
|
|
@@ -1855,7 +1857,7 @@ var Button = React4.forwardRef(function(_param, ref) {
|
|
|
1855
1857
|
]);
|
|
1856
1858
|
var Comp = asChild ? Slot : "button";
|
|
1857
1859
|
return /* @__PURE__ */ jsx10(Comp, _object_spread({
|
|
1858
|
-
ref:
|
|
1860
|
+
ref: ref2,
|
|
1859
1861
|
"data-slot": "button",
|
|
1860
1862
|
className: cn(buttonVariants({
|
|
1861
1863
|
variant: variant,
|
|
@@ -1868,7 +1870,7 @@ Button.displayName = "Button";
|
|
|
1868
1870
|
// src/components/ui/input.tsx
|
|
1869
1871
|
import * as React5 from "react";
|
|
1870
1872
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1871
|
-
var Input = React5.forwardRef(function(_param,
|
|
1873
|
+
var Input = React5.forwardRef(function(_param, ref2) {
|
|
1872
1874
|
var className = _param.className, type = _param.type, props = _object_without_properties(_param, [
|
|
1873
1875
|
"className",
|
|
1874
1876
|
"type"
|
|
@@ -1876,7 +1878,7 @@ var Input = React5.forwardRef(function(_param, ref) {
|
|
|
1876
1878
|
return /* @__PURE__ */ jsx11("input", _object_spread({
|
|
1877
1879
|
type: type,
|
|
1878
1880
|
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className),
|
|
1879
|
-
ref:
|
|
1881
|
+
ref: ref2
|
|
1880
1882
|
}, props));
|
|
1881
1883
|
});
|
|
1882
1884
|
Input.displayName = "Input";
|
|
@@ -1884,7 +1886,7 @@ Input.displayName = "Input";
|
|
|
1884
1886
|
import * as React6 from "react";
|
|
1885
1887
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
1886
1888
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1887
|
-
var ProgressComponent = React6.forwardRef(function(_param,
|
|
1889
|
+
var ProgressComponent = React6.forwardRef(function(_param, ref2) {
|
|
1888
1890
|
var className = _param.className, value = _param.value, containerClassName = _param.containerClassName, indicatorClassName = _param.indicatorClassName, showValueClassName = _param.showValueClassName, _param_showValue = _param.showValue, showValue = _param_showValue === void 0 ? false : _param_showValue, props = _object_without_properties(_param, [
|
|
1889
1891
|
"className",
|
|
1890
1892
|
"value",
|
|
@@ -1896,7 +1898,7 @@ var ProgressComponent = React6.forwardRef(function(_param, ref) {
|
|
|
1896
1898
|
return /* @__PURE__ */ jsx12("div", {
|
|
1897
1899
|
className: cn("relative w-full", containerClassName),
|
|
1898
1900
|
children: /* @__PURE__ */ jsx12(ProgressPrimitive.Root, _object_spread_props(_object_spread({
|
|
1899
|
-
ref:
|
|
1901
|
+
ref: ref2,
|
|
1900
1902
|
className: cn("w-full h-5 bg-[#e5e7eb] relative overflow-hidden rounded-full", className)
|
|
1901
1903
|
}, props), {
|
|
1902
1904
|
children: /* @__PURE__ */ jsx12(ProgressPrimitive.Indicator, {
|
|
@@ -1929,17 +1931,17 @@ import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
|
1929
1931
|
import { X } from "lucide-react";
|
|
1930
1932
|
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1931
1933
|
var DialogPortal = DialogPrimitive.Portal;
|
|
1932
|
-
var DialogOverlay = React7.forwardRef(function(_param,
|
|
1934
|
+
var DialogOverlay = React7.forwardRef(function(_param, ref2) {
|
|
1933
1935
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1934
1936
|
"className"
|
|
1935
1937
|
]);
|
|
1936
1938
|
return /* @__PURE__ */ jsx13(DialogPrimitive.Overlay, _object_spread({
|
|
1937
|
-
ref:
|
|
1939
|
+
ref: ref2,
|
|
1938
1940
|
className: cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className)
|
|
1939
1941
|
}, props));
|
|
1940
1942
|
});
|
|
1941
1943
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1942
|
-
var DialogContent = React7.forwardRef(function(_param,
|
|
1944
|
+
var DialogContent = React7.forwardRef(function(_param, ref2) {
|
|
1943
1945
|
var className = _param.className, children = _param.children, props = _object_without_properties(_param, [
|
|
1944
1946
|
"className",
|
|
1945
1947
|
"children"
|
|
@@ -1948,7 +1950,7 @@ var DialogContent = React7.forwardRef(function(_param, ref) {
|
|
|
1948
1950
|
children: [
|
|
1949
1951
|
/* @__PURE__ */ jsx13(DialogOverlay, {}),
|
|
1950
1952
|
/* @__PURE__ */ jsxs7(DialogPrimitive.Content, _object_spread_props(_object_spread({
|
|
1951
|
-
ref:
|
|
1953
|
+
ref: ref2,
|
|
1952
1954
|
className: cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", className)
|
|
1953
1955
|
}, props), {
|
|
1954
1956
|
children: [
|
|
@@ -1989,39 +1991,39 @@ var DialogFooter = function(_param) {
|
|
|
1989
1991
|
}, props));
|
|
1990
1992
|
};
|
|
1991
1993
|
DialogFooter.displayName = "DialogFooter";
|
|
1992
|
-
var DialogTitle = React7.forwardRef(function(_param,
|
|
1994
|
+
var DialogTitle = React7.forwardRef(function(_param, ref2) {
|
|
1993
1995
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
1994
1996
|
"className"
|
|
1995
1997
|
]);
|
|
1996
1998
|
return /* @__PURE__ */ jsx13(DialogPrimitive.Title, _object_spread({
|
|
1997
|
-
ref:
|
|
1999
|
+
ref: ref2,
|
|
1998
2000
|
className: cn("text-lg font-semibold leading-none tracking-tight", className)
|
|
1999
2001
|
}, props));
|
|
2000
2002
|
});
|
|
2001
2003
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2002
|
-
var DialogDescription = React7.forwardRef(function(_param,
|
|
2004
|
+
var DialogDescription = React7.forwardRef(function(_param, ref2) {
|
|
2003
2005
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2004
2006
|
"className"
|
|
2005
2007
|
]);
|
|
2006
2008
|
return /* @__PURE__ */ jsx13(DialogPrimitive.Description, _object_spread({
|
|
2007
|
-
ref:
|
|
2009
|
+
ref: ref2,
|
|
2008
2010
|
className: cn("text-sm text-muted-foreground", className)
|
|
2009
2011
|
}, props));
|
|
2010
2012
|
});
|
|
2011
2013
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2012
2014
|
// src/components/ui/command.tsx
|
|
2013
2015
|
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2014
|
-
var Command = React8.forwardRef(function(_param,
|
|
2016
|
+
var Command = React8.forwardRef(function(_param, ref2) {
|
|
2015
2017
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2016
2018
|
"className"
|
|
2017
2019
|
]);
|
|
2018
2020
|
return /* @__PURE__ */ jsx14(CommandPrimitive, _object_spread({
|
|
2019
|
-
ref:
|
|
2021
|
+
ref: ref2,
|
|
2020
2022
|
className: cn("flex h-full w-full flex-col overflow-hidden rounded-lg bg-popover text-popover-foreground", className)
|
|
2021
2023
|
}, props));
|
|
2022
2024
|
});
|
|
2023
2025
|
Command.displayName = CommandPrimitive.displayName;
|
|
2024
|
-
var CommandInput = React8.forwardRef(function(_param,
|
|
2026
|
+
var CommandInput = React8.forwardRef(function(_param, ref2) {
|
|
2025
2027
|
var className = _param.className, withSearchIcon = _param.withSearchIcon, props = _object_without_properties(_param, [
|
|
2026
2028
|
"className",
|
|
2027
2029
|
"withSearchIcon"
|
|
@@ -2036,56 +2038,56 @@ var CommandInput = React8.forwardRef(function(_param, ref) {
|
|
|
2036
2038
|
className: "me-3 text-muted-foreground/80"
|
|
2037
2039
|
}),
|
|
2038
2040
|
/* @__PURE__ */ jsx14(CommandPrimitive.Input, _object_spread({
|
|
2039
|
-
ref:
|
|
2041
|
+
ref: ref2,
|
|
2040
2042
|
className: cn("flex h-10 w-full rounded-lg bg-transparent py-2 text-sm outline-none placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50", className)
|
|
2041
2043
|
}, props))
|
|
2042
2044
|
]
|
|
2043
2045
|
});
|
|
2044
2046
|
});
|
|
2045
2047
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
2046
|
-
var CommandList = React8.forwardRef(function(_param,
|
|
2048
|
+
var CommandList = React8.forwardRef(function(_param, ref2) {
|
|
2047
2049
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2048
2050
|
"className"
|
|
2049
2051
|
]);
|
|
2050
2052
|
return /* @__PURE__ */ jsx14(CommandPrimitive.List, _object_spread({
|
|
2051
|
-
ref:
|
|
2053
|
+
ref: ref2,
|
|
2052
2054
|
className: cn("max-h-80 overflow-y-auto overflow-x-hidden", className)
|
|
2053
2055
|
}, props));
|
|
2054
2056
|
});
|
|
2055
2057
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
2056
|
-
var CommandEmpty = React8.forwardRef(function(props,
|
|
2058
|
+
var CommandEmpty = React8.forwardRef(function(props, ref2) {
|
|
2057
2059
|
return /* @__PURE__ */ jsx14(CommandPrimitive.Empty, _object_spread({
|
|
2058
|
-
ref:
|
|
2060
|
+
ref: ref2,
|
|
2059
2061
|
className: "py-6 text-center text-sm"
|
|
2060
2062
|
}, props));
|
|
2061
2063
|
});
|
|
2062
2064
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
2063
|
-
var CommandGroup = React8.forwardRef(function(_param,
|
|
2065
|
+
var CommandGroup = React8.forwardRef(function(_param, ref2) {
|
|
2064
2066
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2065
2067
|
"className"
|
|
2066
2068
|
]);
|
|
2067
2069
|
return /* @__PURE__ */ jsx14(CommandPrimitive.Group, _object_spread({
|
|
2068
|
-
ref:
|
|
2070
|
+
ref: ref2,
|
|
2069
2071
|
className: cn("overflow-hidden p-2 text-foreground [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground", className)
|
|
2070
2072
|
}, props));
|
|
2071
2073
|
});
|
|
2072
2074
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
2073
|
-
var CommandSeparator = React8.forwardRef(function(_param,
|
|
2075
|
+
var CommandSeparator = React8.forwardRef(function(_param, ref2) {
|
|
2074
2076
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2075
2077
|
"className"
|
|
2076
2078
|
]);
|
|
2077
2079
|
return /* @__PURE__ */ jsx14(CommandPrimitive.Separator, _object_spread({
|
|
2078
|
-
ref:
|
|
2080
|
+
ref: ref2,
|
|
2079
2081
|
className: cn("-mx-1 h-px bg-border", className)
|
|
2080
2082
|
}, props));
|
|
2081
2083
|
});
|
|
2082
2084
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
2083
|
-
var CommandItem = React8.forwardRef(function(_param,
|
|
2085
|
+
var CommandItem = React8.forwardRef(function(_param, ref2) {
|
|
2084
2086
|
var className = _param.className, props = _object_without_properties(_param, [
|
|
2085
2087
|
"className"
|
|
2086
2088
|
]);
|
|
2087
2089
|
return /* @__PURE__ */ jsx14(CommandPrimitive.Item, _object_spread({
|
|
2088
|
-
ref:
|
|
2090
|
+
ref: ref2,
|
|
2089
2091
|
className: cn("relative flex cursor-default select-none items-center gap-3 rounded-md px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className)
|
|
2090
2092
|
}, props));
|
|
2091
2093
|
});
|
|
@@ -3727,11 +3729,11 @@ function roundByDPR(element, value) {
|
|
|
3727
3729
|
return Math.round(value * dpr) / dpr;
|
|
3728
3730
|
}
|
|
3729
3731
|
function useLatestRef(value) {
|
|
3730
|
-
var
|
|
3732
|
+
var ref2 = React9.useRef(value);
|
|
3731
3733
|
index(function() {
|
|
3732
|
-
|
|
3734
|
+
ref2.current = value;
|
|
3733
3735
|
});
|
|
3734
|
-
return
|
|
3736
|
+
return ref2;
|
|
3735
3737
|
}
|
|
3736
3738
|
function useFloating(options) {
|
|
3737
3739
|
if (options === void 0) {
|
|
@@ -4040,7 +4042,7 @@ function useDebounce(value, delay) {
|
|
|
4040
4042
|
]);
|
|
4041
4043
|
return debouncedValue;
|
|
4042
4044
|
}
|
|
4043
|
-
var MultipleSelector = forwardRef6(function(param,
|
|
4045
|
+
var MultipleSelector = forwardRef6(function(param, ref2) {
|
|
4044
4046
|
var value = param.value, onChange = param.onChange, placeholder = param.placeholder, tmp = param.defaultOptions, arrayDefaultOptions = tmp === void 0 ? [] : tmp, arrayOptions = param.options, delay = param.delay, onSearch = param.onSearch, onSearchSync = param.onSearchSync, loadingIndicator = param.loadingIndicator, emptyIndicator = param.emptyIndicator, _param_maxSelected = param.maxSelected, maxSelected = _param_maxSelected === void 0 ? Number.MAX_SAFE_INTEGER : _param_maxSelected, onMaxSelected = param.onMaxSelected, _param_hidePlaceholderWhenSelected = param.hidePlaceholderWhenSelected, hidePlaceholderWhenSelected = _param_hidePlaceholderWhenSelected === void 0 ? true : _param_hidePlaceholderWhenSelected, disabled = param.disabled, groupBy = param.groupBy, className = param.className, badgeClassName = param.badgeClassName, _param_selectFirstItem = param.selectFirstItem, selectFirstItem = _param_selectFirstItem === void 0 ? true : _param_selectFirstItem, createNewOptionLabel = param.createNewOptionLabel, _param_triggerSearchOnFocus = param.triggerSearchOnFocus, triggerSearchOnFocus = _param_triggerSearchOnFocus === void 0 ? true : _param_triggerSearchOnFocus, commandProps = param.commandProps, inputProps = param.inputProps, _param_hideClearAllButton = param.hideClearAllButton, hideClearAllButton = _param_hideClearAllButton === void 0 ? false : _param_hideClearAllButton, _param_closeDropdownOnSelect = param.closeDropdownOnSelect, closeDropdownOnSelect = _param_closeDropdownOnSelect === void 0 ? false : _param_closeDropdownOnSelect, dropdownClassName = param.dropdownClassName, dropdownOptionClassName = param.dropdownOptionClassName, emptyIndicatorClassName = param.emptyIndicatorClassName, _param_unremovableOptions = param.unremovableOptions, unremovableOptions = _param_unremovableOptions === void 0 ? [] : _param_unremovableOptions, name = param.name, _param_dropdownContainerClassName = param.dropdownContainerClassName, dropdownContainerClassName = _param_dropdownContainerClassName === void 0 ? "" : _param_dropdownContainerClassName;
|
|
4045
4047
|
var _containerRef_current;
|
|
4046
4048
|
var _React10_useState = _sliced_to_array(React10.useState(false), 2), isLoading = _React10_useState[0], setIsLoading = _React10_useState[1];
|
|
@@ -4066,7 +4068,7 @@ var MultipleSelector = forwardRef6(function(param, ref) {
|
|
|
4066
4068
|
var _React10_useState4 = _sliced_to_array(React10.useState(transToGroupOption(arrayDefaultOptions, groupBy)), 2), options = _React10_useState4[0], setOptions = _React10_useState4[1];
|
|
4067
4069
|
var _React10_useState5 = _sliced_to_array(React10.useState(""), 2), inputValue = _React10_useState5[0], setInputValue = _React10_useState5[1];
|
|
4068
4070
|
var debouncedSearchTerm = useDebounce(inputValue, delay || 500);
|
|
4069
|
-
React10.useImperativeHandle(
|
|
4071
|
+
React10.useImperativeHandle(ref2, function() {
|
|
4070
4072
|
return {
|
|
4071
4073
|
selectedValue: _to_consumable_array(selected),
|
|
4072
4074
|
input: inputRef.current,
|
|
@@ -5462,7 +5464,7 @@ function InternationalPhonePicker(param) {
|
|
|
5462
5464
|
]
|
|
5463
5465
|
});
|
|
5464
5466
|
}
|
|
5465
|
-
var PhoneInput = forwardRef7(function(_param,
|
|
5467
|
+
var PhoneInput = forwardRef7(function(_param, ref2) {
|
|
5466
5468
|
var className = _param.className, onKeyDown = _param.onKeyDown, defaultValue = _param.defaultValue, style = _param.style, defaultFocus = _param.defaultFocus, disabled = _param.disabled, props = _object_without_properties(_param, [
|
|
5467
5469
|
"className",
|
|
5468
5470
|
"onKeyDown",
|
|
@@ -5486,10 +5488,10 @@ var PhoneInput = forwardRef7(function(_param, ref) {
|
|
|
5486
5488
|
disabled: disabled,
|
|
5487
5489
|
ref: function(el) {
|
|
5488
5490
|
inputRef.current = el;
|
|
5489
|
-
if (typeof
|
|
5490
|
-
|
|
5491
|
-
} else if (
|
|
5492
|
-
|
|
5491
|
+
if (typeof ref2 === "function") {
|
|
5492
|
+
ref2(el);
|
|
5493
|
+
} else if (ref2) {
|
|
5494
|
+
ref2.current = el;
|
|
5493
5495
|
}
|
|
5494
5496
|
}
|
|
5495
5497
|
}, props));
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -159,6 +159,8 @@ declare const addAuditRecord: (action: string, entity: string, details: TObject<
|
|
|
159
159
|
};
|
|
160
160
|
}>;
|
|
161
161
|
declare const validateUserStatusAndPermissions: (user: NxUser, app: AppName) => TObject<TObject<boolean>>;
|
|
162
|
+
declare const getFileFromStorage: (filePath: string) => Promise<string>;
|
|
163
|
+
declare const uploadFileToStorage: (file: File, filePath: string) => Promise<string>;
|
|
162
164
|
|
|
163
165
|
declare const calculateBearing: (startLat: any, startLng: any, endLat: any, endLng: any) => number;
|
|
164
166
|
declare const renderOnce: () => boolean;
|
|
@@ -258,4 +260,4 @@ declare const initializeUserPermissions: ({ phoneNumber, email, firstTimeArray,
|
|
|
258
260
|
permissions: TObject<TObject<boolean>>;
|
|
259
261
|
}>;
|
|
260
262
|
|
|
261
|
-
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, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
263
|
+
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, getFileFromStorage, 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, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -159,6 +159,8 @@ declare const addAuditRecord: (action: string, entity: string, details: TObject<
|
|
|
159
159
|
};
|
|
160
160
|
}>;
|
|
161
161
|
declare const validateUserStatusAndPermissions: (user: NxUser, app: AppName) => TObject<TObject<boolean>>;
|
|
162
|
+
declare const getFileFromStorage: (filePath: string) => Promise<string>;
|
|
163
|
+
declare const uploadFileToStorage: (file: File, filePath: string) => Promise<string>;
|
|
162
164
|
|
|
163
165
|
declare const calculateBearing: (startLat: any, startLng: any, endLat: any, endLng: any) => number;
|
|
164
166
|
declare const renderOnce: () => boolean;
|
|
@@ -258,4 +260,4 @@ declare const initializeUserPermissions: ({ phoneNumber, email, firstTimeArray,
|
|
|
258
260
|
permissions: TObject<TObject<boolean>>;
|
|
259
261
|
}>;
|
|
260
262
|
|
|
261
|
-
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, sort_by_timestamp, storage, textNumbersRegex, textRegex, timestamp_to_millis, timestamp_to_string, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
263
|
+
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, getFileFromStorage, 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, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
package/dist/helpers/index.js
CHANGED
|
@@ -416,6 +416,9 @@ __export(index_exports, {
|
|
|
416
416
|
getAddressByGeo: function() {
|
|
417
417
|
return getAddressByGeo;
|
|
418
418
|
},
|
|
419
|
+
getFileFromStorage: function() {
|
|
420
|
+
return getFileFromStorage;
|
|
421
|
+
},
|
|
419
422
|
getFixedNumber: function() {
|
|
420
423
|
return getFixedNumber;
|
|
421
424
|
},
|
|
@@ -572,6 +575,9 @@ __export(index_exports, {
|
|
|
572
575
|
timestamp_to_string: function() {
|
|
573
576
|
return timestamp_to_string;
|
|
574
577
|
},
|
|
578
|
+
uploadFileToStorage: function() {
|
|
579
|
+
return uploadFileToStorage;
|
|
580
|
+
},
|
|
575
581
|
useLoginWithGoogle: function() {
|
|
576
582
|
return useLoginWithGoogle;
|
|
577
583
|
},
|
|
@@ -763,6 +769,7 @@ var initializeUserPermissions = /*#__PURE__*/ function() {
|
|
|
763
769
|
};
|
|
764
770
|
}();
|
|
765
771
|
// src/helpers/firebase.ts
|
|
772
|
+
var import_storage2 = require("firebase/storage");
|
|
766
773
|
var import_meta = {};
|
|
767
774
|
var initApp = function() {
|
|
768
775
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
@@ -775,6 +782,7 @@ var initApp = function() {
|
|
|
775
782
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID
|
|
776
783
|
};
|
|
777
784
|
try {
|
|
785
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
778
786
|
var app2 = (0, import_app.initializeApp)(firebaseConfig);
|
|
779
787
|
var auth2 = (0, import_auth.getAuth)(app2);
|
|
780
788
|
auth2.settings.appVerificationDisabledForTesting = false;
|
|
@@ -1748,7 +1756,7 @@ var addLoginAudit = /*#__PURE__*/ function() {
|
|
|
1748
1756
|
}();
|
|
1749
1757
|
var addAuditRecord = /*#__PURE__*/ function() {
|
|
1750
1758
|
var _ref = _async_to_generator(function(action, entity, details, user) {
|
|
1751
|
-
var
|
|
1759
|
+
var ref2, data, error;
|
|
1752
1760
|
return _ts_generator(this, function(_state) {
|
|
1753
1761
|
switch(_state.label){
|
|
1754
1762
|
case 0:
|
|
@@ -1758,7 +1766,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
1758
1766
|
,
|
|
1759
1767
|
3
|
|
1760
1768
|
]);
|
|
1761
|
-
|
|
1769
|
+
ref2 = (0, import_firestore.doc)(collections.audit);
|
|
1762
1770
|
data = {
|
|
1763
1771
|
action: action,
|
|
1764
1772
|
entity: entity,
|
|
@@ -1773,7 +1781,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
1773
1781
|
};
|
|
1774
1782
|
return [
|
|
1775
1783
|
4,
|
|
1776
|
-
(0, import_firestore.setDoc)(
|
|
1784
|
+
(0, import_firestore.setDoc)(ref2, _object_spread_props(_object_spread({}, data), {
|
|
1777
1785
|
datetime: fire_base_TIME_TEMP()
|
|
1778
1786
|
}))
|
|
1779
1787
|
];
|
|
@@ -1811,6 +1819,88 @@ var validateUserStatusAndPermissions = function(user, app2) {
|
|
|
1811
1819
|
}
|
|
1812
1820
|
return userPermissions;
|
|
1813
1821
|
};
|
|
1822
|
+
var getFileFromStorage = /*#__PURE__*/ function() {
|
|
1823
|
+
var _ref = _async_to_generator(function(filePath) {
|
|
1824
|
+
var fileRef, downloadURL, error;
|
|
1825
|
+
return _ts_generator(this, function(_state) {
|
|
1826
|
+
switch(_state.label){
|
|
1827
|
+
case 0:
|
|
1828
|
+
_state.trys.push([
|
|
1829
|
+
0,
|
|
1830
|
+
2,
|
|
1831
|
+
,
|
|
1832
|
+
3
|
|
1833
|
+
]);
|
|
1834
|
+
fileRef = (0, import_storage2.ref)(storage, filePath);
|
|
1835
|
+
return [
|
|
1836
|
+
4,
|
|
1837
|
+
(0, import_storage2.getDownloadURL)(fileRef)
|
|
1838
|
+
];
|
|
1839
|
+
case 1:
|
|
1840
|
+
downloadURL = _state.sent();
|
|
1841
|
+
return [
|
|
1842
|
+
2,
|
|
1843
|
+
downloadURL
|
|
1844
|
+
];
|
|
1845
|
+
case 2:
|
|
1846
|
+
error = _state.sent();
|
|
1847
|
+
console.error("Error getting file from storage: ".concat(filePath), error);
|
|
1848
|
+
throw new Error("Failed to get file from storage: ".concat(filePath));
|
|
1849
|
+
case 3:
|
|
1850
|
+
return [
|
|
1851
|
+
2
|
|
1852
|
+
];
|
|
1853
|
+
}
|
|
1854
|
+
});
|
|
1855
|
+
});
|
|
1856
|
+
return function getFileFromStorage(filePath) {
|
|
1857
|
+
return _ref.apply(this, arguments);
|
|
1858
|
+
};
|
|
1859
|
+
}();
|
|
1860
|
+
var uploadFileToStorage = /*#__PURE__*/ function() {
|
|
1861
|
+
var _ref = _async_to_generator(function(file, filePath) {
|
|
1862
|
+
var fileRef, uploadResult, downloadURL, error;
|
|
1863
|
+
return _ts_generator(this, function(_state) {
|
|
1864
|
+
switch(_state.label){
|
|
1865
|
+
case 0:
|
|
1866
|
+
_state.trys.push([
|
|
1867
|
+
0,
|
|
1868
|
+
3,
|
|
1869
|
+
,
|
|
1870
|
+
4
|
|
1871
|
+
]);
|
|
1872
|
+
fileRef = (0, import_storage2.ref)(storage, filePath);
|
|
1873
|
+
return [
|
|
1874
|
+
4,
|
|
1875
|
+
(0, import_storage2.uploadBytes)(fileRef, file)
|
|
1876
|
+
];
|
|
1877
|
+
case 1:
|
|
1878
|
+
uploadResult = _state.sent();
|
|
1879
|
+
return [
|
|
1880
|
+
4,
|
|
1881
|
+
(0, import_storage2.getDownloadURL)(uploadResult.ref)
|
|
1882
|
+
];
|
|
1883
|
+
case 2:
|
|
1884
|
+
downloadURL = _state.sent();
|
|
1885
|
+
return [
|
|
1886
|
+
2,
|
|
1887
|
+
downloadURL
|
|
1888
|
+
];
|
|
1889
|
+
case 3:
|
|
1890
|
+
error = _state.sent();
|
|
1891
|
+
console.error("Error uploading file to storage: ".concat(filePath), error);
|
|
1892
|
+
throw new Error("Failed to upload file to storage: ".concat(filePath));
|
|
1893
|
+
case 4:
|
|
1894
|
+
return [
|
|
1895
|
+
2
|
|
1896
|
+
];
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
});
|
|
1900
|
+
return function uploadFileToStorage(file, filePath) {
|
|
1901
|
+
return _ref.apply(this, arguments);
|
|
1902
|
+
};
|
|
1903
|
+
}();
|
|
1814
1904
|
// src/helpers/global.ts
|
|
1815
1905
|
var import_akeyless_types_commons = require("akeyless-types-commons");
|
|
1816
1906
|
var import_axios = __toESM(require("axios"));
|
|
@@ -2300,6 +2390,7 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2300
2390
|
fire_base_TIME_TEMP: fire_base_TIME_TEMP,
|
|
2301
2391
|
formatCarNumber: formatCarNumber,
|
|
2302
2392
|
getAddressByGeo: getAddressByGeo,
|
|
2393
|
+
getFileFromStorage: getFileFromStorage,
|
|
2303
2394
|
getFixedNumber: getFixedNumber,
|
|
2304
2395
|
getFormCheckboxValue: getFormCheckboxValue,
|
|
2305
2396
|
getFormElementValue: getFormElementValue,
|
|
@@ -2352,6 +2443,7 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
2352
2443
|
textRegex: textRegex,
|
|
2353
2444
|
timestamp_to_millis: timestamp_to_millis,
|
|
2354
2445
|
timestamp_to_string: timestamp_to_string,
|
|
2446
|
+
uploadFileToStorage: uploadFileToStorage,
|
|
2355
2447
|
useLoginWithGoogle: useLoginWithGoogle,
|
|
2356
2448
|
useStoreValues: useStoreValues,
|
|
2357
2449
|
useValidation: useValidation,
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -410,6 +410,7 @@ var initializeUserPermissions = /*#__PURE__*/ function() {
|
|
|
410
410
|
};
|
|
411
411
|
}();
|
|
412
412
|
// src/helpers/firebase.ts
|
|
413
|
+
import { ref, getDownloadURL, uploadBytes } from "firebase/storage";
|
|
413
414
|
var initApp = function() {
|
|
414
415
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
415
416
|
var firebaseConfig = {
|
|
@@ -421,6 +422,7 @@ var initApp = function() {
|
|
|
421
422
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID
|
|
422
423
|
};
|
|
423
424
|
try {
|
|
425
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
424
426
|
var app2 = initializeApp(firebaseConfig);
|
|
425
427
|
var auth2 = getAuth(app2);
|
|
426
428
|
auth2.settings.appVerificationDisabledForTesting = false;
|
|
@@ -1394,7 +1396,7 @@ var addLoginAudit = /*#__PURE__*/ function() {
|
|
|
1394
1396
|
}();
|
|
1395
1397
|
var addAuditRecord = /*#__PURE__*/ function() {
|
|
1396
1398
|
var _ref = _async_to_generator(function(action, entity, details, user) {
|
|
1397
|
-
var
|
|
1399
|
+
var ref2, data, error;
|
|
1398
1400
|
return _ts_generator(this, function(_state) {
|
|
1399
1401
|
switch(_state.label){
|
|
1400
1402
|
case 0:
|
|
@@ -1404,7 +1406,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
1404
1406
|
,
|
|
1405
1407
|
3
|
|
1406
1408
|
]);
|
|
1407
|
-
|
|
1409
|
+
ref2 = doc(collections.audit);
|
|
1408
1410
|
data = {
|
|
1409
1411
|
action: action,
|
|
1410
1412
|
entity: entity,
|
|
@@ -1419,7 +1421,7 @@ var addAuditRecord = /*#__PURE__*/ function() {
|
|
|
1419
1421
|
};
|
|
1420
1422
|
return [
|
|
1421
1423
|
4,
|
|
1422
|
-
setDoc(
|
|
1424
|
+
setDoc(ref2, _object_spread_props(_object_spread({}, data), {
|
|
1423
1425
|
datetime: fire_base_TIME_TEMP()
|
|
1424
1426
|
}))
|
|
1425
1427
|
];
|
|
@@ -1457,6 +1459,88 @@ var validateUserStatusAndPermissions = function(user, app2) {
|
|
|
1457
1459
|
}
|
|
1458
1460
|
return userPermissions;
|
|
1459
1461
|
};
|
|
1462
|
+
var getFileFromStorage = /*#__PURE__*/ function() {
|
|
1463
|
+
var _ref = _async_to_generator(function(filePath) {
|
|
1464
|
+
var fileRef, downloadURL, error;
|
|
1465
|
+
return _ts_generator(this, function(_state) {
|
|
1466
|
+
switch(_state.label){
|
|
1467
|
+
case 0:
|
|
1468
|
+
_state.trys.push([
|
|
1469
|
+
0,
|
|
1470
|
+
2,
|
|
1471
|
+
,
|
|
1472
|
+
3
|
|
1473
|
+
]);
|
|
1474
|
+
fileRef = ref(storage, filePath);
|
|
1475
|
+
return [
|
|
1476
|
+
4,
|
|
1477
|
+
getDownloadURL(fileRef)
|
|
1478
|
+
];
|
|
1479
|
+
case 1:
|
|
1480
|
+
downloadURL = _state.sent();
|
|
1481
|
+
return [
|
|
1482
|
+
2,
|
|
1483
|
+
downloadURL
|
|
1484
|
+
];
|
|
1485
|
+
case 2:
|
|
1486
|
+
error = _state.sent();
|
|
1487
|
+
console.error("Error getting file from storage: ".concat(filePath), error);
|
|
1488
|
+
throw new Error("Failed to get file from storage: ".concat(filePath));
|
|
1489
|
+
case 3:
|
|
1490
|
+
return [
|
|
1491
|
+
2
|
|
1492
|
+
];
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
});
|
|
1496
|
+
return function getFileFromStorage(filePath) {
|
|
1497
|
+
return _ref.apply(this, arguments);
|
|
1498
|
+
};
|
|
1499
|
+
}();
|
|
1500
|
+
var uploadFileToStorage = /*#__PURE__*/ function() {
|
|
1501
|
+
var _ref = _async_to_generator(function(file, filePath) {
|
|
1502
|
+
var fileRef, uploadResult, downloadURL, error;
|
|
1503
|
+
return _ts_generator(this, function(_state) {
|
|
1504
|
+
switch(_state.label){
|
|
1505
|
+
case 0:
|
|
1506
|
+
_state.trys.push([
|
|
1507
|
+
0,
|
|
1508
|
+
3,
|
|
1509
|
+
,
|
|
1510
|
+
4
|
|
1511
|
+
]);
|
|
1512
|
+
fileRef = ref(storage, filePath);
|
|
1513
|
+
return [
|
|
1514
|
+
4,
|
|
1515
|
+
uploadBytes(fileRef, file)
|
|
1516
|
+
];
|
|
1517
|
+
case 1:
|
|
1518
|
+
uploadResult = _state.sent();
|
|
1519
|
+
return [
|
|
1520
|
+
4,
|
|
1521
|
+
getDownloadURL(uploadResult.ref)
|
|
1522
|
+
];
|
|
1523
|
+
case 2:
|
|
1524
|
+
downloadURL = _state.sent();
|
|
1525
|
+
return [
|
|
1526
|
+
2,
|
|
1527
|
+
downloadURL
|
|
1528
|
+
];
|
|
1529
|
+
case 3:
|
|
1530
|
+
error = _state.sent();
|
|
1531
|
+
console.error("Error uploading file to storage: ".concat(filePath), error);
|
|
1532
|
+
throw new Error("Failed to upload file to storage: ".concat(filePath));
|
|
1533
|
+
case 4:
|
|
1534
|
+
return [
|
|
1535
|
+
2
|
|
1536
|
+
];
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
});
|
|
1540
|
+
return function uploadFileToStorage(file, filePath) {
|
|
1541
|
+
return _ref.apply(this, arguments);
|
|
1542
|
+
};
|
|
1543
|
+
}();
|
|
1460
1544
|
// src/helpers/global.ts
|
|
1461
1545
|
import { CountryOptions, LanguageOptions } from "akeyless-types-commons";
|
|
1462
1546
|
import axios from "axios";
|
|
@@ -1906,5 +1990,5 @@ var nxApiCall = /*#__PURE__*/ function() {
|
|
|
1906
1990
|
return _ref.apply(this, arguments);
|
|
1907
1991
|
};
|
|
1908
1992
|
}();
|
|
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 };
|
|
1993
|
+
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, getFileFromStorage, 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, uploadFileToStorage, useLoginWithGoogle, useStoreValues, useValidation, userNameFormat, validateAndCast, validateUserStatusAndPermissions };
|
|
1910
1994
|
//# sourceMappingURL=index.mjs.map
|
package/dist/hooks/index.js
CHANGED
|
@@ -293,6 +293,7 @@ var checkUserPermissions = function(userPermissions, entity, permissions, mode2)
|
|
|
293
293
|
};
|
|
294
294
|
checkUserPermissions({}, "dashboard", []);
|
|
295
295
|
// src/helpers/firebase.ts
|
|
296
|
+
var import_storage2 = require("firebase/storage");
|
|
296
297
|
var import_meta = {};
|
|
297
298
|
var initApp = function() {
|
|
298
299
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
@@ -305,6 +306,7 @@ var initApp = function() {
|
|
|
305
306
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import_meta.env.VITE_APP_ID
|
|
306
307
|
};
|
|
307
308
|
try {
|
|
309
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
308
310
|
var app2 = (0, import_app.initializeApp)(firebaseConfig);
|
|
309
311
|
var auth2 = (0, import_auth.getAuth)(app2);
|
|
310
312
|
auth2.settings.appVerificationDisabledForTesting = false;
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -207,6 +207,7 @@ var checkUserPermissions = function(userPermissions, entity, permissions, mode2)
|
|
|
207
207
|
};
|
|
208
208
|
checkUserPermissions({}, "dashboard", []);
|
|
209
209
|
// src/helpers/firebase.ts
|
|
210
|
+
import { ref, getDownloadURL, uploadBytes } from "firebase/storage";
|
|
210
211
|
var initApp = function() {
|
|
211
212
|
var isNodeEnv2 = typeof process !== "undefined" && process.env;
|
|
212
213
|
var firebaseConfig = {
|
|
@@ -218,6 +219,7 @@ var initApp = function() {
|
|
|
218
219
|
appId: isNodeEnv2 ? process.env.NEXT_PUBLIC_APP_ID : import.meta.env.VITE_APP_ID
|
|
219
220
|
};
|
|
220
221
|
try {
|
|
222
|
+
console.log("firebaseConfig", firebaseConfig);
|
|
221
223
|
var app2 = initializeApp(firebaseConfig);
|
|
222
224
|
var auth2 = getAuth(app2);
|
|
223
225
|
auth2.settings.appVerificationDisabledForTesting = false;
|