@zango-core/appbuilder 1.0.0-rc.1
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/ConfigurePage-DRzSb06z.js +29 -0
- package/dist/ConfigurePage-DRzSb06z.js.map +1 -0
- package/dist/LoginPageWithRoleSelection-xTr_eIWh.js +662 -0
- package/dist/LoginPageWithRoleSelection-xTr_eIWh.js.map +1 -0
- package/dist/PageTypeRegistry-5269IpiS.js +53 -0
- package/dist/PageTypeRegistry-5269IpiS.js.map +1 -0
- package/dist/index.framework-B8SMzgN1.js +28005 -0
- package/dist/index.framework-B8SMzgN1.js.map +1 -0
- package/dist/types/App.d.ts +14 -0
- package/dist/types/__tests__/mocks/data/appInitData.d.ts +197 -0
- package/dist/types/__tests__/mocks/data/authConfigData.d.ts +356 -0
- package/dist/types/__tests__/mocks/externalPackages.d.ts +42 -0
- package/dist/types/__tests__/mocks/handlers/appInit.handlers.d.ts +3 -0
- package/dist/types/__tests__/mocks/handlers/auth.handlers.d.ts +1 -0
- package/dist/types/__tests__/mocks/handlers/index.d.ts +5 -0
- package/dist/types/__tests__/mocks/handlers/profile.handlers.d.ts +15 -0
- package/dist/types/__tests__/mocks/handlers/session.handlers.d.ts +2 -0
- package/dist/types/__tests__/setup/setupDOMMatchers.d.ts +0 -0
- package/dist/types/__tests__/setup/setupMSW.d.ts +1 -0
- package/dist/types/__tests__/setup/setupTests.d.ts +34 -0
- package/dist/types/__tests__/utils/mockRouterUtils.d.ts +62 -0
- package/dist/types/__tests__/utils/renderWithProviders.d.ts +22 -0
- package/dist/types/__tests__/utils/waitForHelpers.d.ts +36 -0
- package/dist/types/auth/components/AuthMobileShell.d.ts +8 -0
- package/dist/types/auth/components/AuthProvider.d.ts +30 -0
- package/dist/types/auth/components/DynamicLoginForm.d.ts +9 -0
- package/dist/types/auth/components/ForgotPasswordForm.d.ts +11 -0
- package/dist/types/auth/components/LoginForm.d.ts +7 -0
- package/dist/types/auth/components/LoginRouter.d.ts +197 -0
- package/dist/types/auth/components/OAuthCallback.d.ts +19 -0
- package/dist/types/auth/components/OTPForm.d.ts +11 -0
- package/dist/types/auth/components/OTPInput.d.ts +8 -0
- package/dist/types/auth/components/PasswordResetRequired.d.ts +23 -0
- package/dist/types/auth/components/ProviderButton.d.ts +17 -0
- package/dist/types/auth/components/ResetPasswordForm.d.ts +12 -0
- package/dist/types/auth/components/RoleSelection.d.ts +25 -0
- package/dist/types/auth/components/SecondFactorAuth.d.ts +21 -0
- package/dist/types/auth/components/composable/OTPLoginForm.d.ts +17 -0
- package/dist/types/auth/components/composable/PasswordLoginForm.d.ts +17 -0
- package/dist/types/auth/components/composable/SSOButtons.d.ts +61 -0
- package/dist/types/auth/components/composable/index.d.ts +42 -0
- package/dist/types/auth/contexts/LoginContext.d.ts +6 -0
- package/dist/types/auth/hocs/withMultiStepAuth.d.ts +35 -0
- package/dist/types/auth/index.d.ts +23 -0
- package/dist/types/auth/pages/CompleteAuthFlow.d.ts +24 -0
- package/dist/types/auth/pages/LoginPage.d.ts +8 -0
- package/dist/types/auth/pages/LoginPageWithRoleSelection.d.ts +13 -0
- package/dist/types/auth/pages/OAuthCallbackPage.d.ts +17 -0
- package/dist/types/auth/pages/SAMLCallbackPage.d.ts +16 -0
- package/dist/types/auth/services/authService.d.ts +87 -0
- package/dist/types/auth/services/internal/apiClients.d.ts +9 -0
- package/dist/types/auth/services/internal/authState.d.ts +12 -0
- package/dist/types/auth/services/internal/errorHelper.d.ts +1 -0
- package/dist/types/auth/services/internal/oauthSamlService.d.ts +46 -0
- package/dist/types/auth/services/internal/passwordValidator.d.ts +17 -0
- package/dist/types/auth/services/network/api.d.ts +1629 -0
- package/dist/types/auth/services/network/base.d.ts +31 -0
- package/dist/types/auth/services/network/configuration.d.ts +74 -0
- package/dist/types/auth/services/network/index.d.ts +13 -0
- package/dist/types/auth/stores/index.d.ts +1 -0
- package/dist/types/auth/stores/useAuthStore.d.ts +6 -0
- package/dist/types/auth/types/index.d.ts +57 -0
- package/dist/types/auth/utils/authFlowHandler.d.ts +72 -0
- package/dist/types/auth/utils/authUtils.d.ts +21 -0
- package/dist/types/auth/utils/validators.d.ts +18 -0
- package/dist/types/components/ErrorBoundary.d.ts +23 -0
- package/dist/types/components/ErrorFallback.d.ts +8 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/ui/avatar.d.ts +11 -0
- package/dist/types/components/ui/button.d.ts +10 -0
- package/dist/types/components/ui/collapsible.d.ts +5 -0
- package/dist/types/components/ui/dialog.d.ts +13 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +10 -0
- package/dist/types/components/ui/empty.d.ts +8 -0
- package/dist/types/components/ui/index.d.ts +12 -0
- package/dist/types/components/ui/input.d.ts +3 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +14 -0
- package/dist/types/components/ui/sidebar.d.ts +69 -0
- package/dist/types/components/ui/skeleton.d.ts +2 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/framework/ZangoApp.d.ts +19 -0
- package/dist/types/framework/components/CachedLogo.d.ts +9 -0
- package/dist/types/framework/components/CustomPageFallback.d.ts +13 -0
- package/dist/types/framework/components/CustomPageLoader.d.ts +10 -0
- package/dist/types/framework/components/DocumentHead.d.ts +5 -0
- package/dist/types/framework/components/RouteErrorBoundary.d.ts +16 -0
- package/dist/types/framework/components/SessionSecurityDialog.d.ts +10 -0
- package/dist/types/framework/components/SessionSecurityProvider.d.ts +8 -0
- package/dist/types/framework/components/SmartLink.d.ts +13 -0
- package/dist/types/framework/components/layout/AppSidebar.d.ts +36 -0
- package/dist/types/framework/components/layout/Breadcrumbs.d.ts +2 -0
- package/dist/types/framework/components/layout/CommandPalette.d.ts +2 -0
- package/dist/types/framework/components/layout/Layout.d.ts +2 -0
- package/dist/types/framework/components/layout/Navbar.d.ts +9 -0
- package/dist/types/framework/components/layout/NavbarIcon.d.ts +12 -0
- package/dist/types/framework/components/layout/Topbar.d.ts +50 -0
- package/dist/types/framework/components/layout/UserProfileDrawer.d.ts +7 -0
- package/dist/types/framework/components/layout/profile/PasswordCard.d.ts +18 -0
- package/dist/types/framework/components/layout/profile/PersonalInfoCard.d.ts +12 -0
- package/dist/types/framework/components/layout/profile/ProfileRail.d.ts +23 -0
- package/dist/types/framework/components/layout/profile/SessionsCard.d.ts +8 -0
- package/dist/types/framework/components/layout/profile/TokensCard.d.ts +11 -0
- package/dist/types/framework/components/layout/profile/TwoFactorCard.d.ts +7 -0
- package/dist/types/framework/config/defaultLayoutConfig.d.ts +34 -0
- package/dist/types/framework/constants/routes.d.ts +5 -0
- package/dist/types/framework/contexts/AppContext.d.ts +57 -0
- package/dist/types/framework/contexts/AuthConfigContext.d.ts +22 -0
- package/dist/types/framework/hooks/useProfileData.d.ts +73 -0
- package/dist/types/framework/hooks/useRoutes.d.ts +10 -0
- package/dist/types/framework/hooks/useSessionSecurity.d.ts +17 -0
- package/dist/types/framework/hooks/useSmartNavigation.d.ts +15 -0
- package/dist/types/framework/index.d.ts +35 -0
- package/dist/types/framework/pages/ConfigurePage.d.ts +2 -0
- package/dist/types/framework/pages/CrudPage.d.ts +6 -0
- package/dist/types/framework/pages/LoginPage.d.ts +5 -0
- package/dist/types/framework/pages/LogoutPage.d.ts +2 -0
- package/dist/types/framework/pages/NotFoundPage.d.ts +6 -0
- package/dist/types/framework/pages/TrainingPage.d.ts +6 -0
- package/dist/types/framework/routing/PageTypeRegistry.d.ts +43 -0
- package/dist/types/framework/routing/PageTypeRouter.d.ts +12 -0
- package/dist/types/framework/routing/dynamicPageRegistry.d.ts +41 -0
- package/dist/types/framework/routing/getRenderComponent.d.ts +6 -0
- package/dist/types/framework/types/layout.types.d.ts +107 -0
- package/dist/types/framework/utils/apiConfig.d.ts +41 -0
- package/dist/types/framework/utils/apiInterceptor.d.ts +12 -0
- package/dist/types/framework/utils/apiUrlUtils.d.ts +9 -0
- package/dist/types/framework/utils/authThemeUtils.d.ts +64 -0
- package/dist/types/framework/utils/colorUtils.d.ts +53 -0
- package/dist/types/framework/utils/cookieUtils.d.ts +20 -0
- package/dist/types/framework/utils/csrf.d.ts +27 -0
- package/dist/types/framework/utils/logoCache.d.ts +21 -0
- package/dist/types/framework/utils/logoutUtils.d.ts +15 -0
- package/dist/types/framework/utils/redirectUtils.d.ts +48 -0
- package/dist/types/framework/utils/safeRedirect.d.ts +21 -0
- package/dist/types/framework/utils/storageKeys.d.ts +44 -0
- package/dist/types/framework/utils/storageSanitizer.d.ts +20 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/queries/index.d.ts +4 -0
- package/dist/types/hooks/queries/useAppInitQuery.d.ts +1 -0
- package/dist/types/hooks/queries/useAuthConfigQuery.d.ts +1 -0
- package/dist/types/hooks/queries/useProfileQuery.d.ts +8 -0
- package/dist/types/hooks/useBreakpoint.d.ts +2 -0
- package/dist/types/hooks/useMobile.d.ts +1 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/index.framework.d.ts +39 -0
- package/dist/types/index.zango.d.ts +12 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/schemas/appInit.schema.d.ts +61 -0
- package/dist/types/schemas/index.d.ts +10 -0
- package/dist/types/schemas/profile.schema.d.ts +18 -0
- package/dist/types/schemas/route.schema.d.ts +9 -0
- package/dist/types/schemas/session.schema.d.ts +8 -0
- package/dist/types/schemas/theme.schema.d.ts +27 -0
- package/dist/types/services/api/index.d.ts +2 -0
- package/dist/types/services/api.d.ts +109 -0
- package/dist/types/services/index.d.ts +7 -0
- package/dist/types/services/legacyAdapter.d.ts +10 -0
- package/dist/types/services/logger.d.ts +32 -0
- package/dist/types/services/normalizeResponse.d.ts +29 -0
- package/dist/types/types/auth.d.ts +103 -0
- package/dist/types/types/common.d.ts +343 -0
- package/dist/types/types/index.d.ts +278 -0
- package/dist/zango-appbuilder.js +99 -0
- package/dist/zango-appbuilder.js.map +1 -0
- package/dist/zango-appbuilder.umd.cjs +247 -0
- package/dist/zango-appbuilder.umd.cjs.map +1 -0
- package/package.json +140 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { AuthConfig } from './types';
|
|
3
|
+
interface AppProps {
|
|
4
|
+
customPages?: Record<string, React.ComponentType<Record<string, unknown>>>;
|
|
5
|
+
config?: Record<string, unknown>;
|
|
6
|
+
layoutConfig?: Record<string, unknown>;
|
|
7
|
+
topbarConfig?: Record<string, unknown>;
|
|
8
|
+
navbarConfig?: Record<string, unknown>;
|
|
9
|
+
customComponents?: Record<string, unknown>;
|
|
10
|
+
authConfig?: AuthConfig;
|
|
11
|
+
appInitializerEndpoint?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const App: React.FC<AppProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export declare const mockRoutes: ({
|
|
2
|
+
path: string;
|
|
3
|
+
page_type: string;
|
|
4
|
+
component: string;
|
|
5
|
+
entity: null;
|
|
6
|
+
extra_params: {
|
|
7
|
+
api_endpoint?: undefined;
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
path: string;
|
|
11
|
+
page_type: string;
|
|
12
|
+
entity: string;
|
|
13
|
+
extra_params: {
|
|
14
|
+
api_endpoint: string;
|
|
15
|
+
};
|
|
16
|
+
component?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
path: string;
|
|
19
|
+
page_type: string;
|
|
20
|
+
entity: string;
|
|
21
|
+
extra_params: {
|
|
22
|
+
api_endpoint?: undefined;
|
|
23
|
+
};
|
|
24
|
+
component?: undefined;
|
|
25
|
+
})[];
|
|
26
|
+
export declare const mockMenu: {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
uri: string;
|
|
30
|
+
icon: string;
|
|
31
|
+
children: never[];
|
|
32
|
+
}[];
|
|
33
|
+
export declare const mockTheme: {
|
|
34
|
+
colors: {
|
|
35
|
+
primary: string;
|
|
36
|
+
success: string;
|
|
37
|
+
warning: string;
|
|
38
|
+
error: string;
|
|
39
|
+
gray: string;
|
|
40
|
+
};
|
|
41
|
+
typography: {
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
fontSize: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const mockProfileInfo: {
|
|
47
|
+
id: number;
|
|
48
|
+
email: string;
|
|
49
|
+
name: string;
|
|
50
|
+
first_name: string;
|
|
51
|
+
last_name: string;
|
|
52
|
+
avatar: null;
|
|
53
|
+
role: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const mockSessionSecurity: {
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
ping_url: string;
|
|
58
|
+
warn_after: number;
|
|
59
|
+
expire_after: number;
|
|
60
|
+
};
|
|
61
|
+
export declare const mockAppInitAuthenticated: {
|
|
62
|
+
success: boolean;
|
|
63
|
+
response: {
|
|
64
|
+
app_name: string;
|
|
65
|
+
is_user_anonymous: boolean;
|
|
66
|
+
routes: ({
|
|
67
|
+
path: string;
|
|
68
|
+
page_type: string;
|
|
69
|
+
component: string;
|
|
70
|
+
entity: null;
|
|
71
|
+
extra_params: {
|
|
72
|
+
api_endpoint?: undefined;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
path: string;
|
|
76
|
+
page_type: string;
|
|
77
|
+
entity: string;
|
|
78
|
+
extra_params: {
|
|
79
|
+
api_endpoint: string;
|
|
80
|
+
};
|
|
81
|
+
component?: undefined;
|
|
82
|
+
} | {
|
|
83
|
+
path: string;
|
|
84
|
+
page_type: string;
|
|
85
|
+
entity: string;
|
|
86
|
+
extra_params: {
|
|
87
|
+
api_endpoint?: undefined;
|
|
88
|
+
};
|
|
89
|
+
component?: undefined;
|
|
90
|
+
})[];
|
|
91
|
+
menu: {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
uri: string;
|
|
95
|
+
icon: string;
|
|
96
|
+
children: never[];
|
|
97
|
+
}[];
|
|
98
|
+
profile_info: {
|
|
99
|
+
id: number;
|
|
100
|
+
email: string;
|
|
101
|
+
name: string;
|
|
102
|
+
first_name: string;
|
|
103
|
+
last_name: string;
|
|
104
|
+
avatar: null;
|
|
105
|
+
role: string;
|
|
106
|
+
};
|
|
107
|
+
app_logo: string;
|
|
108
|
+
metadata: {
|
|
109
|
+
version: string;
|
|
110
|
+
};
|
|
111
|
+
theme: {
|
|
112
|
+
colors: {
|
|
113
|
+
primary: string;
|
|
114
|
+
success: string;
|
|
115
|
+
warning: string;
|
|
116
|
+
error: string;
|
|
117
|
+
gray: string;
|
|
118
|
+
};
|
|
119
|
+
typography: {
|
|
120
|
+
fontFamily: string;
|
|
121
|
+
fontSize: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
session_security: {
|
|
125
|
+
enabled: boolean;
|
|
126
|
+
ping_url: string;
|
|
127
|
+
warn_after: number;
|
|
128
|
+
expire_after: number;
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export declare const mockAppInitAnonymous: {
|
|
133
|
+
success: boolean;
|
|
134
|
+
response: {
|
|
135
|
+
app_name: string;
|
|
136
|
+
is_user_anonymous: boolean;
|
|
137
|
+
routes: never[];
|
|
138
|
+
menu: never[];
|
|
139
|
+
profile_info: null;
|
|
140
|
+
app_logo: string;
|
|
141
|
+
metadata: {};
|
|
142
|
+
theme: {
|
|
143
|
+
colors: {
|
|
144
|
+
primary: string;
|
|
145
|
+
success: string;
|
|
146
|
+
warning: string;
|
|
147
|
+
error: string;
|
|
148
|
+
gray: string;
|
|
149
|
+
};
|
|
150
|
+
typography: {
|
|
151
|
+
fontFamily: string;
|
|
152
|
+
fontSize: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
session_security: null;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export declare const mockAppInitNoMenu: {
|
|
159
|
+
success: boolean;
|
|
160
|
+
response: {
|
|
161
|
+
app_name: string;
|
|
162
|
+
is_user_anonymous: boolean;
|
|
163
|
+
routes: never[];
|
|
164
|
+
menu: never[];
|
|
165
|
+
profile_info: {
|
|
166
|
+
id: number;
|
|
167
|
+
email: string;
|
|
168
|
+
name: string;
|
|
169
|
+
first_name: string;
|
|
170
|
+
last_name: string;
|
|
171
|
+
avatar: null;
|
|
172
|
+
role: string;
|
|
173
|
+
};
|
|
174
|
+
app_logo: string;
|
|
175
|
+
metadata: {};
|
|
176
|
+
theme: {
|
|
177
|
+
colors: {
|
|
178
|
+
primary: string;
|
|
179
|
+
success: string;
|
|
180
|
+
warning: string;
|
|
181
|
+
error: string;
|
|
182
|
+
gray: string;
|
|
183
|
+
};
|
|
184
|
+
typography: {
|
|
185
|
+
fontFamily: string;
|
|
186
|
+
fontSize: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
session_security: null;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
export declare const mockAppInitError: {
|
|
193
|
+
success: boolean;
|
|
194
|
+
response: {
|
|
195
|
+
message: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
export declare const mockAuthConfig: {
|
|
2
|
+
login_methods: {
|
|
3
|
+
password: {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
allowed_usernames: string[];
|
|
6
|
+
};
|
|
7
|
+
otp: {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
allowed_usernames: string[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
forgot_password: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
};
|
|
15
|
+
remember_me: {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
19
|
+
password_policy: {
|
|
20
|
+
min_length: number;
|
|
21
|
+
max_length: number;
|
|
22
|
+
require_numbers: boolean;
|
|
23
|
+
require_lowercase: boolean;
|
|
24
|
+
require_uppercase: boolean;
|
|
25
|
+
require_special_chars: boolean;
|
|
26
|
+
};
|
|
27
|
+
two_factor: {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
methods: string[];
|
|
30
|
+
};
|
|
31
|
+
sso_providers: never[];
|
|
32
|
+
oidc_providers: never[];
|
|
33
|
+
theme: {
|
|
34
|
+
primary_color: string;
|
|
35
|
+
background: {
|
|
36
|
+
color: string;
|
|
37
|
+
};
|
|
38
|
+
logo: {
|
|
39
|
+
url: string;
|
|
40
|
+
};
|
|
41
|
+
card: {
|
|
42
|
+
background_color: string;
|
|
43
|
+
border_radius: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export declare const mockAuthConfigPasswordOnly: {
|
|
48
|
+
login_methods: {
|
|
49
|
+
password: {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
allowed_usernames: string[];
|
|
52
|
+
};
|
|
53
|
+
otp: {
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
forgot_password: {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
};
|
|
60
|
+
remember_me: {
|
|
61
|
+
enabled: boolean;
|
|
62
|
+
default: boolean;
|
|
63
|
+
};
|
|
64
|
+
password_policy: {
|
|
65
|
+
min_length: number;
|
|
66
|
+
max_length: number;
|
|
67
|
+
require_numbers: boolean;
|
|
68
|
+
require_lowercase: boolean;
|
|
69
|
+
require_uppercase: boolean;
|
|
70
|
+
require_special_chars: boolean;
|
|
71
|
+
};
|
|
72
|
+
two_factor: {
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
methods: string[];
|
|
75
|
+
};
|
|
76
|
+
sso_providers: never[];
|
|
77
|
+
oidc_providers: never[];
|
|
78
|
+
theme: {
|
|
79
|
+
primary_color: string;
|
|
80
|
+
background: {
|
|
81
|
+
color: string;
|
|
82
|
+
};
|
|
83
|
+
logo: {
|
|
84
|
+
url: string;
|
|
85
|
+
};
|
|
86
|
+
card: {
|
|
87
|
+
background_color: string;
|
|
88
|
+
border_radius: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export declare const mockAuthConfigOTPOnly: {
|
|
93
|
+
login_methods: {
|
|
94
|
+
password: {
|
|
95
|
+
enabled: boolean;
|
|
96
|
+
};
|
|
97
|
+
otp: {
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
allowed_usernames: string[];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
forgot_password: {
|
|
103
|
+
enabled: boolean;
|
|
104
|
+
};
|
|
105
|
+
remember_me: {
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
default: boolean;
|
|
108
|
+
};
|
|
109
|
+
password_policy: {
|
|
110
|
+
min_length: number;
|
|
111
|
+
max_length: number;
|
|
112
|
+
require_numbers: boolean;
|
|
113
|
+
require_lowercase: boolean;
|
|
114
|
+
require_uppercase: boolean;
|
|
115
|
+
require_special_chars: boolean;
|
|
116
|
+
};
|
|
117
|
+
two_factor: {
|
|
118
|
+
enabled: boolean;
|
|
119
|
+
methods: string[];
|
|
120
|
+
};
|
|
121
|
+
sso_providers: never[];
|
|
122
|
+
oidc_providers: never[];
|
|
123
|
+
theme: {
|
|
124
|
+
primary_color: string;
|
|
125
|
+
background: {
|
|
126
|
+
color: string;
|
|
127
|
+
};
|
|
128
|
+
logo: {
|
|
129
|
+
url: string;
|
|
130
|
+
};
|
|
131
|
+
card: {
|
|
132
|
+
background_color: string;
|
|
133
|
+
border_radius: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export declare const mockAuthConfigWithSSO: {
|
|
138
|
+
sso_providers: {
|
|
139
|
+
id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
type: string;
|
|
142
|
+
icon: string;
|
|
143
|
+
}[];
|
|
144
|
+
login_methods: {
|
|
145
|
+
password: {
|
|
146
|
+
enabled: boolean;
|
|
147
|
+
allowed_usernames: string[];
|
|
148
|
+
};
|
|
149
|
+
otp: {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
allowed_usernames: string[];
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
forgot_password: {
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
};
|
|
157
|
+
remember_me: {
|
|
158
|
+
enabled: boolean;
|
|
159
|
+
default: boolean;
|
|
160
|
+
};
|
|
161
|
+
password_policy: {
|
|
162
|
+
min_length: number;
|
|
163
|
+
max_length: number;
|
|
164
|
+
require_numbers: boolean;
|
|
165
|
+
require_lowercase: boolean;
|
|
166
|
+
require_uppercase: boolean;
|
|
167
|
+
require_special_chars: boolean;
|
|
168
|
+
};
|
|
169
|
+
two_factor: {
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
methods: string[];
|
|
172
|
+
};
|
|
173
|
+
oidc_providers: never[];
|
|
174
|
+
theme: {
|
|
175
|
+
primary_color: string;
|
|
176
|
+
background: {
|
|
177
|
+
color: string;
|
|
178
|
+
};
|
|
179
|
+
logo: {
|
|
180
|
+
url: string;
|
|
181
|
+
};
|
|
182
|
+
card: {
|
|
183
|
+
background_color: string;
|
|
184
|
+
border_radius: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
export declare const mockAuthConfigWithOIDC: {
|
|
189
|
+
oidc_providers: {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
authorization_endpoint: string;
|
|
193
|
+
client_id: string;
|
|
194
|
+
icon: string;
|
|
195
|
+
}[];
|
|
196
|
+
login_methods: {
|
|
197
|
+
password: {
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
allowed_usernames: string[];
|
|
200
|
+
};
|
|
201
|
+
otp: {
|
|
202
|
+
enabled: boolean;
|
|
203
|
+
allowed_usernames: string[];
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
forgot_password: {
|
|
207
|
+
enabled: boolean;
|
|
208
|
+
};
|
|
209
|
+
remember_me: {
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
default: boolean;
|
|
212
|
+
};
|
|
213
|
+
password_policy: {
|
|
214
|
+
min_length: number;
|
|
215
|
+
max_length: number;
|
|
216
|
+
require_numbers: boolean;
|
|
217
|
+
require_lowercase: boolean;
|
|
218
|
+
require_uppercase: boolean;
|
|
219
|
+
require_special_chars: boolean;
|
|
220
|
+
};
|
|
221
|
+
two_factor: {
|
|
222
|
+
enabled: boolean;
|
|
223
|
+
methods: string[];
|
|
224
|
+
};
|
|
225
|
+
sso_providers: never[];
|
|
226
|
+
theme: {
|
|
227
|
+
primary_color: string;
|
|
228
|
+
background: {
|
|
229
|
+
color: string;
|
|
230
|
+
};
|
|
231
|
+
logo: {
|
|
232
|
+
url: string;
|
|
233
|
+
};
|
|
234
|
+
card: {
|
|
235
|
+
background_color: string;
|
|
236
|
+
border_radius: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
export declare const mockLoginSuccess: {
|
|
241
|
+
success: boolean;
|
|
242
|
+
response: {
|
|
243
|
+
status: number;
|
|
244
|
+
data: {
|
|
245
|
+
user: {
|
|
246
|
+
id: number;
|
|
247
|
+
email: string;
|
|
248
|
+
name: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
meta: {
|
|
252
|
+
is_authenticated: boolean;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
export declare const mockLoginWithRoleSelection: {
|
|
257
|
+
success: boolean;
|
|
258
|
+
response: {
|
|
259
|
+
status: number;
|
|
260
|
+
data: {
|
|
261
|
+
next_step: {
|
|
262
|
+
id: string;
|
|
263
|
+
is_pending: boolean;
|
|
264
|
+
metadata: {
|
|
265
|
+
roles: {
|
|
266
|
+
id: string;
|
|
267
|
+
name: string;
|
|
268
|
+
is_default: boolean;
|
|
269
|
+
}[];
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
export declare const mockLoginWith2FA: {
|
|
276
|
+
success: boolean;
|
|
277
|
+
response: {
|
|
278
|
+
status: number;
|
|
279
|
+
data: {
|
|
280
|
+
next_step: {
|
|
281
|
+
id: string;
|
|
282
|
+
is_pending: boolean;
|
|
283
|
+
metadata: {
|
|
284
|
+
methods: string[];
|
|
285
|
+
masked_email: string;
|
|
286
|
+
masked_phone: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
export declare const mockLoginWithPasswordReset: {
|
|
293
|
+
success: boolean;
|
|
294
|
+
response: {
|
|
295
|
+
status: number;
|
|
296
|
+
data: {
|
|
297
|
+
next_step: {
|
|
298
|
+
id: string;
|
|
299
|
+
is_pending: boolean;
|
|
300
|
+
metadata: {
|
|
301
|
+
reason: string;
|
|
302
|
+
password_policy: {
|
|
303
|
+
min_length: number;
|
|
304
|
+
max_length: number;
|
|
305
|
+
require_numbers: boolean;
|
|
306
|
+
require_lowercase: boolean;
|
|
307
|
+
require_uppercase: boolean;
|
|
308
|
+
require_special_chars: boolean;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
export declare const mockLoginWithPasswordExpiry: {
|
|
316
|
+
success: boolean;
|
|
317
|
+
response: {
|
|
318
|
+
status: number;
|
|
319
|
+
data: {
|
|
320
|
+
next_step: {
|
|
321
|
+
id: string;
|
|
322
|
+
is_pending: boolean;
|
|
323
|
+
metadata: {
|
|
324
|
+
reason: string;
|
|
325
|
+
password_policy: {
|
|
326
|
+
min_length: number;
|
|
327
|
+
max_length: number;
|
|
328
|
+
require_numbers: boolean;
|
|
329
|
+
require_lowercase: boolean;
|
|
330
|
+
require_uppercase: boolean;
|
|
331
|
+
require_special_chars: boolean;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
export declare const mockLoginError: {
|
|
339
|
+
success: boolean;
|
|
340
|
+
response: {
|
|
341
|
+
status: number;
|
|
342
|
+
errors: {
|
|
343
|
+
message: string;
|
|
344
|
+
}[];
|
|
345
|
+
};
|
|
346
|
+
};
|
|
347
|
+
export declare const mockAccountLocked: {
|
|
348
|
+
success: boolean;
|
|
349
|
+
response: {
|
|
350
|
+
status: number;
|
|
351
|
+
data: {
|
|
352
|
+
error_code: string;
|
|
353
|
+
message: string;
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mocks for external peer dependencies that aren't available in CI.
|
|
3
|
+
* These packages (@zango-core/crud, @zango-core/components, @zango-core/training)
|
|
4
|
+
* are peer dependencies and may not be installed during test runs.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CrudHandler: () => null;
|
|
7
|
+
export declare const Button: () => null;
|
|
8
|
+
export declare const Card: () => null;
|
|
9
|
+
export declare const Spin: () => null;
|
|
10
|
+
export declare const Alert: () => null;
|
|
11
|
+
export declare const Input: () => null;
|
|
12
|
+
export declare const PasswordInput: () => null;
|
|
13
|
+
export declare const Checkbox: () => null;
|
|
14
|
+
export declare const Select: () => null;
|
|
15
|
+
export declare const Space: () => null;
|
|
16
|
+
export declare const Tag: () => null;
|
|
17
|
+
export declare const Badge: () => null;
|
|
18
|
+
export declare const Tabs: () => null;
|
|
19
|
+
export declare const Divider: () => null;
|
|
20
|
+
export declare const Drawer: () => null;
|
|
21
|
+
export declare const Progress: () => null;
|
|
22
|
+
export declare const Result: () => null;
|
|
23
|
+
export declare const Segmented: () => null;
|
|
24
|
+
export declare const Form: () => null;
|
|
25
|
+
export declare const FormItem: () => null;
|
|
26
|
+
export declare const Layout: () => null;
|
|
27
|
+
export declare const Toaster: () => null;
|
|
28
|
+
export declare const Dialog: () => null;
|
|
29
|
+
export declare const DialogFooter: () => null;
|
|
30
|
+
export declare const Typography: {
|
|
31
|
+
Text: () => null;
|
|
32
|
+
Title: () => null;
|
|
33
|
+
Paragraph: () => null;
|
|
34
|
+
};
|
|
35
|
+
export declare const toast: {
|
|
36
|
+
success: () => void;
|
|
37
|
+
error: () => void;
|
|
38
|
+
info: () => void;
|
|
39
|
+
warning: () => void;
|
|
40
|
+
};
|
|
41
|
+
declare const _default: {};
|
|
42
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const authHandlers: import('msw').HttpHandler[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const handlers: import('msw').HttpHandler[];
|
|
2
|
+
export { appInitHandlers, useAnonymousAppInit, useCustomAppInit } from './appInit.handlers';
|
|
3
|
+
export { authHandlers } from './auth.handlers';
|
|
4
|
+
export { profileHandlers } from './profile.handlers';
|
|
5
|
+
export { sessionHandlers, useExpiredSession } from './session.handlers';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const mockUserProfile: {
|
|
2
|
+
id: number;
|
|
3
|
+
email: string;
|
|
4
|
+
name: string;
|
|
5
|
+
first_name: string;
|
|
6
|
+
last_name: string;
|
|
7
|
+
phone: string;
|
|
8
|
+
avatar: null;
|
|
9
|
+
role: string;
|
|
10
|
+
is_active: boolean;
|
|
11
|
+
created_at: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const profileHandlers: import('msw').HttpHandler[];
|
|
15
|
+
export { mockUserProfile };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const server: import('msw/node').SetupServer;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
declare const locationMock: {
|
|
3
|
+
href: string;
|
|
4
|
+
pathname: string;
|
|
5
|
+
search: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
origin: string;
|
|
8
|
+
host: string;
|
|
9
|
+
hostname: string;
|
|
10
|
+
port: string;
|
|
11
|
+
protocol: string;
|
|
12
|
+
assign: import('vitest').Mock<import('@vitest/spy').Procedure>;
|
|
13
|
+
replace: import('vitest').Mock<import('@vitest/spy').Procedure>;
|
|
14
|
+
reload: import('vitest').Mock<import('@vitest/spy').Procedure>;
|
|
15
|
+
};
|
|
16
|
+
interface StorageMock {
|
|
17
|
+
store: Record<string, string>;
|
|
18
|
+
getItem: ReturnType<typeof vi.fn>;
|
|
19
|
+
setItem: ReturnType<typeof vi.fn>;
|
|
20
|
+
removeItem: ReturnType<typeof vi.fn>;
|
|
21
|
+
clear: ReturnType<typeof vi.fn>;
|
|
22
|
+
length: number;
|
|
23
|
+
key: ReturnType<typeof vi.fn>;
|
|
24
|
+
}
|
|
25
|
+
export declare const localStorageMock: StorageMock;
|
|
26
|
+
export declare const sessionStorageMock: StorageMock;
|
|
27
|
+
export declare const setCookie: (name: string, value: string) => void;
|
|
28
|
+
export declare const getCookie: (name: string) => string | undefined;
|
|
29
|
+
export declare const deleteCookie: (name: string) => void;
|
|
30
|
+
export declare const clearAllCookies: () => void;
|
|
31
|
+
export declare const getAllCookies: () => Record<string, string>;
|
|
32
|
+
export declare const setMockLocation: (location: Partial<typeof locationMock>) => void;
|
|
33
|
+
export declare const resetMockLocation: () => void;
|
|
34
|
+
export {};
|