@headless-adminapp/app 1.1.9 → 1.1.10

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/auth/context.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AuthSession } from '@headless-adminapp/core/experience/auth';
1
2
  type UnauthorizeReason = 'sessionExpired' | 'unauthorized' | 'logout' | 'load';
2
3
  interface AuthStoreLoadingState {
3
4
  initialized: false;
@@ -20,13 +21,5 @@ export type AuthState = (AuthStoreLoadingState | AuthStoreUnauthorizedState | Au
20
21
  loadSession: () => Promise<void>;
21
22
  onUnauthenticated?: (reason: UnauthorizeReason) => void;
22
23
  };
23
- export interface AuthSession {
24
- id: string;
25
- exp: number;
26
- fullName: string;
27
- email: string;
28
- profilePicture?: string;
29
- data?: Record<string, any>;
30
- }
31
24
  export declare const AuthContext: import("react").Context<import("../mutable/context").ContextValue<AuthState>>;
32
25
  export {};
@@ -1,2 +1,2 @@
1
- import { AuthSession } from '../context';
1
+ import { AuthSession } from '@headless-adminapp/core/experience/auth';
2
2
  export declare function useAuthSession<T extends AuthSession = AuthSession>(): T | null;
package/auth/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AuthContext, type AuthSession, type AuthState } from './context';
1
+ export { AuthContext, type AuthState } from './context';
2
2
  export { AuthProvider, type AuthProviderProps } from './AuthProvider';
3
3
  export * from './types';
4
4
  export * from './hooks';
package/auth/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthSession } from './context';
1
+ import { AuthSession } from '@headless-adminapp/core/experience/auth';
2
2
  export type UnauthorizeReason = 'sessionExpired' | 'unauthorized' | 'logout' | 'load';
3
3
  export interface AuthProviderPlaceholderProps {
4
4
  loading?: boolean;
@@ -1,5 +1,5 @@
1
+ import { AuthSession } from '@headless-adminapp/core/experience/auth';
1
2
  import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
2
- import { AuthSession } from '../auth';
3
3
  export interface CalendarEvent {
4
4
  id: string;
5
5
  title: string;
@@ -5,6 +5,7 @@ exports.useBaseCommandHandlerContext = useBaseCommandHandlerContext;
5
5
  const navigation_1 = require("@headless-adminapp/app/navigation");
6
6
  const react_query_1 = require("@tanstack/react-query");
7
7
  const react_1 = require("react");
8
+ const useAuthSession_1 = require("../../auth/hooks/useAuthSession");
8
9
  const hooks_1 = require("../../dialog/hooks");
9
10
  const locale_1 = require("../../locale");
10
11
  const hooks_2 = require("../../metadata/hooks");
@@ -49,6 +50,7 @@ function useBaseCommandHandlerContext() {
49
50
  const utility = useUtility();
50
51
  const locale = (0, locale_1.useLocale)();
51
52
  const navigation = useNavigation();
53
+ const authSession = (0, useAuthSession_1.useAuthSession)();
52
54
  return (0, react_1.useMemo)(() => ({
53
55
  dataService,
54
56
  queryClient,
@@ -56,5 +58,6 @@ function useBaseCommandHandlerContext() {
56
58
  stores,
57
59
  locale,
58
60
  navigation,
59
- }), [dataService, queryClient, stores, utility, locale, navigation]);
61
+ authSession,
62
+ }), [dataService, queryClient, stores, utility, locale, navigation, authSession]);
60
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-adminapp/app",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -36,5 +36,5 @@
36
36
  "uuid": "11.0.3",
37
37
  "yup": "^1.4.0"
38
38
  },
39
- "gitHead": "5ee9022d0e1bc4c75ef4777a4cfbd4557ae34a99"
39
+ "gitHead": "3920cedff7216fb37b07dff95c50499c0f56f57c"
40
40
  }