@nside/wefa 0.4.4 → 0.4.6
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/README.md +3 -1
- package/dist/LegalConsent-BxOWAO0s.js +126 -0
- package/dist/LegalConsent-ChW-GYBv.cjs +1 -0
- package/dist/LegalDocument-BM4HLw9A.js +1580 -0
- package/dist/LegalDocument-hhYW9BBO.cjs +114 -0
- package/dist/LoginView-BpDNpbMQ.cjs +1 -0
- package/dist/LoginView-bUKvV6JV.js +17 -0
- package/dist/LogoutView-BrAt0b2J.js +16 -0
- package/dist/LogoutView-D7D3LcfL.cjs +1 -0
- package/dist/angledown-DgMf_Vjv.cjs +2 -0
- package/dist/angledown-igq2UW-u.js +46 -0
- package/dist/badge-2r_VjcsG.js +102 -0
- package/dist/badge-DPwocFJ8.cjs +76 -0
- package/dist/basecomponent-CGerMr_k.cjs +146 -0
- package/dist/basecomponent-CRTLSsqZ.js +1278 -0
- package/dist/baseeditableholder-BEn83TQE.js +126 -0
- package/dist/baseeditableholder-Q1_XheNU.cjs +1 -0
- package/dist/baseicon-Ct8wtBEp.cjs +34 -0
- package/dist/baseicon-DdvhP0UT.js +90 -0
- package/dist/baseinput-B6KUYtrd.js +37 -0
- package/dist/baseinput-D8710HSg.cjs +1 -0
- package/dist/bff/openapi.yaml +7 -0
- package/dist/button-M3QREAcT.cjs +651 -0
- package/dist/button-xI3Wu15Z.js +311 -0
- package/dist/calendar-B8nJAQne.js +2891 -0
- package/dist/calendar-CW9WbT3C.cjs +477 -0
- package/dist/card-BXosepCe.js +57 -0
- package/dist/card-Db30JagR.cjs +32 -0
- package/dist/check-BYTdkWQh.js +46 -0
- package/dist/check-D4kxzECF.cjs +2 -0
- package/dist/checkbox-BIDoCr_X.cjs +142 -0
- package/dist/checkbox-TAWN7HJG.js +323 -0
- package/dist/chevrondown-DLIH6sRy.cjs +2 -0
- package/dist/chevrondown-v3qKRLEG.js +46 -0
- package/dist/chevronleft-DMbyAEgw.cjs +2 -0
- package/dist/chevronleft-dQlHS1Vs.js +46 -0
- package/dist/chevronright-B3qtGWZb.js +46 -0
- package/dist/chevronright-BisalZVe.cjs +2 -0
- package/dist/chip-CBoKYRL5.js +107 -0
- package/dist/chip-CLwNi1p_.cjs +54 -0
- package/dist/chunk-BK-Lzi7j.cjs +1 -0
- package/dist/chunk-DgQ9yJBH.js +17 -0
- package/dist/classnames-4RuV7Ryo.js +19 -0
- package/dist/classnames-DqVQ5xbt.cjs +1 -0
- package/dist/containers.cjs +23 -26
- package/dist/containers.d.ts +1 -136
- package/dist/containers.js +4476 -5541
- package/dist/focustrap-BhHF6zvb.js +558 -0
- package/dist/focustrap-C_v0dFmU.cjs +152 -0
- package/dist/inputnumber-CvuB8fHc.cjs +195 -0
- package/dist/inputnumber-UfGZdwk2.js +983 -0
- package/dist/inputtext-B-iUN1cV.js +108 -0
- package/dist/inputtext-D2Ay4aYr.cjs +79 -0
- package/dist/legalConsent-B3erdrHX.cjs +1 -0
- package/dist/legalConsent-kc_KWyR6.js +66 -0
- package/dist/lib.cjs +1331 -1
- package/dist/lib.d.ts +2 -748
- package/dist/lib.js +22977 -35
- package/dist/locales-4eL4-K7f.js +3168 -0
- package/dist/locales-DzyBr_JU.cjs +5 -0
- package/dist/markdown-Cb6J3R4j.js +28 -0
- package/dist/markdown-Dxqg6Ggd.cjs +1 -0
- package/dist/network-DD_yGfK6.js +2404 -0
- package/dist/network-uPe9-HeS.cjs +9 -0
- package/dist/network.cjs +1 -1
- package/dist/network.d.ts +3 -123
- package/dist/network.js +2 -48
- package/dist/portal-BbZw4bN9.js +265 -0
- package/dist/portal-pIcEXWz1.cjs +2 -0
- package/dist/{index-EDm9-cRY.cjs → progressbar-BPR5tRX7.cjs} +2 -2
- package/dist/progressbar-CzckKCUr.js +96 -0
- package/dist/rating-DsIxcJXU.js +332 -0
- package/dist/rating-HfRWRXuI.cjs +61 -0
- package/dist/ripple-CoTE8rF8.js +501 -0
- package/dist/ripple-UYfqtU0m.cjs +24 -0
- package/dist/router-CR-sxf1q.js +34 -0
- package/dist/router-qXH6kffG.cjs +1 -0
- package/dist/router.cjs +1 -1
- package/dist/router.d.ts +1 -74
- package/dist/router.js +2 -16
- package/dist/select-C05BBcmi.js +2357 -0
- package/dist/select-CZouTpLB.cjs +360 -0
- package/dist/src/components/AutoroutedBreadcrumb/AutoroutedBreadcrumb.vue.d.ts +9 -0
- package/dist/src/components/AutoroutedBreadcrumb/index.d.ts +1 -0
- package/dist/src/components/ControlBarComponent/ConfiguredControlBarComponent.vue.d.ts +30 -0
- package/dist/src/components/ControlBarComponent/ControlBarComponent.vue.d.ts +17 -0
- package/dist/src/components/ControlBarComponent/ControlBarItemComponent.vue.d.ts +20 -0
- package/dist/src/components/ControlBarComponent/index.d.ts +3 -0
- package/dist/src/components/DashboardComponent/DashboardComponent.vue.d.ts +21 -0
- package/dist/src/components/DashboardComponent/DashboardGroupComponent.vue.d.ts +25 -0
- package/dist/src/components/DashboardComponent/DashboardPanelComponent.vue.d.ts +26 -0
- package/dist/src/components/DashboardComponent/index.d.ts +3 -0
- package/dist/src/components/FormComponent/FormComponent.vue.d.ts +32 -0
- package/dist/src/components/FormComponent/index.d.ts +1 -0
- package/dist/src/components/GanttChartComponent/GanttChartComponent.vue.d.ts +26 -0
- package/dist/src/components/GanttChartComponent/GanttChartGrid.vue.d.ts +34 -0
- package/dist/src/components/GanttChartComponent/GanttChartHeaderGrid.vue.d.ts +7 -0
- package/dist/src/components/GanttChartComponent/GanttChartHeaderLabel.vue.d.ts +6 -0
- package/dist/src/components/GanttChartComponent/GanttChartLinksOverlay.vue.d.ts +12 -0
- package/dist/src/components/GanttChartComponent/GanttChartRowGrid.vue.d.ts +55 -0
- package/dist/src/components/GanttChartComponent/GanttChartRowLabel.vue.d.ts +7 -0
- package/dist/src/components/GanttChartComponent/composables/useGanttLinks.d.ts +37 -0
- package/dist/src/components/GanttChartComponent/composables/useGanttSizing.d.ts +9 -0
- package/dist/src/components/GanttChartComponent/ganttChartLayout.d.ts +42 -0
- package/dist/src/components/GanttChartComponent/ganttChartTypes.d.ts +22 -0
- package/dist/src/components/GanttChartComponent/index.d.ts +1 -0
- package/dist/src/components/NetworkButton/ApiMutationButton.vue.d.ts +3 -0
- package/dist/src/components/NetworkButton/ApiQueryButton.vue.d.ts +3 -0
- package/dist/src/components/NetworkButton/index.d.ts +3 -0
- package/dist/src/components/NetworkButton/types.d.ts +39 -0
- package/dist/src/components/NotFound/NotFound.vue.d.ts +26 -0
- package/dist/src/components/NotFound/index.d.ts +1 -0
- package/dist/src/components/PageComponent/PageComponent.vue.d.ts +22 -0
- package/dist/src/components/PageComponent/index.d.ts +1 -0
- package/dist/src/components/PlotlyComponent/PlotlyComponent.vue.d.ts +14 -0
- package/dist/src/components/PlotlyComponent/PlotlyFromTableComponent.vue.d.ts +16 -0
- package/dist/src/components/PlotlyComponent/index.d.ts +2 -0
- package/dist/src/components/TableComponent/TableComponent.vue.d.ts +29 -0
- package/dist/src/components/TableComponent/index.d.ts +1 -0
- package/dist/src/composables/useComponentResolver.d.ts +9 -0
- package/dist/src/composables/useValidatorResolver.d.ts +9 -0
- package/dist/src/containers/BareContainer/BareContainer.vue.d.ts +8 -0
- package/dist/src/containers/BareContainer/index.d.ts +2 -0
- package/dist/src/containers/LayoutContainer/LayoutContainer.vue.d.ts +13 -0
- package/dist/src/containers/LayoutContainer/MobileNavigationComponent/MobileNavigationComponent.vue.d.ts +7 -0
- package/dist/src/containers/LayoutContainer/SideNavigationComponent/MainComponent/MainComponent.vue.d.ts +6 -0
- package/dist/src/containers/LayoutContainer/SideNavigationComponent/MainComponent/NavigationLinkComponent.vue.d.ts +11 -0
- package/dist/src/containers/LayoutContainer/SideNavigationComponent/SideNavigationComponent.vue.d.ts +7 -0
- package/dist/src/containers/LayoutContainer/SideNavigationComponent/TopComponent/TopComponent.vue.d.ts +7 -0
- package/dist/src/containers/LayoutContainer/index.d.ts +1 -0
- package/dist/src/containers/NavbarContainer/NavbarContainer.vue.d.ts +6 -0
- package/dist/src/containers/NavbarContainer/index.d.ts +2 -0
- package/dist/src/containers/RoutedTabsComponent/RoutedTabsComponent.vue.d.ts +12 -0
- package/dist/src/containers/RoutedTabsComponent/index.d.ts +1 -0
- package/dist/src/containers/SideMenuContainer/SideMenuContainer.vue.d.ts +7 -0
- package/dist/src/containers/SideMenuContainer/index.d.ts +2 -0
- package/dist/src/containers/helpers.d.ts +47 -0
- package/dist/src/containers/index.d.ts +6 -0
- package/dist/src/lib.d.ts +24 -0
- package/dist/src/locales/index.d.ts +30 -0
- package/dist/src/network/apiClient.d.ts +32 -0
- package/dist/src/network/axios.d.ts +4 -0
- package/dist/src/network/index.d.ts +3 -0
- package/dist/src/network/typedApiClient.d.ts +58 -0
- package/dist/src/plugins/cookies/index.d.ts +51 -0
- package/dist/src/plugins/cookies/views/CookieBar.vue.d.ts +2 -0
- package/dist/src/plugins/cookies/views/CookiesConsent.vue.d.ts +2 -0
- package/dist/src/plugins/index.d.ts +1 -0
- package/dist/src/plugins/legalConsent/index.d.ts +89 -0
- package/dist/src/plugins/legalConsent/views/LegalConsent.vue.d.ts +2 -0
- package/dist/src/plugins/legalConsent/views/LegalDocument.vue.d.ts +8 -0
- package/dist/src/router/guards.d.ts +28 -0
- package/dist/src/router/index.d.ts +3 -0
- package/dist/src/router/libRoutes.d.ts +2 -0
- package/dist/src/router/types.d.ts +31 -0
- package/dist/src/stores/backend/common.d.ts +17 -0
- package/dist/src/stores/backend/constants.d.ts +19 -0
- package/dist/src/stores/backend/schemes/jwt.d.ts +22 -0
- package/dist/src/stores/backend/schemes/oauth.d.ts +14 -0
- package/dist/src/stores/backend/schemes/token.d.ts +20 -0
- package/dist/src/stores/backend/types.d.ts +88 -0
- package/dist/src/stores/backend.d.ts +5 -0
- package/dist/src/stores/darkMode.d.ts +29 -0
- package/dist/src/stores/index.d.ts +2 -0
- package/dist/src/theme/index.d.ts +2 -0
- package/dist/src/theme/nside.d.ts +2 -0
- package/dist/src/utils/color.d.ts +33 -0
- package/dist/src/utils/componentRegistry.d.ts +15 -0
- package/dist/src/utils/markdown.d.ts +24 -0
- package/dist/src/utils/translations.d.ts +8 -0
- package/dist/src/utils/validatorRegistry.d.ts +8 -0
- package/dist/src/views/LoginView.vue.d.ts +5 -0
- package/dist/src/views/LogoutView.vue.d.ts +2 -0
- package/dist/stores-BAbCgIKW.cjs +1 -0
- package/dist/stores-C5CUNzM_.js +203 -0
- package/dist/textarea-DUmMHVXf.cjs +84 -0
- package/dist/textarea-f6-j7m1N.js +131 -0
- package/dist/times--t6-zeg6.js +46 -0
- package/dist/times-GcOHYs3E.cjs +2 -0
- package/dist/timescircle-CHGzPrwL.cjs +2 -0
- package/dist/timescircle-_NJIsGD1.js +48 -0
- package/dist/wefa.css +2 -1
- package/package.json +42 -35
- package/scripts/verify-package-types.mjs +103 -0
- package/src/components/DashboardComponent/DashboardGroupComponent.vue +1 -1
- package/src/components/NetworkButton/__tests__/ApiMutationButton.test.ts +12 -3
- package/src/components/NetworkButton/__tests__/ApiQueryButton.test.ts +12 -3
- package/src/containers/LayoutContainer/SideNavigationComponent/MainComponent/NavigationLinkComponent.vue +1 -1
- package/src/containers/SideMenuContainer/SideMenuContainer.vue +14 -3
- package/src/containers/helpers.ts +1 -1
- package/src/router/guards.ts +2 -2
- package/src/stores/__tests__/backend/jwt.test.ts +6 -6
- package/src/stores/__tests__/backend/oauth.test.ts +1 -1
- package/src/stores/__tests__/backend/token.test.ts +5 -5
- package/src/stores/backend/schemes/jwt.ts +3 -3
- package/src/stores/backend/schemes/token.ts +6 -7
- package/dist/LegalConsent-DQ7fkgVc.cjs +0 -1
- package/dist/LegalConsent-OLyvuzRY.js +0 -151
- package/dist/LegalDocument-B-nntRW7.cjs +0 -109
- package/dist/LegalDocument-BKebNzIK.js +0 -1330
- package/dist/LoginView-DUPa_PsC.js +0 -24
- package/dist/LoginView-Dihs8n_X.cjs +0 -1
- package/dist/LogoutView-DAh7MrFi.js +0 -19
- package/dist/LogoutView-Fl3nfeJ0.cjs +0 -1
- package/dist/apiClient-BHDjT0dU.js +0 -928
- package/dist/apiClient-Cr0IvG5Z.cjs +0 -1
- package/dist/axios-CZvsFspN.js +0 -1887
- package/dist/axios-DMqeKDaq.cjs +0 -6
- package/dist/index--_rUTrqU.js +0 -1414
- package/dist/index-05ASaj7N.cjs +0 -477
- package/dist/index-B7hJ2pku.cjs +0 -61
- package/dist/index-BHSxFTgZ.js +0 -49
- package/dist/index-BaA_oL1s.cjs +0 -32
- package/dist/index-Be5h48vc.js +0 -3530
- package/dist/index-Becfy0pF.cjs +0 -2
- package/dist/index-CPv4agmV.js +0 -400
- package/dist/index-CgAb-gZi.js +0 -89
- package/dist/index-DFSkcsx-.cjs +0 -943
- package/dist/index-DGUVQqZw.js +0 -208
- package/dist/index-DRozw3P8.js +0 -167
- package/dist/index-DfCQoHSf.cjs +0 -146
- package/dist/index-DkuJMEY1.js +0 -6731
- package/dist/index-Dv6jyKbT.js +0 -47
- package/dist/index-IGN7_cyg.cjs +0 -2
- package/dist/index-lFl6UsTa.js +0 -212
- package/dist/index-lQmq7gxp.cjs +0 -54
- package/dist/index-t0sdL3f2.cjs +0 -84
- package/dist/lib-DZzubLGt.js +0 -26376
- package/dist/lib-lTzD7ltX.cjs +0 -2104
- package/dist/libRoutes-B-H3e9wZ.js +0 -22
- package/dist/libRoutes-Cl3TklhN.cjs +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GenericContainerProps } from '../helpers';
|
|
2
|
+
export interface NavBarContainerProps extends GenericContainerProps {
|
|
3
|
+
depth?: number;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<NavBarContainerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<NavBarContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for the RoutedTabsComponent
|
|
3
|
+
*/
|
|
4
|
+
export interface RoutedTabsComponentProps {
|
|
5
|
+
/** Array of tab names that correspond to route names */
|
|
6
|
+
tabs: string[];
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<RoutedTabsComponentProps, {
|
|
9
|
+
activeTabIndex: import('vue').ComputedRef<number>;
|
|
10
|
+
onTabChange: (value: string | number) => void;
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<RoutedTabsComponentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as RoutedTabsComponent, type RoutedTabsComponentProps, } from './RoutedTabsComponent.vue';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GenericContainerProps } from '../helpers';
|
|
2
|
+
export interface SideMenuContainerProps extends GenericContainerProps {
|
|
3
|
+
depth?: 1 | 2;
|
|
4
|
+
width?: number;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<SideMenuContainerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SideMenuContainerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { MenuItem } from 'primevue/menuitem';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { RouteLocationMatched, RouteRecordRaw, RouteLocationAsRelativeGeneric, RouteLocationAsPathGeneric } from 'vue-router';
|
|
4
|
+
export interface GenericContainerProps {
|
|
5
|
+
depth?: number;
|
|
6
|
+
start?: {
|
|
7
|
+
logo?: string;
|
|
8
|
+
appName?: string;
|
|
9
|
+
};
|
|
10
|
+
end?: {
|
|
11
|
+
showUser: boolean;
|
|
12
|
+
showSettings: boolean;
|
|
13
|
+
showLogout: boolean;
|
|
14
|
+
settingsRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
|
|
15
|
+
logoutRoute: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Generates a list of PrimeVue-compatible MenuItem by inspecting children of a provided route
|
|
20
|
+
* @param routeLocationMatched route to inspect, obtain with useRoute().matched[routerViewDepth]
|
|
21
|
+
* @param depth how deep to recursively look for children, 1 is the base
|
|
22
|
+
* @returns MenuItem[] compatible with PrimeVue Menu components
|
|
23
|
+
*/
|
|
24
|
+
export declare function menuItemsFromRoute(routeLocationMatched: Ref<RouteLocationMatched>, depth?: number): MenuItem[];
|
|
25
|
+
/**
|
|
26
|
+
* Sub function of menuItemsFromRoute, used to build MenuItem instances
|
|
27
|
+
* @param routeRecordRaw recursion node
|
|
28
|
+
* @param parentPath required to build full paths
|
|
29
|
+
* @param maxDepth recursion limiter
|
|
30
|
+
* @param currentDepth recursion accumulator
|
|
31
|
+
* @returns MenuItem instance
|
|
32
|
+
*/
|
|
33
|
+
export declare function itemizeRouteRecordRaw(routeRecordRaw: RouteRecordRaw, parentPath: string, maxDepth: number, currentDepth: number): MenuItem;
|
|
34
|
+
/**
|
|
35
|
+
* Builds an end section to a PrimeVue-Menu-based component
|
|
36
|
+
* @param endProps "end" section of GenericContainerProps
|
|
37
|
+
* @returns MenuItem[] compatible with PrimeVue Menu components
|
|
38
|
+
*/
|
|
39
|
+
export declare function makeEndSectionMenuItems(endProps: GenericContainerProps['end']): MenuItem[];
|
|
40
|
+
/**
|
|
41
|
+
* Set up a Router depth tracker, used by container components to extract their target route from the router
|
|
42
|
+
* This NEEDS to be called on any component with a <RouterView />
|
|
43
|
+
* Use like this :
|
|
44
|
+
* const targetRoute = useRoute().matched[routerViewDepth]
|
|
45
|
+
* @returns current routerViewDepth on a component instance.
|
|
46
|
+
*/
|
|
47
|
+
export declare function setupDepthTracker(): number;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { Pinia } from 'pinia';
|
|
3
|
+
import { default as PrimeVue } from 'primevue/config';
|
|
4
|
+
export { PrimeVue as PrimeVueLibConfig };
|
|
5
|
+
export * from '../components/AutoroutedBreadcrumb';
|
|
6
|
+
export * from '../components/ControlBarComponent';
|
|
7
|
+
export * from '../components/GanttChartComponent';
|
|
8
|
+
export * from '../components/DashboardComponent';
|
|
9
|
+
export * from '../components/FormComponent';
|
|
10
|
+
export * from '../components/NetworkButton';
|
|
11
|
+
export * from '../components/NotFound';
|
|
12
|
+
export * from '../components/PlotlyComponent';
|
|
13
|
+
export * from '../components/TableComponent';
|
|
14
|
+
export * from '../theme';
|
|
15
|
+
export * from '../stores';
|
|
16
|
+
export * from '../plugins';
|
|
17
|
+
export * from '../locales';
|
|
18
|
+
export * from '../utils/markdown';
|
|
19
|
+
declare const _default: {
|
|
20
|
+
install(app: App, options?: {
|
|
21
|
+
pinia?: Pinia;
|
|
22
|
+
}): void;
|
|
23
|
+
};
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { I18nOptions, LocaleMessages, LocaleMessageValue } from 'vue-i18n';
|
|
2
|
+
/**
|
|
3
|
+
* Load project translation files dynamically (for consumer use)
|
|
4
|
+
* This function scans the specified glob pattern for JSON files in the locales directory,
|
|
5
|
+
* @param glob Glob pattern to match translation files
|
|
6
|
+
* @returns An object containing the loaded translations, structured by locale and root field.
|
|
7
|
+
*/
|
|
8
|
+
export declare function loadTranslations(glob?: Record<string, {
|
|
9
|
+
default: Record<string, LocaleMessageValue>;
|
|
10
|
+
}> | undefined): LocaleMessages<Record<string, LocaleMessageValue>>;
|
|
11
|
+
/**
|
|
12
|
+
* Create the i18n instance with merged messages
|
|
13
|
+
* This function merges library default translations with project-provided messages,
|
|
14
|
+
* allowing project overrides to take precedence.
|
|
15
|
+
* It supports dynamic loading of translations and provides a consistent i18n setup.
|
|
16
|
+
* @param options I18nOptions
|
|
17
|
+
* @returns I18n instance
|
|
18
|
+
*/
|
|
19
|
+
export declare function createLibI18n(options?: I18nOptions): import('vue-i18n').I18n<LocaleMessages<Record<string, LocaleMessageValue>>, {}, {}, string, true>;
|
|
20
|
+
/**
|
|
21
|
+
* Composable for components to use i18n
|
|
22
|
+
* @returns An object with `t` and `mergeLocaleMessage` methods for translation and dynamic message merging.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useI18nLib(): import('vue-i18n').Composer<{}, {}, {}, string, never, string>;
|
|
25
|
+
/**
|
|
26
|
+
* Utility to add or override translations dynamically after creation
|
|
27
|
+
* @param locale The locale to register translations for
|
|
28
|
+
* @param messages The translation messages to add or override
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerTranslations(locale: string, messages: LocaleMessages<LocaleMessageValue>): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { UseQueryReturnType, UseQueryOptions, UseMutationReturnType, UseMutationOptions } from '@tanstack/vue-query';
|
|
3
|
+
import { AxiosError } from 'axios';
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a generic HTTP GET request (by URL) with TanStack useQuery.
|
|
6
|
+
* The API is called automatically again when the URL changes.
|
|
7
|
+
* The API is not called if the URL is ref(undefined).
|
|
8
|
+
* @param url ref to a string or undefined, the endpoint to call
|
|
9
|
+
* @param queryOptions TanStack useQuery options: https://tanstack.com/query/v5/docs/framework/vue/reference/useQuery
|
|
10
|
+
* @returns TanStack useQuery return: https://tanstack.com/query/v5/docs/framework/vue/reference/useQuery
|
|
11
|
+
*
|
|
12
|
+
* Example usage:
|
|
13
|
+
* const { data, isLoading, error } = apiClient.query(ref('/api/get-data/'))
|
|
14
|
+
*/
|
|
15
|
+
declare function query(url: Ref<string | undefined>, queryOptions?: Omit<UseQueryOptions<unknown>, 'queryKey' | 'queryFn'>): UseQueryReturnType<any, AxiosError>;
|
|
16
|
+
/**
|
|
17
|
+
* Wraps a generic HTTP POST request (by URL and body) with TanStack useMutation.
|
|
18
|
+
* The API is not called if the URL is ref(undefined).
|
|
19
|
+
* @param url ref to a string or undefined, the endpoint to call
|
|
20
|
+
* @param mutationOptions TanStack useMutation options: https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation
|
|
21
|
+
* @returns TanStack useMutation return: https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation
|
|
22
|
+
*
|
|
23
|
+
* Example usage:
|
|
24
|
+
* const mutation = apiClient.mutation(ref('/api/post-data/'))
|
|
25
|
+
* mutation.mutate({ foo: 'bar' })
|
|
26
|
+
*/
|
|
27
|
+
declare function mutation(url: Ref<string | undefined>, mutationOptions?: Omit<UseMutationOptions<unknown, AxiosError, any>, 'mutationFn'>): UseMutationReturnType<unknown, AxiosError, any, unknown>;
|
|
28
|
+
declare const _default: {
|
|
29
|
+
query: typeof query;
|
|
30
|
+
mutation: typeof mutation;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { UseQueryReturnType, UseQueryOptions, UseMutationReturnType, UseMutationOptions } from '@tanstack/vue-query';
|
|
2
|
+
import { AxiosError, AxiosInstance } from 'axios';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Attaches an axios instance to an OpenAPI Client/SDK,
|
|
6
|
+
* autogenerated by @hey-api/openapi-ts.
|
|
7
|
+
* You need to call this during application startup to have a working OpenAPI Client
|
|
8
|
+
* E.g., if you're running: npx @hey-api/openapi-ts --input .path/to/openapi.yaml --output ./src/openapi
|
|
9
|
+
* Then you will have your generated code in @/openapi, and then you can:
|
|
10
|
+
* import { client } from '@/openapi/client.gen'
|
|
11
|
+
* import { typedApiClient } from '@nside/wefa/network'
|
|
12
|
+
* typedApiClient.setupOpenApiClient(client)
|
|
13
|
+
* @param client Auto-generated OpenAPI client
|
|
14
|
+
* @param axios Optional axios instance. If not provided, it defaults to the axios singleton.
|
|
15
|
+
*/
|
|
16
|
+
declare function setupOpenApiClient(client: any, axios?: AxiosInstance): void;
|
|
17
|
+
type ExtractQueryOptionsType<T> = T extends (options: infer O) => any ? O : never;
|
|
18
|
+
type ExtractQueryDataType<T> = T extends (options: any) => Promise<{
|
|
19
|
+
data: infer D;
|
|
20
|
+
}> ? D : T extends (options: any) => {
|
|
21
|
+
data: infer D;
|
|
22
|
+
} ? D : never;
|
|
23
|
+
/**
|
|
24
|
+
* Wraps a auto-generated OpenAPI query with TanStack useQuery,
|
|
25
|
+
* providing many state-management helpers around the query
|
|
26
|
+
* @param callable Auto-generated function from an GET endpoint, using @hey-api/openapi-ts
|
|
27
|
+
* @param options reactive options expected by and passed to the callable, e.g to build the URL. If ref(undefined) is provided, the query is not called
|
|
28
|
+
* @param queryOptions TanStack useQuery options : https://tanstack.com/query/v5/docs/framework/vue/reference/useQuery
|
|
29
|
+
* @returns TanStack useQuery return : https://tanstack.com/query/v5/docs/framework/vue/reference/useQuery
|
|
30
|
+
*/
|
|
31
|
+
export declare function query<TCallable extends (options: any) => any, TOptions extends ExtractQueryOptionsType<TCallable>, TData extends ExtractQueryDataType<TCallable>>(callable: TCallable, options: Ref<TOptions | undefined>, queryOptions?: Omit<UseQueryOptions<TData>, 'queryKey' | 'queryFn'>): UseQueryReturnType<TData, Error>;
|
|
32
|
+
type ExtractMutationOptionsType<T> = T extends (options: infer O) => any ? O : never;
|
|
33
|
+
type ExtractMutationDataType<T> = T extends (options: any) => Promise<{
|
|
34
|
+
data: infer D;
|
|
35
|
+
}> ? D : T extends (options: any) => {
|
|
36
|
+
data: infer D;
|
|
37
|
+
} ? D : never;
|
|
38
|
+
/**
|
|
39
|
+
* Wraps an auto-generated OpenAPI mutation (POST/PUT/DELETE) with TanStack useMutation,
|
|
40
|
+
* providing state-management helpers and lifecycle hooks for the mutation.
|
|
41
|
+
* @param callable Auto-generated function from a mutation endpoint (POST/PUT/DELETE), using @hey-api/openapi-ts
|
|
42
|
+
* @param mutationOptions TanStack useMutation options: https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation
|
|
43
|
+
* @returns TanStack useMutation return: https://tanstack.com/query/v5/docs/framework/vue/reference/useMutation
|
|
44
|
+
*
|
|
45
|
+
* Example usage:
|
|
46
|
+
* const mutation = typedApiClient.mutation(postHello, {
|
|
47
|
+
* onSuccess: (data) => { ... },
|
|
48
|
+
* onError: (error) => { ... }
|
|
49
|
+
* })
|
|
50
|
+
* mutation.mutate(options)
|
|
51
|
+
*/
|
|
52
|
+
export declare function mutation<TCallable extends (options: any) => any, TOptions extends ExtractMutationOptionsType<TCallable>, TData extends ExtractMutationDataType<TCallable>>(callable: TCallable, mutationOptions?: Omit<UseMutationOptions<TData, AxiosError, TOptions>, 'mutationFn'>): UseMutationReturnType<TData, AxiosError, TOptions, unknown>;
|
|
53
|
+
declare const _default: {
|
|
54
|
+
query: typeof query;
|
|
55
|
+
mutation: typeof mutation;
|
|
56
|
+
setupOpenApiClient: typeof setupOpenApiClient;
|
|
57
|
+
};
|
|
58
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { App, Ref } from 'vue';
|
|
2
|
+
type CookieType = 'Essential' | 'Performance' | 'Analytics' | 'Advertising';
|
|
3
|
+
export interface CookieConfiguration {
|
|
4
|
+
type: CookieType;
|
|
5
|
+
key: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CookiesPluginOptions {
|
|
10
|
+
cookies: CookieConfiguration[];
|
|
11
|
+
}
|
|
12
|
+
export interface CookieConsent {
|
|
13
|
+
key: string;
|
|
14
|
+
consent: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Cookie {
|
|
17
|
+
configuration: CookieConfiguration;
|
|
18
|
+
consent: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const cookiesPlugin: {
|
|
21
|
+
install(app: App, options: CookiesPluginOptions): void;
|
|
22
|
+
};
|
|
23
|
+
export declare const useCookiesStore: import('pinia').StoreDefinition<"cookiesStore", Pick<{
|
|
24
|
+
initialize: (cookieConfigurations: CookieConfiguration[]) => void;
|
|
25
|
+
reviewNeeded: Ref<boolean, boolean>;
|
|
26
|
+
cookies: Ref<Cookie[], Cookie[]>;
|
|
27
|
+
showDialog: () => void;
|
|
28
|
+
acceptAllCookies: () => void;
|
|
29
|
+
rejectAllCookies: () => void;
|
|
30
|
+
saveCookiePreferences: () => void;
|
|
31
|
+
toggleDialog: Ref<boolean, boolean>;
|
|
32
|
+
}, "reviewNeeded" | "cookies" | "toggleDialog">, Pick<{
|
|
33
|
+
initialize: (cookieConfigurations: CookieConfiguration[]) => void;
|
|
34
|
+
reviewNeeded: Ref<boolean, boolean>;
|
|
35
|
+
cookies: Ref<Cookie[], Cookie[]>;
|
|
36
|
+
showDialog: () => void;
|
|
37
|
+
acceptAllCookies: () => void;
|
|
38
|
+
rejectAllCookies: () => void;
|
|
39
|
+
saveCookiePreferences: () => void;
|
|
40
|
+
toggleDialog: Ref<boolean, boolean>;
|
|
41
|
+
}, never>, Pick<{
|
|
42
|
+
initialize: (cookieConfigurations: CookieConfiguration[]) => void;
|
|
43
|
+
reviewNeeded: Ref<boolean, boolean>;
|
|
44
|
+
cookies: Ref<Cookie[], Cookie[]>;
|
|
45
|
+
showDialog: () => void;
|
|
46
|
+
acceptAllCookies: () => void;
|
|
47
|
+
rejectAllCookies: () => void;
|
|
48
|
+
saveCookiePreferences: () => void;
|
|
49
|
+
toggleDialog: Ref<boolean, boolean>;
|
|
50
|
+
}, "initialize" | "showDialog" | "acceptAllCookies" | "rejectAllCookies" | "saveCookiePreferences">>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as legalConsentPlugin, defaultPrivacyNoticeRoute, defaultLegalConsentRoute, defaultTermsOfUseRoute, useLegalStore, type LegalConsent, type LegalConsentOptions, } from './legalConsent';
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { App, Ref } from 'vue';
|
|
2
|
+
import { Router, RouteRecordRaw } from 'vue-router';
|
|
3
|
+
import { BackendStore } from '../../../stores';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the legal consent status for a user
|
|
6
|
+
*/
|
|
7
|
+
export interface LegalConsent {
|
|
8
|
+
/** Version number of the legal consent document */
|
|
9
|
+
version: number;
|
|
10
|
+
/** Date when the consent was accepted (ISO string from API or Date object in app) */
|
|
11
|
+
accepted_at: string | Date;
|
|
12
|
+
/** Whether the current consent is still valid */
|
|
13
|
+
valid: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Configuration options for the legal consent plugin
|
|
17
|
+
*/
|
|
18
|
+
export interface LegalConsentOptions {
|
|
19
|
+
/** Backend store instance for managing authentication state */
|
|
20
|
+
backendStore: BackendStore;
|
|
21
|
+
/** Vue Router instance for route management */
|
|
22
|
+
router: Router;
|
|
23
|
+
/** API endpoint path for legal consent operations */
|
|
24
|
+
path: string;
|
|
25
|
+
/** Custom route configuration for terms of use page (optional) */
|
|
26
|
+
termsOfUseRoute?: RouteRecordRaw;
|
|
27
|
+
/** Custom route configuration for privacy notice page (optional) */
|
|
28
|
+
privacyNoticeRoute?: RouteRecordRaw;
|
|
29
|
+
/** Custom route configuration for legal consent page (optional) */
|
|
30
|
+
legalConsentRoute?: RouteRecordRaw;
|
|
31
|
+
}
|
|
32
|
+
/** Default route configuration for terms of use page */
|
|
33
|
+
export declare const defaultTermsOfUseRoute: RouteRecordRaw;
|
|
34
|
+
/** Default route configuration for privacy notice page */
|
|
35
|
+
export declare const defaultPrivacyNoticeRoute: RouteRecordRaw;
|
|
36
|
+
/** Default route configuration for legal consent page */
|
|
37
|
+
export declare const defaultLegalConsentRoute: RouteRecordRaw;
|
|
38
|
+
/**
|
|
39
|
+
* Vue plugin for legal consent management
|
|
40
|
+
*
|
|
41
|
+
* This plugin provides comprehensive legal consent functionality, including:
|
|
42
|
+
* - Route management for terms of use, privacy notice, and consent pages
|
|
43
|
+
* - Navigation guards to enforce consent requirements
|
|
44
|
+
* - Store integration for consent state management
|
|
45
|
+
* - Automatic route registration and backend integration
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* app.use(legalConsentPlugin, {
|
|
49
|
+
* backendStore: myBackendStore,
|
|
50
|
+
* router: myRouter,
|
|
51
|
+
* path: 'api/legal'
|
|
52
|
+
* })
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const legalConsentPlugin: {
|
|
56
|
+
/**
|
|
57
|
+
* Installs the legal consent plugin
|
|
58
|
+
* @param app - Vue application instance
|
|
59
|
+
* @param options - Plugin configuration options
|
|
60
|
+
*/
|
|
61
|
+
install(app: App, options: LegalConsentOptions): Promise<void>;
|
|
62
|
+
};
|
|
63
|
+
export default legalConsentPlugin;
|
|
64
|
+
/**
|
|
65
|
+
* Pinia store for managing legal consent state and operations
|
|
66
|
+
*
|
|
67
|
+
* This store handles:
|
|
68
|
+
* - Storing current legal consent status
|
|
69
|
+
* - Managing API endpoint configuration
|
|
70
|
+
* - Fetching consent data from backend
|
|
71
|
+
* - Accepting legal consent
|
|
72
|
+
* - Watching for authentication changes to trigger consent fetching
|
|
73
|
+
*/
|
|
74
|
+
export declare const useLegalStore: import('pinia').StoreDefinition<"legalStore", Pick<{
|
|
75
|
+
legalEndpoint: Ref<string | undefined, string | undefined>;
|
|
76
|
+
legalConsent: Ref<LegalConsent | null, LegalConsent | null>;
|
|
77
|
+
fetchLegalConsent: () => Promise<void>;
|
|
78
|
+
acceptLegalConsent: () => Promise<void>;
|
|
79
|
+
}, "legalEndpoint" | "legalConsent">, Pick<{
|
|
80
|
+
legalEndpoint: Ref<string | undefined, string | undefined>;
|
|
81
|
+
legalConsent: Ref<LegalConsent | null, LegalConsent | null>;
|
|
82
|
+
fetchLegalConsent: () => Promise<void>;
|
|
83
|
+
acceptLegalConsent: () => Promise<void>;
|
|
84
|
+
}, never>, Pick<{
|
|
85
|
+
legalEndpoint: Ref<string | undefined, string | undefined>;
|
|
86
|
+
legalConsent: Ref<LegalConsent | null, LegalConsent | null>;
|
|
87
|
+
fetchLegalConsent: () => Promise<void>;
|
|
88
|
+
acceptLegalConsent: () => Promise<void>;
|
|
89
|
+
}, "fetchLegalConsent" | "acceptLegalConsent">>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface LegalDocumentProps {
|
|
2
|
+
classes?: string;
|
|
3
|
+
documentEndpoint: string;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import('vue').DefineComponent<LegalDocumentProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<LegalDocumentProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
6
|
+
'legal-document': HTMLDivElement;
|
|
7
|
+
}, HTMLElement>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RouteLocationNormalized, NavigationGuardNext, RouteLocationRaw, RouteLocationNormalizedLoaded } from 'vue-router';
|
|
2
|
+
/**
|
|
3
|
+
* Checks that users are authenticated before navigating to routes with meta.wefa.requiresAuth
|
|
4
|
+
* If the check fails, users are redirected to the route specified in redirect
|
|
5
|
+
* This is useful if you want to prevent users from accessing your app if they're not authenticated
|
|
6
|
+
* @param to RouteLocationNormalized, pass as-is from router.beforeEach
|
|
7
|
+
* @param from RouteLocationNormalizedLoaded, pass as-is from router.beforeEach
|
|
8
|
+
* @param next NavigationGuardNext, pass as-is from router.beforeEach
|
|
9
|
+
* @param redirect RouteLocationRaw to be used if guard check fails, default is {name: libRouteRecords.login.name}
|
|
10
|
+
*/
|
|
11
|
+
export declare function requiresAuth(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext, redirect?: RouteLocationRaw): void;
|
|
12
|
+
/**
|
|
13
|
+
* Checks that users are unauthenticated before navigating to routes with meta.wefa.requiresUnauth
|
|
14
|
+
* If the check fails, users are redirected to the route specified in redirect
|
|
15
|
+
* This is useful e.g if you want your users to skip the login page if they're already logged in
|
|
16
|
+
* @param to RouteLocationNormalized, pass as-is from router.beforeEach
|
|
17
|
+
* @param from RouteLocationNormalizedLoaded, pass as-is from router.beforeEach
|
|
18
|
+
* @param next NavigationGuardNext, pass as-is from router.beforeEach
|
|
19
|
+
* @param redirect RouteLocationRaw to be used if guard check fails, default is {path: '/'}
|
|
20
|
+
*/
|
|
21
|
+
export declare function requiresUnauth(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext, redirect?: RouteLocationRaw): void;
|
|
22
|
+
/**
|
|
23
|
+
* Runs the default route guards provided by the lib
|
|
24
|
+
* @param to RouteLocationNormalized
|
|
25
|
+
* @param from RouteLocationNormalizedLoaded
|
|
26
|
+
* @param next NavigationGuardNext
|
|
27
|
+
*/
|
|
28
|
+
export declare function defaultRouteGuards(to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RouteMeta, RouteRecordRaw } from 'vue-router';
|
|
2
|
+
export interface WeFaRouteMeta {
|
|
3
|
+
title: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
requiresAuth?: boolean;
|
|
6
|
+
requiresUnauth?: boolean;
|
|
7
|
+
showInNavigation?: boolean;
|
|
8
|
+
section?: string;
|
|
9
|
+
}
|
|
10
|
+
export type WeFaRouteRecordRaw = RouteRecordRaw & {
|
|
11
|
+
meta: RouteMeta & {
|
|
12
|
+
wefa: WeFaRouteMeta;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Augment vue-router's RouteMeta globally so every route can carry WeFa metadata.
|
|
17
|
+
*
|
|
18
|
+
* Why:
|
|
19
|
+
* - Vue Router exposes `route.meta` as a shared interface (`RouteMeta`).
|
|
20
|
+
* - We add `wefa` to that interface so `route.meta.wefa` is type-safe everywhere
|
|
21
|
+
* (guards, containers, breadcrumb, stories, etc.).
|
|
22
|
+
*
|
|
23
|
+
* Notes:
|
|
24
|
+
* - `wefa` is optional (`?`) because not every route must define it.
|
|
25
|
+
* - This is type-only: it changes TypeScript checking/autocomplete, not runtime behavior.
|
|
26
|
+
*/
|
|
27
|
+
declare module 'vue-router' {
|
|
28
|
+
interface RouteMeta {
|
|
29
|
+
wefa?: WeFaRouteMeta;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Ref, WatchHandle } from 'vue';
|
|
2
|
+
import { Router } from 'vue-router';
|
|
3
|
+
export interface CommonAuthFunctions {
|
|
4
|
+
setPostLogin: (fn: () => void) => void;
|
|
5
|
+
setPostLogout: (fn: () => void) => void;
|
|
6
|
+
setupAuthRouteGuard: (router: Router) => void;
|
|
7
|
+
unsetAuthRouteGuard: () => void;
|
|
8
|
+
authRouteGuardWatcher?: WatchHandle | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates common authentication functions that can be shared between different authentication implementations.
|
|
12
|
+
* @param authenticated - Reactive reference to the authentication state
|
|
13
|
+
* @param postLogin - Reactive reference to the post-login callback
|
|
14
|
+
* @param postLogout - Reactive reference to the post-logout callback
|
|
15
|
+
* @returns An object containing common authentication functions
|
|
16
|
+
*/
|
|
17
|
+
export declare function createCommonAuthFunctions(authenticated: Ref<boolean>, postLogin: Ref<() => void>, postLogout: Ref<() => void>): CommonAuthFunctions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A constant variable used as the key for storing and retrieving the authentication token
|
|
3
|
+
* in the browser's localStorage. This key is utilized to maintain user session or
|
|
4
|
+
* authentication state across browser sessions by securely saving the token locally.
|
|
5
|
+
*/
|
|
6
|
+
export declare const localStorageKey = "authenticationToken";
|
|
7
|
+
/**
|
|
8
|
+
* Constants used as keys for storing and retrieving JWT authentication tokens
|
|
9
|
+
* in the browser's localStorage. These keys are utilized to maintain user session or
|
|
10
|
+
* authentication state across browser sessions by securely saving the tokens locally.
|
|
11
|
+
*/
|
|
12
|
+
export declare const jwtAccessTokenKey = "jwtAccessToken";
|
|
13
|
+
export declare const jwtRefreshTokenKey = "jwtRefreshToken";
|
|
14
|
+
export declare const tokenLoginEndpoint = "/api/token-auth/";
|
|
15
|
+
export declare const jwtLoginEndpoint = "/api/token/";
|
|
16
|
+
export declare const jwtRefreshEndpoint = "/api/token/refresh/";
|
|
17
|
+
export declare const oauthLoginEndpoint = "/proxy/api/auth/login";
|
|
18
|
+
export declare const oauthLogoutEndpoint = "/proxy/api/auth/logout";
|
|
19
|
+
export declare const oauthSessionEndpoint = "/proxy/api/auth/session";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BackendStore, BackendStoreOptions } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Configures and sets up a JWT-based authentication backend store for managing API authentication.
|
|
4
|
+
*
|
|
5
|
+
* The method initializes authentication states, such as access and refresh tokens, login/logout handlers, and
|
|
6
|
+
* authentication interceptors on the axios instance for requests and responses.
|
|
7
|
+
* It also provides helper functions for handling authentication processes, like login, logout,
|
|
8
|
+
* and post-login/logout callbacks. Additionally, it enables the setting of route guards to
|
|
9
|
+
* respond to authentication status changes in a Vue.js application.
|
|
10
|
+
*
|
|
11
|
+
* This implementation is designed to work with a backend offering JWT mechanism.
|
|
12
|
+
* @param backendStoreOptions - Runtime configuration for endpoints and JWT-specific auth hooks.
|
|
13
|
+
* @returns An object containing authentication state, API client instance, and helper functions:
|
|
14
|
+
* - `axiosInstance`: Pre-configured axios instance with authentication support
|
|
15
|
+
* - `authenticated`: Reactive flag representing the authentication status
|
|
16
|
+
* - `login`: Function to authenticate users using credentials
|
|
17
|
+
* - `logout`: Function to deauthenticate users and clear authentication tokens
|
|
18
|
+
* - `setPostLogin`: Method to set a callback function invoked after successful login
|
|
19
|
+
* - `setPostLogout`: Method to set a callback function invoked after logout
|
|
20
|
+
* - `setupAuthRouteGuard`: Function to set up route guard for managing authentication-driven route reevaluations
|
|
21
|
+
*/
|
|
22
|
+
export declare function jwtAuthenticationBackendStoreSetup(backendStoreOptions: BackendStoreOptions): BackendStore;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BackendStore, BackendStoreOptions } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Configures and sets up an OAuth session-based authentication backend store.
|
|
4
|
+
*
|
|
5
|
+
* This implementation expects a Backend-for-Frontend (BFF) to manage OAuth login/logout flows and session cookies.
|
|
6
|
+
* It checks session state on initialization, initiates login when no session exists, and
|
|
7
|
+
* ensures axios requests include credentials.
|
|
8
|
+
*
|
|
9
|
+
* Consuming apps should call `useBackendStore` once at app startup, or ensure it is created
|
|
10
|
+
* before route guards run, so session state is resolved early.
|
|
11
|
+
* @param backendStoreOptions - Store configuration, including OAuth endpoint overrides and redirect handler.
|
|
12
|
+
* @returns An object containing authentication state, API client instance, and helper functions:
|
|
13
|
+
*/
|
|
14
|
+
export declare function oauthAuthenticationBackendStoreSetup(backendStoreOptions: BackendStoreOptions): BackendStore;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BackendStore, BackendStoreOptions } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Configures and sets up a token-based authentication backend store for managing API authentication.
|
|
4
|
+
*
|
|
5
|
+
* The method initializes authentication states, such as tokens, login/logout handlers, and
|
|
6
|
+
* authentication interceptors on the axiosInstance for requests and responses.
|
|
7
|
+
* It also provides helper functions for handling authentication processes, like login, logout,
|
|
8
|
+
* and post-login/logout callbacks. Additionally, it enables the setting of route guards to
|
|
9
|
+
* respond to authentication status changes in a Vue.js application.
|
|
10
|
+
* @param backendStoreOptions - Runtime configuration for endpoints and token-based auth hooks.
|
|
11
|
+
* @returns An object containing authentication state, API client instance, and helper functions:
|
|
12
|
+
* - `axiosInstance`: Pre-configured axios instance with authentication support
|
|
13
|
+
* - `authenticated`: Reactive flag representing the authentication status
|
|
14
|
+
* - `login`: Function to authenticate users using credentials
|
|
15
|
+
* - `logout`: Function to deauthenticate users and clear authentication tokens
|
|
16
|
+
* - `setPostLogin`: Method to set a callback function invoked after successful login
|
|
17
|
+
* - `setPostLogout`: Method to set a callback function invoked after logout
|
|
18
|
+
* - `setupAuthRouteGuard`: Function to set up route guard for managing authentication-driven route reevaluations
|
|
19
|
+
*/
|
|
20
|
+
export declare function tokenAuthenticationBackendStoreSetup(backendStoreOptions: BackendStoreOptions): BackendStore;
|