@povio/ui 2.1.21 → 2.2.0
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/Accordion.js +32 -0
- package/dist/AccordionItem.js +62 -0
- package/dist/Alert.js +1 -1
- package/dist/ArrowDropDown.js +1 -1
- package/dist/ArrowDropUp.js +1 -1
- package/dist/ArrowLeft.js +1 -1
- package/dist/ArrowRight.js +1 -1
- package/dist/BottomSheet.js +1 -1
- package/dist/Breadcrumbs.js +111 -0
- package/dist/Button.js +1 -1
- package/dist/ButtonContent.js +1 -1
- package/dist/Calendar.js +1 -1
- package/dist/Check.js +1 -1
- package/dist/CheckCircle.js +1 -1
- package/dist/CheckContent.js +1 -1
- package/dist/ChevronDown.js +1 -1
- package/dist/ChevronUp.js +1 -1
- package/dist/Clock.js +1 -1
- package/dist/ColorPickerDropdown.js +1 -1
- package/dist/DatePickerInput.js +1 -1
- package/dist/DateRangePicker.js +2 -2
- package/dist/DateTime.js +2 -4
- package/dist/{Drag.js → DragIndicator.js} +2 -2
- package/dist/File.js +1 -1
- package/dist/FileUpload.js +1 -1
- package/dist/Home.js +13 -0
- package/dist/Info.js +2 -2
- package/dist/InputContent.js +1 -1
- package/dist/InputUploadContent.js +1 -1
- package/dist/Menu.js +1 -1
- package/dist/MenuDesktop.js +1 -1
- package/dist/MenuItem.js +1 -1
- package/dist/MenuMobile.js +2 -2
- package/dist/MenuPopover.js +2 -2
- package/dist/NumberInput.js +1 -1
- package/dist/PasswordInput.js +3 -3
- package/dist/Segment.js +1 -1
- package/dist/SelectDesktop.js +1 -1
- package/dist/SelectInput.js +1 -1
- package/dist/SelectListBoxItem.js +2 -2
- package/dist/SelectListBoxItemSelectAll.js +1 -1
- package/dist/SelectListBoxLoadingItem.js +1 -1
- package/dist/SelectMobile.js +1 -1
- package/dist/Stepper.js +32 -0
- package/dist/StepperItem.js +52 -0
- package/dist/StepperSeparator.js +10 -0
- package/dist/Table.js +2 -2
- package/dist/TextArea.js +1 -1
- package/dist/TextInput.js +1 -1
- package/dist/TimePickerInput.js +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Tooltip.js +2 -2
- package/dist/Typography.js +1 -1
- package/dist/Visibility.js +13 -0
- package/dist/VisibilityOff.js +13 -0
- package/dist/YearPicker.js +1 -1
- package/dist/accordion.cva.js +97 -0
- package/dist/assets/icons/{ViewOff.d.ts → Account.d.ts} +1 -1
- package/dist/assets/icons/Board.d.ts +2 -0
- package/dist/assets/icons/DragIndicator.d.ts +2 -0
- package/dist/assets/icons/{Drag.d.ts → Edit.d.ts} +1 -1
- package/dist/assets/icons/Emoji.d.ts +2 -0
- package/dist/assets/icons/{View.d.ts → Grid.d.ts} +1 -1
- package/dist/assets/icons/Home.d.ts +2 -0
- package/dist/assets/icons/Image.d.ts +2 -0
- package/dist/assets/icons/ImageError.d.ts +2 -0
- package/dist/assets/icons/Loader.d.ts +2 -0
- package/dist/assets/icons/MapPin.d.ts +2 -0
- package/dist/assets/icons/Minus.d.ts +2 -0
- package/dist/assets/icons/MoreHoriz.d.ts +2 -0
- package/dist/assets/icons/Pause.d.ts +2 -0
- package/dist/assets/icons/Plus.d.ts +2 -0
- package/dist/assets/icons/Retry.d.ts +2 -0
- package/dist/assets/icons/Search.d.ts +2 -0
- package/dist/assets/icons/Share.d.ts +2 -0
- package/dist/assets/icons/Slash.d.ts +2 -0
- package/dist/assets/icons/Trash.d.ts +2 -0
- package/dist/assets/icons/User.d.ts +2 -0
- package/dist/assets/icons/Visibility.d.ts +2 -0
- package/dist/assets/icons/VisibilityOff.d.ts +2 -0
- package/dist/assets/icons/WarningOutlined.d.ts +2 -0
- package/dist/breadcrumbs.cva.js +22 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +15 -0
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +19 -0
- package/dist/components/Menu/Menu.d.ts +2 -2
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/Inputs/InputItem.d.ts +1 -1
- package/dist/components/inputs/shared/input.cva.d.ts +2 -2
- package/dist/components/inputs/shared/label.cva.d.ts +2 -2
- package/dist/components/navigation/Accordion/Accordion.d.ts +3 -0
- package/dist/components/navigation/Accordion/AccordionItem.d.ts +2 -0
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +45 -0
- package/dist/components/navigation/Accordion/accordion.types.d.ts +52 -0
- package/dist/components/navigation/Stepper/Stepper.d.ts +2 -0
- package/dist/components/navigation/Stepper/StepperItem.d.ts +2 -0
- package/dist/components/navigation/Stepper/StepperSeparator.d.ts +5 -0
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +37 -0
- package/dist/components/navigation/Stepper/stepper.types.d.ts +41 -0
- package/dist/config/i18n.d.ts +0 -15
- package/dist/config/uiStyle.context.d.ts +31 -0
- package/dist/index.d.ts +13 -7
- package/dist/index.js +11 -9
- package/dist/input.cva.js +30 -30
- package/dist/label.cva.js +1 -1
- package/dist/menu.cva.js +2 -3
- package/dist/pillButton.cva.js +1 -1
- package/dist/radio.cva.js +0 -10
- package/dist/stepper.cva.js +93 -0
- package/dist/tag.cva.js +1 -1
- package/dist/tooltip.cva.js +1 -1
- package/dist/translation.js +0 -8
- package/dist/translation2.js +0 -7
- package/dist/types/error-handling.d.ts +6 -0
- package/dist/types/react-query.d.ts +1 -1
- package/dist/useSelectItems.js +1 -1
- package/package.json +2 -3
- package/dist/AclGuard.js +0 -12
- package/dist/AuthGuard.js +0 -22
- package/dist/Can.js +0 -13
- package/dist/View.js +0 -13
- package/dist/ViewOff.js +0 -13
- package/dist/ability.context.js +0 -35
- package/dist/auth.context.js +0 -37
- package/dist/auth.d.ts +0 -6
- package/dist/auth.js +0 -6
- package/dist/error-handling.js +0 -99
- package/dist/rest-interceptor.js +0 -22
- package/dist/utils/vendor/acl/AclGuard.d.ts +0 -8
- package/dist/utils/vendor/acl/Can.d.ts +0 -9
- package/dist/utils/vendor/acl/ability.context.d.ts +0 -15
- package/dist/utils/vendor/acl/appAbility.types.d.ts +0 -3
- package/dist/utils/vendor/auth/AuthGuard.d.ts +0 -6
- package/dist/utils/vendor/auth/auth.context.d.ts +0 -22
- package/dist/utils/vendor/error-handling.d.ts +0 -21
- package/dist/utils/vendor/rest-client.types.d.ts +0 -23
- package/dist/utils/vendor/rest-interceptor.d.ts +0 -8
package/dist/radio.cva.js
CHANGED
|
@@ -14,18 +14,8 @@ const radio = cva([
|
|
|
14
14
|
"group-pressed:border-interactive-outlined-secondary-on-pressed",
|
|
15
15
|
"group-selected:border-interactive-contained-primary-idle",
|
|
16
16
|
"group-selected:bg-interactive-contained-primary-idle",
|
|
17
|
-
"group-selected:group-hover:bg-interactive-contained-primary-hover",
|
|
18
|
-
"group-selected:group-hover:border-interactive-contained-primary-hover",
|
|
19
|
-
"group-selected:group-pressed:bg-interactive-contained-primary-pressed",
|
|
20
|
-
"group-selected:group-pressed:border-interactive-contained-primary-pressed",
|
|
21
17
|
"group-selected:group-disabled:bg-interactive-contained-primary-disabled",
|
|
22
18
|
"group-selected:group-disabled:border-interactive-contained-primary-disabled",
|
|
23
|
-
"group-indeterminate:border-interactive-contained-primary-idle",
|
|
24
|
-
"group-indeterminate:bg-interactive-contained-primary-idle",
|
|
25
|
-
"group-indeterminate:group-hover:bg-interactive-contained-primary-hover",
|
|
26
|
-
"group-indeterminate:group-hover:border-interactive-contained-primary-hover",
|
|
27
|
-
"group-indeterminate:group-pressed:bg-interactive-contained-primary-pressed",
|
|
28
|
-
"group-indeterminate:group-pressed:border-interactive-contained-primary-pressed",
|
|
29
19
|
"group-invalid:border-interactive-outlined-error-on-idle",
|
|
30
20
|
"group-focus-visible:outline-interactive-contained-primary-focus",
|
|
31
21
|
"before:bg-interactive-contained-primary-on-idle",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const stepperCva = cva("", {
|
|
3
|
+
variants: { orientation: {
|
|
4
|
+
horizontal: "flex flex-row items-center gap-stepper-gap-step-to-line-horizontal",
|
|
5
|
+
vertical: "inline-flex flex-col gap-stepper-gap-step-to-line-vertical"
|
|
6
|
+
} },
|
|
7
|
+
defaultVariants: { orientation: "horizontal" }
|
|
8
|
+
});
|
|
9
|
+
const stepperItemCva = cva("flex shrink-0", {
|
|
10
|
+
variants: { contentOrientation: {
|
|
11
|
+
horizontal: "flex-row items-center gap-stepper-gap-icon-to-text-horizontal text-left",
|
|
12
|
+
vertical: "flex-col items-center gap-stepper-gap-icon-to-text-vertical text-center"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { contentOrientation: "horizontal" }
|
|
15
|
+
});
|
|
16
|
+
const stepperIconCva = cva("inline-flex size-5 shrink-0 items-center justify-center rounded-stepper-rounding-icon", {
|
|
17
|
+
variants: { status: {
|
|
18
|
+
completed: [
|
|
19
|
+
"border border-interactive-outlined-primary-outline-idle border-solid bg-interactive-contained-primary-idle",
|
|
20
|
+
"group-hover:border-interactive-outlined-primary-outline-hover group-hover:bg-interactive-contained-primary-hover",
|
|
21
|
+
"group-pressed:border-interactive-outlined-primary-outline-pressed group-pressed:bg-interactive-contained-primary-pressed"
|
|
22
|
+
],
|
|
23
|
+
active: "border border-interactive-outlined-primary-on-idle border-solid bg-interactive-outlined-primary-idle",
|
|
24
|
+
todo: "border border-interactive-outlined-primary-outline-disabled border-solid bg-interactive-outlined-primary-disabled"
|
|
25
|
+
} },
|
|
26
|
+
defaultVariants: { status: "todo" }
|
|
27
|
+
});
|
|
28
|
+
const stepperNumberCva = cva("text-center align-middle", {
|
|
29
|
+
variants: { status: {
|
|
30
|
+
completed: "",
|
|
31
|
+
active: "text-interactive-outlined-primary-on-idle",
|
|
32
|
+
todo: "text-interactive-outlined-primary-on-disabled"
|
|
33
|
+
} },
|
|
34
|
+
defaultVariants: { status: "todo" }
|
|
35
|
+
});
|
|
36
|
+
const stepperTitleCva = cva("", {
|
|
37
|
+
variants: { status: {
|
|
38
|
+
completed: [
|
|
39
|
+
"text-interactive-text-secondary-idle",
|
|
40
|
+
"group-hover:text-interactive-text-secondary-hover",
|
|
41
|
+
"group-pressed:text-interactive-text-secondary-pressed"
|
|
42
|
+
],
|
|
43
|
+
active: "text-interactive-text-primary-idle",
|
|
44
|
+
todo: "text-interactive-text-secondary-disabled"
|
|
45
|
+
} },
|
|
46
|
+
defaultVariants: { status: "todo" }
|
|
47
|
+
});
|
|
48
|
+
const stepperSubtextCva = cva("", {
|
|
49
|
+
variants: { status: {
|
|
50
|
+
completed: [
|
|
51
|
+
"text-interactive-text-secondary-idle",
|
|
52
|
+
"group-hover:text-interactive-text-secondary-hover",
|
|
53
|
+
"group-pressed:text-interactive-text-secondary-pressed"
|
|
54
|
+
],
|
|
55
|
+
active: "text-interactive-text-secondary-idle",
|
|
56
|
+
todo: "text-interactive-text-secondary-disabled"
|
|
57
|
+
} },
|
|
58
|
+
defaultVariants: { status: "todo" }
|
|
59
|
+
});
|
|
60
|
+
const stepperSeparatorCva = cva("bg-elevation-outline-default-1", {
|
|
61
|
+
variants: {
|
|
62
|
+
orientation: {
|
|
63
|
+
horizontal: "h-px min-w-4 flex-1",
|
|
64
|
+
vertical: "min-h-16 w-px"
|
|
65
|
+
},
|
|
66
|
+
contentOrientation: {
|
|
67
|
+
horizontal: "",
|
|
68
|
+
vertical: ""
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
defaultVariants: {
|
|
72
|
+
orientation: "horizontal",
|
|
73
|
+
contentOrientation: "horizontal"
|
|
74
|
+
},
|
|
75
|
+
compoundVariants: [
|
|
76
|
+
{
|
|
77
|
+
orientation: "horizontal",
|
|
78
|
+
contentOrientation: "vertical",
|
|
79
|
+
className: "mt-stepper-horizontal-line-top self-start"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
orientation: "vertical",
|
|
83
|
+
contentOrientation: "vertical",
|
|
84
|
+
className: "self-center"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
orientation: "vertical",
|
|
88
|
+
contentOrientation: "horizontal",
|
|
89
|
+
className: "ml-stepper-vertical-line-side"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
export { stepperCva, stepperIconCva, stepperItemCva, stepperNumberCva, stepperSeparatorCva, stepperSubtextCva, stepperTitleCva };
|
package/dist/tag.cva.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cva } from "class-variance-authority";
|
|
|
3
3
|
const tag = cva([
|
|
4
4
|
uiOutlineClass,
|
|
5
5
|
"inline-flex items-center gap-list-gap-icon-to-label",
|
|
6
|
-
"p-pill-height-
|
|
6
|
+
"p-pill-height-s px-1-5",
|
|
7
7
|
"rounded-pill-rounding-default",
|
|
8
8
|
"overflow-hidden",
|
|
9
9
|
"disabled:cursor-default"
|
package/dist/tooltip.cva.js
CHANGED
|
@@ -22,7 +22,7 @@ const tooltipPointerVerticalCva = cva(["h-5 w-2-5 group-placement-bottom:hidden
|
|
|
22
22
|
});
|
|
23
23
|
const tooltipTextCva = cva([], {
|
|
24
24
|
variants: { color: {
|
|
25
|
-
default: ["text-
|
|
25
|
+
default: ["text-interactive-contained-secondary-on-idle"],
|
|
26
26
|
error: ["text-text-error-inverted-1"]
|
|
27
27
|
} },
|
|
28
28
|
defaultVariants: { color: "default" }
|
package/dist/translation.js
CHANGED
|
@@ -141,14 +141,6 @@ var translation_default = {
|
|
|
141
141
|
"smallerThanOrEqual": "Date must be smaller than or equal to {{date}}",
|
|
142
142
|
"smallerThan": "Date must be smaller than {{date}}"
|
|
143
143
|
}
|
|
144
|
-
},
|
|
145
|
-
sharedErrors: {
|
|
146
|
-
"dataValidation": "An error occurred while validating the data",
|
|
147
|
-
"internalError": "An internal error occurred. This is most likely a bug on our end. Please try again later.",
|
|
148
|
-
"networkError": "A network error occurred. Are you connected to the internet?",
|
|
149
|
-
"canceledError": "The request was canceled.",
|
|
150
|
-
"unknownError": "An unknown error occurred.",
|
|
151
|
-
"unknownErrorWithCode": "An unknown error occurred. Error code: \"{{code}}\""
|
|
152
144
|
}
|
|
153
145
|
};
|
|
154
146
|
export { translation_default as default };
|
package/dist/translation2.js
CHANGED
|
@@ -139,13 +139,6 @@ var translation_default = {
|
|
|
139
139
|
"smallerThanOrEqual": "Datum mora biti manjši ali enak {{date}}",
|
|
140
140
|
"smallerThan": "Datum mora biti manjši od {{date}}"
|
|
141
141
|
}
|
|
142
|
-
},
|
|
143
|
-
sharedErrors: {
|
|
144
|
-
"dataValidation": "Pri preverjanju podatkov je prišlo do napake",
|
|
145
|
-
"internalError": "Prišlo je do notranje napake. ",
|
|
146
|
-
"networkError": "Prišlo je do napake v omrežju. ",
|
|
147
|
-
"canceledError": "Zahteva je bila preklicana.",
|
|
148
|
-
"unknownError": "Prišlo je do neznane napake. "
|
|
149
142
|
}
|
|
150
143
|
};
|
|
151
144
|
export { translation_default as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type GeneralErrorCodes = "DATA_VALIDATION_ERROR" | "NETWORK_ERROR" | "CANCELED_ERROR" | "INTERNAL_ERROR" | "UNKNOWN_ERROR";
|
|
2
|
+
export declare class ApplicationException<CodeT> extends Error {
|
|
3
|
+
code: CodeT;
|
|
4
|
+
serverMessage: string | null;
|
|
5
|
+
constructor(message: string, code: CodeT, serverMessage: string | null);
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InfiniteData, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
-
import { ApplicationException, GeneralErrorCodes } from '../utils/vendor/error-handling';
|
|
3
2
|
import { Function, IsUnknown } from './common';
|
|
3
|
+
import { ApplicationException, GeneralErrorCodes } from './error-handling';
|
|
4
4
|
export type AppQueryOptions<TFunction extends Function, TData = Awaited<ReturnType<TFunction>>, TErrorCodes = GeneralErrorCodes> = Omit<UseQueryOptions<Awaited<ReturnType<TFunction>>, ApplicationException<TErrorCodes>, IsUnknown<TData, Awaited<ReturnType<TFunction>>>>, "queryKey" | "queryFn">;
|
|
5
5
|
export type AppMutationOptions<TFunction extends Function, TVariables = void, TData = Awaited<ReturnType<TFunction>>, TErrorCodes = GeneralErrorCodes> = Omit<UseMutationOptions<TData, ApplicationException<TErrorCodes>, TVariables>, "mutationKey" | "mutationFn">;
|
|
6
6
|
export type AppInfiniteQueryOptions<TFunction extends Function, TData = InfiniteData<Awaited<ReturnType<TFunction>>>, TErrorCodes = GeneralErrorCodes, TQueryKey extends QueryKey = QueryKey, TPageParam = number> = Omit<UseInfiniteQueryOptions<Awaited<ReturnType<TFunction>>, ApplicationException<TErrorCodes>, IsUnknown<TData, InfiniteData<Awaited<ReturnType<TFunction>>>>, TQueryKey, TPageParam>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
package/dist/useSelectItems.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@povio/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
-
"./auth": "./dist/auth.js",
|
|
10
9
|
"./text-editor": "./dist/text-editor.js",
|
|
11
10
|
"./text-editor/styles": "./dist/styles/editor.css"
|
|
12
11
|
},
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"@react-stately/calendar": "^3.9.1",
|
|
49
48
|
"@react-stately/datepicker": "^3.15.3",
|
|
50
49
|
"@react-types/shared": "^3.32.1",
|
|
51
|
-
"@tanstack/react-query": "~5.
|
|
50
|
+
"@tanstack/react-query": "~5.89.0",
|
|
52
51
|
"@tanstack/react-table": "^8.21.3",
|
|
53
52
|
"axios": "^1.13.2",
|
|
54
53
|
"class-variance-authority": "^0.7.1",
|
package/dist/AclGuard.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UIRouter } from "./router.context.js";
|
|
2
|
-
import { AbilityContext } from "./ability.context.js";
|
|
3
|
-
const createAclGuard = () => ({ canUse, redirectTo = "/", children }) => {
|
|
4
|
-
const ability = AbilityContext.useAbility();
|
|
5
|
-
const { replace } = UIRouter.useUIRouter();
|
|
6
|
-
if (!ability.can(canUse[0], canUse[1])) {
|
|
7
|
-
replace(redirectTo);
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return children;
|
|
11
|
-
};
|
|
12
|
-
export { createAclGuard };
|
package/dist/AuthGuard.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { UIRouter } from "./router.context.js";
|
|
2
|
-
import { AuthContext } from "./auth.context.js";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
const AuthGuard = ({ type, redirectTo, children }) => {
|
|
5
|
-
const { isAuthenticated, routes, loadingState } = AuthContext.useAuth();
|
|
6
|
-
const { replace } = UIRouter.useUIRouter();
|
|
7
|
-
const [hasMounted, setHasMounted] = useState(false);
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
setHasMounted(true);
|
|
10
|
-
}, []);
|
|
11
|
-
if (!hasMounted) return loadingState;
|
|
12
|
-
if (type === "private" && !isAuthenticated) {
|
|
13
|
-
replace(redirectTo || routes?.unauthenticated || "/");
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (type === "public-only" && isAuthenticated) {
|
|
17
|
-
replace(redirectTo || routes?.authenticated || "/");
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return children;
|
|
21
|
-
};
|
|
22
|
-
export { AuthGuard };
|
package/dist/Can.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AbilityContext } from "./ability.context.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContextualCan } from "@casl/react";
|
|
4
|
-
var ContextualCan = createContextualCan(AbilityContext.Consumer);
|
|
5
|
-
const Can = ({ use,...props }) => {
|
|
6
|
-
const [action, subject] = use;
|
|
7
|
-
return /* @__PURE__ */ jsx(ContextualCan, {
|
|
8
|
-
...props,
|
|
9
|
-
do: action,
|
|
10
|
-
on: subject
|
|
11
|
-
});
|
|
12
|
-
};
|
|
13
|
-
export { Can };
|
package/dist/View.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
const ViewIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
-
fill: "none",
|
|
5
|
-
viewBox: "0 0 24 24",
|
|
6
|
-
className: "fill-current",
|
|
7
|
-
...props,
|
|
8
|
-
children: /* @__PURE__ */ jsxs("g", {
|
|
9
|
-
fill: "currentColor",
|
|
10
|
-
children: [/* @__PURE__ */ jsx("path", { d: "M21.338 11.788A10.43 10.43 0 0 0 12 5.124a10.43 10.43 0 0 0-9.337 6.663.63.63 0 0 0 0 .425A10.43 10.43 0 0 0 12 18.875a10.43 10.43 0 0 0 9.337-6.662.62.62 0 0 0 0-.425M12 17.624c-3.312 0-6.812-2.456-8.081-5.625C5.188 8.831 8.688 6.375 12 6.375c3.313 0 6.813 2.456 8.081 5.625-1.268 3.169-4.768 5.625-8.081 5.625" }), /* @__PURE__ */ jsx("path", { d: "M12 8.25a3.75 3.75 0 1 0 0 7.5 3.75 3.75 0 0 0 0-7.5m0 6.25a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5" })]
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
export { ViewIcon };
|
package/dist/ViewOff.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
const ViewOffIcon = (props) => /* @__PURE__ */ jsx("svg", {
|
|
3
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
-
fill: "none",
|
|
5
|
-
viewBox: "0 0 24 24",
|
|
6
|
-
className: "fill-current",
|
|
7
|
-
...props,
|
|
8
|
-
children: /* @__PURE__ */ jsxs("g", {
|
|
9
|
-
fill: "currentColor",
|
|
10
|
-
children: [/* @__PURE__ */ jsx("path", { d: "m5.275 16.069.894-.888A8.8 8.8 0 0 1 3.919 12C5.188 8.831 8.688 6.375 12 6.375a7.7 7.7 0 0 1 2.5.45l.969-.975A9.2 9.2 0 0 0 12 5.125a10.43 10.43 0 0 0-9.337 6.663.63.63 0 0 0 0 .425 10 10 0 0 0 2.612 3.856" }), /* @__PURE__ */ jsx("path", { d: "M9.5 11.831a2.5 2.5 0 0 1 2.313-2.312l1.13-1.138a3.75 3.75 0 0 0-4.58 4.582zM21.338 11.788a10.25 10.25 0 0 0-3.588-4.65l3-3.007-.881-.881L3.25 19.869l.881.881 3.188-3.187A9.56 9.56 0 0 0 12 18.875a10.43 10.43 0 0 0 9.337-6.662.62.62 0 0 0 0-.425M14.5 12a2.5 2.5 0 0 1-3.75 2.15l3.4-3.4A2.5 2.5 0 0 1 14.5 12M12 17.625a8.16 8.16 0 0 1-3.75-.988l1.588-1.587a3.75 3.75 0 0 0 5.218-5.219l1.794-1.793A9.1 9.1 0 0 1 20.081 12c-1.268 3.169-4.768 5.625-8.081 5.625" })]
|
|
11
|
-
})
|
|
12
|
-
});
|
|
13
|
-
export { ViewOffIcon };
|
package/dist/ability.context.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AuthContext } from "./auth.context.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useEffect, useState } from "react";
|
|
4
|
-
import { AbilityBuilder, createMongoAbility } from "@casl/ability";
|
|
5
|
-
import { unpackRules } from "@casl/ability/extra";
|
|
6
|
-
import { useAbility } from "@casl/react";
|
|
7
|
-
let AbilityContext;
|
|
8
|
-
(function(_AbilityContext) {
|
|
9
|
-
const createAppAbilityBuilder = () => new AbilityBuilder(createMongoAbility);
|
|
10
|
-
const initialAppAbility = createAppAbilityBuilder().build();
|
|
11
|
-
const Context = createContext({});
|
|
12
|
-
const { Consumer } = Context;
|
|
13
|
-
_AbilityContext.Consumer = Consumer;
|
|
14
|
-
_AbilityContext.Provider = ({ children }) => {
|
|
15
|
-
const [ability, setAbility] = useState(initialAppAbility);
|
|
16
|
-
const { user } = AuthContext.useAuth();
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!user || !("aclRules" in user)) return;
|
|
19
|
-
const { can, build } = createAppAbilityBuilder();
|
|
20
|
-
const packedRules = user.aclRules;
|
|
21
|
-
unpackRules(packedRules).forEach(({ action, subject, conditions }) => {
|
|
22
|
-
can(action, subject, conditions);
|
|
23
|
-
});
|
|
24
|
-
setAbility(build());
|
|
25
|
-
}, [user]);
|
|
26
|
-
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
27
|
-
value: ability,
|
|
28
|
-
children
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
_AbilityContext.useAbility = () => {
|
|
32
|
-
return useAbility(Context);
|
|
33
|
-
};
|
|
34
|
-
})(AbilityContext || (AbilityContext = {}));
|
|
35
|
-
export { AbilityContext };
|
package/dist/auth.context.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, use, useMemo } from "react";
|
|
3
|
-
let AuthContext;
|
|
4
|
-
(function(_AuthContext) {
|
|
5
|
-
const Context = createContext({});
|
|
6
|
-
_AuthContext.Provider = ({ isAuthenticated, isInitializing, logout, updateTokens, accessToken, user, userPromise, routes, loadingState, children }) => {
|
|
7
|
-
const value = useMemo(() => ({
|
|
8
|
-
isAuthenticated,
|
|
9
|
-
isInitializing,
|
|
10
|
-
logout,
|
|
11
|
-
updateTokens,
|
|
12
|
-
accessToken,
|
|
13
|
-
user,
|
|
14
|
-
userPromise,
|
|
15
|
-
routes,
|
|
16
|
-
loadingState
|
|
17
|
-
}), [
|
|
18
|
-
isAuthenticated,
|
|
19
|
-
isInitializing,
|
|
20
|
-
logout,
|
|
21
|
-
updateTokens,
|
|
22
|
-
accessToken,
|
|
23
|
-
user,
|
|
24
|
-
userPromise,
|
|
25
|
-
routes,
|
|
26
|
-
loadingState
|
|
27
|
-
]);
|
|
28
|
-
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
29
|
-
value,
|
|
30
|
-
children
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
_AuthContext.useAuth = () => {
|
|
34
|
-
return use(Context);
|
|
35
|
-
};
|
|
36
|
-
})(AuthContext || (AuthContext = {}));
|
|
37
|
-
export { AuthContext };
|
package/dist/auth.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { createAclGuard } from './utils/vendor/acl/AclGuard';
|
|
2
|
-
export { AbilityContext } from './utils/vendor/acl/ability.context';
|
|
3
|
-
export type { AppAbilities, AppAbility } from './utils/vendor/acl/appAbility.types';
|
|
4
|
-
export { Can } from './utils/vendor/acl/Can';
|
|
5
|
-
export { AuthGuard } from './utils/vendor/auth/AuthGuard';
|
|
6
|
-
export { AuthContext } from './utils/vendor/auth/auth.context';
|
package/dist/auth.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AuthContext } from "./auth.context.js";
|
|
2
|
-
import { AbilityContext } from "./ability.context.js";
|
|
3
|
-
import { createAclGuard } from "./AclGuard.js";
|
|
4
|
-
import { Can } from "./Can.js";
|
|
5
|
-
import { AuthGuard } from "./AuthGuard.js";
|
|
6
|
-
export { AbilityContext, AuthContext, AuthGuard, Can, createAclGuard };
|
package/dist/error-handling.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { ns } from "./i18n.js";
|
|
2
|
-
import { RestUtils } from "./rest.utils.js";
|
|
3
|
-
import { logger } from "./logger.js";
|
|
4
|
-
import axios from "axios";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import i18next from "i18next";
|
|
7
|
-
var ApplicationException = class extends Error {
|
|
8
|
-
constructor(message, code, serverMessage) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.serverMessage = null;
|
|
11
|
-
this.code = code;
|
|
12
|
-
this.serverMessage = serverMessage;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var ErrorHandler = class {
|
|
16
|
-
constructor(entries) {
|
|
17
|
-
this.entries = [];
|
|
18
|
-
const dataValidationError = {
|
|
19
|
-
code: "DATA_VALIDATION_ERROR",
|
|
20
|
-
condition: (e) => {
|
|
21
|
-
return e instanceof z.ZodError;
|
|
22
|
-
},
|
|
23
|
-
getMessage: () => i18next.t(($) => $.sharedErrors.dataValidation, { ns: "ui" })
|
|
24
|
-
};
|
|
25
|
-
const internalError = {
|
|
26
|
-
code: "INTERNAL_ERROR",
|
|
27
|
-
condition: (e) => {
|
|
28
|
-
if (axios.isAxiosError(e)) return e.response?.status != null && e.response.status >= 500 && e.response.status < 600;
|
|
29
|
-
return false;
|
|
30
|
-
},
|
|
31
|
-
getMessage: () => i18next.t(($) => $.sharedErrors.internalError, { ns: "ui" })
|
|
32
|
-
};
|
|
33
|
-
const networkError = {
|
|
34
|
-
code: "NETWORK_ERROR",
|
|
35
|
-
condition: (e) => {
|
|
36
|
-
if (axios.isAxiosError(e)) return e.code === "ERR_NETWORK";
|
|
37
|
-
return false;
|
|
38
|
-
},
|
|
39
|
-
getMessage: () => i18next.t(($) => $.sharedErrors.networkError, { ns: "ui" })
|
|
40
|
-
};
|
|
41
|
-
const canceledError = {
|
|
42
|
-
code: "CANCELED_ERROR",
|
|
43
|
-
condition: (e) => {
|
|
44
|
-
if (axios.isCancel(e)) return true;
|
|
45
|
-
if (axios.isAxiosError(e) && e.code === "ECONNABORTED") return true;
|
|
46
|
-
return false;
|
|
47
|
-
},
|
|
48
|
-
getMessage: () => i18next.t(($) => $.sharedErrors.canceledError, { ns: "ui" })
|
|
49
|
-
};
|
|
50
|
-
const unknownError = {
|
|
51
|
-
code: "UNKNOWN_ERROR",
|
|
52
|
-
condition: () => true,
|
|
53
|
-
getMessage: (e) => {
|
|
54
|
-
if (axios.isAxiosError(e) && e.response?.data?.code) return i18next.t(($) => $.sharedErrors.unknownErrorWithCode, {
|
|
55
|
-
ns: "ui",
|
|
56
|
-
code: e.response.data.code
|
|
57
|
-
});
|
|
58
|
-
return i18next.t(($) => $.sharedErrors.unknownError, { ns: "ui" });
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
this.entries = [
|
|
62
|
-
...entries,
|
|
63
|
-
dataValidationError,
|
|
64
|
-
internalError,
|
|
65
|
-
networkError,
|
|
66
|
-
canceledError,
|
|
67
|
-
unknownError
|
|
68
|
-
];
|
|
69
|
-
}
|
|
70
|
-
rethrowError(error) {
|
|
71
|
-
logger.error(error);
|
|
72
|
-
const errorEntry = this.entries.find((entry) => entry.condition(error ?? {}));
|
|
73
|
-
const serverMessage = RestUtils.extractServerErrorMessage(error);
|
|
74
|
-
throw new ApplicationException(errorEntry.getMessage(error), errorEntry.code, serverMessage);
|
|
75
|
-
}
|
|
76
|
-
getError(error) {
|
|
77
|
-
if (error instanceof ApplicationException) return error;
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
getErrorCode(error) {
|
|
81
|
-
if (error instanceof ApplicationException) return error.code;
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
static getErrorMessage(error, fallbackToUnknown = true) {
|
|
85
|
-
if (typeof error === "string") return error;
|
|
86
|
-
if (error instanceof Error) return error.message;
|
|
87
|
-
if (error instanceof ApplicationException) return error.message;
|
|
88
|
-
if (fallbackToUnknown) {
|
|
89
|
-
if (error && typeof error === "object" && "code" in error) return i18next.t(($) => $.sharedErrors.unknownErrorWithCode, {
|
|
90
|
-
ns: "ui",
|
|
91
|
-
code: error.code
|
|
92
|
-
});
|
|
93
|
-
return i18next.t(($) => $.sharedErrors.unknownError, { ns: "ui" });
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const SharedErrorHandler = new ErrorHandler([]);
|
|
99
|
-
export { ApplicationException, ErrorHandler, SharedErrorHandler };
|
package/dist/rest-interceptor.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var RestInterceptor = class {
|
|
2
|
-
constructor(applyInterceptor) {
|
|
3
|
-
this.applyInterceptor = applyInterceptor;
|
|
4
|
-
this.interceptorIdMap = [];
|
|
5
|
-
}
|
|
6
|
-
addInterceptor(client, ...args) {
|
|
7
|
-
this.removeInterceptor(client);
|
|
8
|
-
const interceptorId = this.applyInterceptor(client, ...args);
|
|
9
|
-
this.interceptorIdMap.push({
|
|
10
|
-
client,
|
|
11
|
-
interceptorId
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
removeInterceptor(client) {
|
|
15
|
-
const interceptorId = this.interceptorIdMap.find((i) => i.client === client)?.interceptorId;
|
|
16
|
-
if (interceptorId != null) {
|
|
17
|
-
client.interceptors.request.eject(interceptorId);
|
|
18
|
-
this.interceptorIdMap = this.interceptorIdMap.filter((i) => i.client !== client);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export { RestInterceptor };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
import { AppAbilities } from './appAbility.types';
|
|
3
|
-
interface AclGuardProps<TAppAbilities extends AppAbilities = AppAbilities> {
|
|
4
|
-
canUse: TAppAbilities;
|
|
5
|
-
redirectTo?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const createAclGuard: <TAppAbilities extends AppAbilities = AppAbilities>() => ({ canUse, redirectTo, children }: PropsWithChildren<AclGuardProps<TAppAbilities>>) => import('react').ReactNode;
|
|
8
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AbilityTuple, PureAbility } from '@casl/ability';
|
|
2
|
-
import { BoundCanProps } from '@casl/react';
|
|
3
|
-
import { AppAbilities } from './appAbility.types';
|
|
4
|
-
type CanAbility = PureAbility<AbilityTuple<AppAbilities[0], AppAbilities[1]>>;
|
|
5
|
-
type CanProps<TAppAbilities extends AppAbilities = AppAbilities> = {
|
|
6
|
-
use: TAppAbilities;
|
|
7
|
-
} & Omit<BoundCanProps<CanAbility>, "do" | "I" | "on" | "a" | "an" | "this">;
|
|
8
|
-
export declare const Can: <TAppAbilities extends AppAbilities = AppAbilities>({ use, ...props }: CanProps<TAppAbilities>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PureAbility, RawRuleOf } from '@casl/ability';
|
|
2
|
-
import { PackRule } from '@casl/ability/extra';
|
|
3
|
-
import { PropsWithChildren } from 'react';
|
|
4
|
-
import { AppAbilities, AppAbility } from './appAbility.types';
|
|
5
|
-
export declare namespace AbilityContext {
|
|
6
|
-
export const Consumer: import("react").Consumer<AppAbility>;
|
|
7
|
-
interface ProviderProps {
|
|
8
|
-
user?: {
|
|
9
|
-
aclRules?: PackRule<RawRuleOf<AppAbility>>[];
|
|
10
|
-
} | null;
|
|
11
|
-
}
|
|
12
|
-
export const Provider: ({ children }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export const useAbility: <TAppAbilities extends AppAbilities = AppAbilities>() => PureAbility<TAppAbilities>;
|
|
14
|
-
export {};
|
|
15
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
export interface AuthGuardProps {
|
|
3
|
-
type: "public-only" | "private";
|
|
4
|
-
redirectTo?: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const AuthGuard: ({ type, redirectTo, children }: PropsWithChildren<AuthGuardProps>) => import('react').ReactNode;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
export declare namespace AuthContext {
|
|
3
|
-
export interface Routes {
|
|
4
|
-
authenticated?: string;
|
|
5
|
-
unauthenticated?: string;
|
|
6
|
-
}
|
|
7
|
-
interface Type<TUser = unknown> {
|
|
8
|
-
isAuthenticated: boolean;
|
|
9
|
-
isInitializing: boolean;
|
|
10
|
-
logout: () => void;
|
|
11
|
-
updateTokens?: (accessToken: string | null, refreshToken?: string | null) => void;
|
|
12
|
-
accessToken?: string | null;
|
|
13
|
-
user?: TUser | null;
|
|
14
|
-
userPromise?: () => Promise<TUser | null>;
|
|
15
|
-
routes?: Routes;
|
|
16
|
-
loadingState?: ReactNode;
|
|
17
|
-
}
|
|
18
|
-
type ProviderProps<TUser = unknown> = Type<TUser>;
|
|
19
|
-
export const Provider: <TUser>({ isAuthenticated, isInitializing, logout, updateTokens, accessToken, user, userPromise, routes, loadingState, children, }: PropsWithChildren<ProviderProps<TUser>>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export const useAuth: <TUser>() => Type<TUser>;
|
|
21
|
-
export {};
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type GeneralErrorCodes = "DATA_VALIDATION_ERROR" | "NETWORK_ERROR" | "CANCELED_ERROR" | "INTERNAL_ERROR" | "UNKNOWN_ERROR";
|
|
2
|
-
export declare class ApplicationException<CodeT> extends Error {
|
|
3
|
-
code: CodeT;
|
|
4
|
-
serverMessage: string | null;
|
|
5
|
-
constructor(message: string, code: CodeT, serverMessage: string | null);
|
|
6
|
-
}
|
|
7
|
-
interface ErrorEntry<CodeT> {
|
|
8
|
-
code: CodeT;
|
|
9
|
-
condition: (error: unknown) => boolean;
|
|
10
|
-
getMessage: (error: unknown) => string;
|
|
11
|
-
}
|
|
12
|
-
export declare class ErrorHandler<CodeT extends string> {
|
|
13
|
-
entries: ErrorEntry<CodeT | GeneralErrorCodes>[];
|
|
14
|
-
constructor(entries: ErrorEntry<CodeT>[]);
|
|
15
|
-
rethrowError(error: unknown): ApplicationException<CodeT | GeneralErrorCodes>;
|
|
16
|
-
getError(error: unknown): ApplicationException<CodeT | GeneralErrorCodes> | null;
|
|
17
|
-
getErrorCode(error: unknown): CodeT | GeneralErrorCodes | null;
|
|
18
|
-
static getErrorMessage(error: unknown, fallbackToUnknown?: boolean): string | null;
|
|
19
|
-
}
|
|
20
|
-
export declare const SharedErrorHandler: ErrorHandler<never>;
|
|
21
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { ErrorHandler } from './error-handling';
|
|
4
|
-
import { RestInterceptor } from './rest-interceptor';
|
|
5
|
-
export type GeneralErrorCodes = string;
|
|
6
|
-
export interface RequestInfo<ZOutput, ECodes extends string> {
|
|
7
|
-
resSchema: z.ZodType<ZOutput>;
|
|
8
|
-
errorHandler?: ErrorHandler<ECodes>;
|
|
9
|
-
}
|
|
10
|
-
export interface RequestConfig<IsRawRes extends boolean = false> {
|
|
11
|
-
rawResponse?: IsRawRes;
|
|
12
|
-
}
|
|
13
|
-
export type Response<ZOutput, IsRawRes extends boolean = false> = IsRawRes extends true ? AxiosResponse<ZOutput> : ZOutput;
|
|
14
|
-
export interface RestClient {
|
|
15
|
-
attachInterceptors<T extends any[]>(interceptors?: RestInterceptor<T>[], ...args: T): void;
|
|
16
|
-
attachInterceptor<T extends any[]>(interceptor: RestInterceptor<T>, ...args: T): void;
|
|
17
|
-
ejectInterceptor<T extends any[]>(interceptor: RestInterceptor<T>): void;
|
|
18
|
-
get<ZOutput, ECodes extends string = GeneralErrorCodes, IsRawRes extends boolean = false>(requestInfo: RequestInfo<ZOutput, ECodes>, url: string, requestConfig?: AxiosRequestConfig & RequestConfig<IsRawRes>): Promise<Response<ZOutput, IsRawRes>>;
|
|
19
|
-
post<ZOutput, ECodes extends string = GeneralErrorCodes, IsRawRes extends boolean = false>(requestInfo: RequestInfo<ZOutput, ECodes>, url: string, data?: any, requestConfig?: AxiosRequestConfig & RequestConfig<IsRawRes>): Promise<Response<ZOutput, IsRawRes>>;
|
|
20
|
-
patch<ZOutput, ECodes extends string = GeneralErrorCodes, IsRawRes extends boolean = false>(requestInfo: RequestInfo<ZOutput, ECodes>, url: string, data?: any, requestConfig?: AxiosRequestConfig & RequestConfig<IsRawRes>): Promise<Response<ZOutput, IsRawRes>>;
|
|
21
|
-
put<ZOutput, ECodes extends string = GeneralErrorCodes, IsRawRes extends boolean = false>(requestInfo: RequestInfo<ZOutput, ECodes>, url: string, data?: any, requestConfig?: AxiosRequestConfig & RequestConfig<IsRawRes>): Promise<Response<ZOutput, IsRawRes>>;
|
|
22
|
-
delete<ZOutput, ECodes extends string = GeneralErrorCodes, IsRawRes extends boolean = false>(requestInfo: RequestInfo<ZOutput, ECodes>, url: string, data?: any, requestConfig?: AxiosRequestConfig & RequestConfig<IsRawRes>): Promise<Response<ZOutput, IsRawRes>>;
|
|
23
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
export declare class RestInterceptor<T extends any[]> {
|
|
3
|
-
private applyInterceptor;
|
|
4
|
-
private interceptorIdMap;
|
|
5
|
-
constructor(applyInterceptor: (client: AxiosInstance, ...args: T) => number);
|
|
6
|
-
addInterceptor(client: AxiosInstance, ...args: T): void;
|
|
7
|
-
removeInterceptor(client: AxiosInstance): void;
|
|
8
|
-
}
|