@infinityloop.labs/frontend-modules 0.0.1 → 0.0.3
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/frontend-modules/src/features/services/auth/container/index.d.ts +34 -0
- package/dist/frontend-modules/src/features/services/auth/index.d.ts +4 -1
- package/dist/frontend-modules/src/index.d.ts +1 -0
- package/dist/index.es.js +1549 -1530
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +11 -10
- package/dist/index.umd.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1,35 @@
|
|
|
1
|
+
type AuthMeResponse = {
|
|
2
|
+
user_id?: string | null;
|
|
3
|
+
};
|
|
4
|
+
type RefreshResponse = {
|
|
5
|
+
access_token?: string | null;
|
|
6
|
+
refresh_token?: string | null;
|
|
7
|
+
};
|
|
8
|
+
export type AuthApiHooks = {
|
|
9
|
+
useGetApiMeQuery: () => {
|
|
10
|
+
data?: AuthMeResponse;
|
|
11
|
+
isSuccess: boolean;
|
|
12
|
+
refetch: () => void;
|
|
13
|
+
};
|
|
14
|
+
usePostApiRefreshMutation: () => [
|
|
15
|
+
(args?: unknown) => Promise<unknown>,
|
|
16
|
+
{
|
|
17
|
+
data?: RefreshResponse;
|
|
18
|
+
isError: boolean;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
};
|
|
23
|
+
export type AuthMappers = {
|
|
24
|
+
authUserId: (response?: AuthMeResponse) => string | null;
|
|
25
|
+
refreshRequest: (params: {
|
|
26
|
+
refreshToken: string;
|
|
27
|
+
}) => unknown;
|
|
28
|
+
};
|
|
29
|
+
export type AuthServiceConfig = {
|
|
30
|
+
hooks: AuthApiHooks;
|
|
31
|
+
mappers?: Partial<AuthMappers>;
|
|
32
|
+
};
|
|
33
|
+
export declare const createAuthContainer: ({ hooks, mappers, }: AuthServiceConfig) => SC;
|
|
1
34
|
export declare const useContainer: SC;
|
|
35
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { createAuthContainer } from './container';
|
|
1
2
|
export * from './constants';
|
|
2
3
|
export * from './hooks/useAuthActions';
|
|
3
4
|
export * from './store';
|
|
5
|
+
export { createAuthContainer };
|
|
6
|
+
export type { AuthApiHooks, AuthServiceConfig, AuthMappers } from './container';
|
|
4
7
|
export declare const auth: {
|
|
5
|
-
service: SC;
|
|
8
|
+
service: ({ hooks, mappers, }: import("./container").AuthServiceConfig) => SC;
|
|
6
9
|
};
|
|
@@ -11,3 +11,4 @@ export { Actions as themeActions, Reducer as themeReducer, theme, useThemeAction
|
|
|
11
11
|
export { Actions as rolesActions, Reducer as rolesReducer, roles, useRolesActions, } from './features/services/roles';
|
|
12
12
|
export { Actions as analyticsEngineActions, Reducer as analyticsEngineReducer, analyticsEngine, useAnalyticsEngineActions, } from './features/services/analyticsEngine';
|
|
13
13
|
export { Actions as authActions, Reducer as authReducer, auth, useAuthActions, } from './features/services/auth';
|
|
14
|
+
export { createAuthContainer, type AuthApiHooks, type AuthServiceConfig, type AuthMappers, } from './features/services/auth';
|