@quvel-kit/core 1.3.16 → 1.3.18
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/auth/boot/defineAuthGuard.d.ts +2 -7
- package/dist/auth/boot/defineAuthGuard.d.ts.map +1 -1
- package/dist/auth/boot/defineAuthGuard.js +2 -7
- package/dist/auth/index.d.ts +1 -3
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +0 -4
- package/dist/auth/services/AuthService.d.ts +12 -7
- package/dist/auth/services/AuthService.d.ts.map +1 -1
- package/dist/auth/services/AuthService.js +3 -0
- package/dist/auth/services/index.d.ts +1 -0
- package/dist/auth/services/index.d.ts.map +1 -1
- package/dist/boot/quvel.d.ts.map +1 -1
- package/dist/boot/quvel.js +0 -4
- package/dist/config/quvel.d.ts.map +1 -1
- package/dist/config/quvel.js +1 -2
- package/dist/config/quvel.types.d.ts +0 -10
- package/dist/config/quvel.types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/types/app.types.d.ts +0 -11
- package/dist/types/app.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/auth/enums/AuthStatusEnum.d.ts +0 -13
- package/dist/auth/enums/AuthStatusEnum.d.ts.map +0 -1
- package/dist/auth/enums/AuthStatusEnum.js +0 -13
- package/dist/auth/stores/sessionStore.d.ts +0 -71
- package/dist/auth/stores/sessionStore.d.ts.map +0 -1
- package/dist/auth/stores/sessionStore.js +0 -125
- package/dist/types/user.types.d.ts +0 -43
- package/dist/types/user.types.d.ts.map +0 -1
- package/dist/types/user.types.js +0 -1
|
@@ -27,19 +27,14 @@ export interface DefineAuthGuardConfig extends AuthGuardConfig {
|
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
29
29
|
* import { defineAuthGuard } from '@quvel-kit/core/auth';
|
|
30
|
-
* import { useSessionStore } from '
|
|
30
|
+
* import { useSessionStore } from 'src/stores/sessionStore';
|
|
31
31
|
*
|
|
32
32
|
* export default boot(defineAuthGuard({
|
|
33
33
|
* requireAuthByDefault: true,
|
|
34
34
|
* loginRoute: 'login',
|
|
35
35
|
* successRoute: 'dashboard',
|
|
36
36
|
* isAuthenticated: () => useSessionStore().isAuthenticated,
|
|
37
|
-
* ensureSessionInitialized: async () =>
|
|
38
|
-
* const store = useSessionStore();
|
|
39
|
-
* if (!store.isInitialized) {
|
|
40
|
-
* await store.fetchSession();
|
|
41
|
-
* }
|
|
42
|
-
* },
|
|
37
|
+
* ensureSessionInitialized: async () => await useSessionStore().fetchSession(),
|
|
43
38
|
* }));
|
|
44
39
|
* ```
|
|
45
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineAuthGuard.d.ts","sourceRoot":"","sources":["../../../src/auth/boot/defineAuthGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D;;;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC;IAE/B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED
|
|
1
|
+
{"version":3,"file":"defineAuthGuard.d.ts","sourceRoot":"","sources":["../../../src/auth/boot/defineAuthGuard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D;;;OAGG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC;IAE/B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,IAC7C,+BAA+B;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC5D,mBAyDF"}
|
|
@@ -11,19 +11,14 @@ import { AuthGuard } from '../services/AuthGuard.js';
|
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
13
|
* import { defineAuthGuard } from '@quvel-kit/core/auth';
|
|
14
|
-
* import { useSessionStore } from '
|
|
14
|
+
* import { useSessionStore } from 'src/stores/sessionStore';
|
|
15
15
|
*
|
|
16
16
|
* export default boot(defineAuthGuard({
|
|
17
17
|
* requireAuthByDefault: true,
|
|
18
18
|
* loginRoute: 'login',
|
|
19
19
|
* successRoute: 'dashboard',
|
|
20
20
|
* isAuthenticated: () => useSessionStore().isAuthenticated,
|
|
21
|
-
* ensureSessionInitialized: async () =>
|
|
22
|
-
* const store = useSessionStore();
|
|
23
|
-
* if (!store.isInitialized) {
|
|
24
|
-
* await store.fetchSession();
|
|
25
|
-
* }
|
|
26
|
-
* },
|
|
21
|
+
* ensureSessionInitialized: async () => await useSessionStore().fetchSession(),
|
|
27
22
|
* }));
|
|
28
23
|
* ```
|
|
29
24
|
*/
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
* Framework-agnostic authentication services, types, and utilities.
|
|
5
5
|
*/
|
|
6
6
|
export { AuthService, PasswordResetService, TwoFactorService, TwoFactorChallengeService, AuthGuard, } from './services/index.js';
|
|
7
|
-
export type { AuthCheckResult, AuthGuardConfig, TwoFactorQRResponse, TwoFactorSecretResponse, TwoFactorRecoveryCodesResponse, } from './services/index.js';
|
|
7
|
+
export type { AuthStatus, AuthCheckResult, AuthGuardConfig, TwoFactorQRResponse, TwoFactorSecretResponse, TwoFactorRecoveryCodesResponse, } from './services/index.js';
|
|
8
8
|
export { defineAuthGuard } from './boot/defineAuthGuard.js';
|
|
9
9
|
export type { DefineAuthGuardConfig } from './boot/defineAuthGuard.js';
|
|
10
10
|
export type { AuthMeta } from './types/index.js';
|
|
11
11
|
export { createAuthMeta, createGuestOnlyAuth, createProtectedAuth, createPublicAuth, createSkipAuth, } from './utils/auth-meta.js';
|
|
12
|
-
export { AuthStatus } from './enums/AuthStatusEnum.js';
|
|
13
|
-
export { useSessionStore } from './stores/sessionStore.js';
|
|
14
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/auth/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,SAAS,GACV,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,SAAS,GACV,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGvE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,GACf,MAAM,sBAAsB,CAAC"}
|
package/dist/auth/index.js
CHANGED
|
@@ -9,7 +9,3 @@ export { AuthService, PasswordResetService, TwoFactorService, TwoFactorChallenge
|
|
|
9
9
|
export { defineAuthGuard } from './boot/defineAuthGuard.js';
|
|
10
10
|
// Utilities
|
|
11
11
|
export { createAuthMeta, createGuestOnlyAuth, createProtectedAuth, createPublicAuth, createSkipAuth, } from './utils/auth-meta.js';
|
|
12
|
-
// Enums
|
|
13
|
-
export { AuthStatus } from './enums/AuthStatusEnum.js';
|
|
14
|
-
// Stores
|
|
15
|
-
export { useSessionStore } from './stores/sessionStore.js';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Service } from '../../services/Service.js';
|
|
2
2
|
import { ServiceContainer } from '../../container/ServiceContainer.js';
|
|
3
3
|
import type { RegisterService } from '../../container/types.js';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Authentication status codes returned from the API
|
|
6
|
+
*/
|
|
7
|
+
export type AuthStatus = 'user_not_found' | 'invalid_credentials' | 'email_already_in_use' | 'email_not_verified' | 'logout_success' | 'login_success' | 'register_success';
|
|
6
8
|
/**
|
|
7
9
|
* Service responsible for handling login, registration, and session management.
|
|
8
10
|
*/
|
|
@@ -17,9 +19,10 @@ export declare class AuthService extends Service implements RegisterService {
|
|
|
17
19
|
/**
|
|
18
20
|
* Fetches the current user session.
|
|
19
21
|
*
|
|
22
|
+
* @template TUser - The user type returned from the API
|
|
20
23
|
* @returns The user data or null if not authenticated.
|
|
21
24
|
*/
|
|
22
|
-
fetchSession(): Promise<
|
|
25
|
+
fetchSession<TUser = Record<string, any>>(): Promise<TUser | null>;
|
|
23
26
|
/**
|
|
24
27
|
* Logs the user out.
|
|
25
28
|
*/
|
|
@@ -27,26 +30,28 @@ export declare class AuthService extends Service implements RegisterService {
|
|
|
27
30
|
/**
|
|
28
31
|
* Authenticates a user with email and password.
|
|
29
32
|
*
|
|
33
|
+
* @template TUser - The user type returned from the API
|
|
30
34
|
* @param email - The user's email.
|
|
31
35
|
* @param password - The user's password.
|
|
32
36
|
* @returns The authenticated user data or two-factor challenge indication.
|
|
33
37
|
*/
|
|
34
|
-
login(email: string, password: string): Promise<{
|
|
35
|
-
user?:
|
|
38
|
+
login<TUser = Record<string, any>>(email: string, password: string): Promise<{
|
|
39
|
+
user?: TUser;
|
|
36
40
|
two_factor?: boolean;
|
|
37
41
|
}>;
|
|
38
42
|
/**
|
|
39
43
|
* Registers a new user.
|
|
40
44
|
*
|
|
45
|
+
* @template TUser - The user type returned from the API
|
|
41
46
|
* @param email - The user's email.
|
|
42
47
|
* @param password - The user's password.
|
|
43
48
|
* @param name - The user's name.
|
|
44
49
|
* @param recaptchaToken - Google reCAPTCHA token for verification
|
|
45
50
|
* @returns The registration status and user data.
|
|
46
51
|
*/
|
|
47
|
-
signUp(email: string, password: string, name: string, recaptchaToken?: string): Promise<{
|
|
52
|
+
signUp<TUser = Record<string, any>>(email: string, password: string, name: string, recaptchaToken?: string): Promise<{
|
|
48
53
|
status: AuthStatus;
|
|
49
|
-
user:
|
|
54
|
+
user: TUser;
|
|
50
55
|
}>;
|
|
51
56
|
}
|
|
52
57
|
//# sourceMappingURL=AuthService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthService.d.ts","sourceRoot":"","sources":["../../../src/auth/services/AuthService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthService.d.ts","sourceRoot":"","sources":["../../../src/auth/services/AuthService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,oBAAoB,GACpB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,CAAC;AAEvB;;GAEG;AACH,qBAAa,WAAY,SAAQ,OAAQ,YAAW,eAAe;IACjE,OAAO,CAAC,GAAG,CAAc;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,GAAG,IAAI;IAIzC;;;;;OAKG;IACG,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAYxE;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B;;;;;;;OAOG;IACG,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;QAAE,IAAI,CAAC,EAAE,KAAK,CAAC;QAAC,UAAU,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAOlD;;;;;;;;;OASG;IACG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC;QACT,MAAM,EAAE,UAAU,CAAC;QACnB,IAAI,EAAE,KAAK,CAAC;KACb,CAAC;CAWH"}
|
|
@@ -15,6 +15,7 @@ export class AuthService extends Service {
|
|
|
15
15
|
/**
|
|
16
16
|
* Fetches the current user session.
|
|
17
17
|
*
|
|
18
|
+
* @template TUser - The user type returned from the API
|
|
18
19
|
* @returns The user data or null if not authenticated.
|
|
19
20
|
*/
|
|
20
21
|
async fetchSession() {
|
|
@@ -37,6 +38,7 @@ export class AuthService extends Service {
|
|
|
37
38
|
/**
|
|
38
39
|
* Authenticates a user with email and password.
|
|
39
40
|
*
|
|
41
|
+
* @template TUser - The user type returned from the API
|
|
40
42
|
* @param email - The user's email.
|
|
41
43
|
* @param password - The user's password.
|
|
42
44
|
* @returns The authenticated user data or two-factor challenge indication.
|
|
@@ -50,6 +52,7 @@ export class AuthService extends Service {
|
|
|
50
52
|
/**
|
|
51
53
|
* Registers a new user.
|
|
52
54
|
*
|
|
55
|
+
* @template TUser - The user type returned from the API
|
|
53
56
|
* @param email - The user's email.
|
|
54
57
|
* @param password - The user's password.
|
|
55
58
|
* @param name - The user's name.
|
|
@@ -3,6 +3,7 @@ export { PasswordResetService } from './PasswordResetService.js';
|
|
|
3
3
|
export { TwoFactorService } from './TwoFactorService.js';
|
|
4
4
|
export { TwoFactorChallengeService } from './TwoFactorChallengeService.js';
|
|
5
5
|
export { AuthGuard } from './AuthGuard.js';
|
|
6
|
+
export type { AuthStatus } from './AuthService.js';
|
|
6
7
|
export type { AuthCheckResult, AuthGuardConfig } from './AuthGuard.js';
|
|
7
8
|
export type { TwoFactorQRResponse, TwoFactorSecretResponse, TwoFactorRecoveryCodesResponse } from './TwoFactorService.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/boot/quvel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/boot/quvel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,IAC9C,qBAAqB;IAC3B,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,GAAG,CAAC;CACV,
|
|
1
|
+
{"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/boot/quvel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,IAC9C,qBAAqB;IAC3B,UAAU,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,GAAG,EAAE,GAAG,CAAC;CACV,UAoBF"}
|
package/dist/boot/quvel.js
CHANGED
|
@@ -25,10 +25,6 @@ export function defineQuvelBoot(quvelConfig) {
|
|
|
25
25
|
serviceMap.set(name, ServiceCls);
|
|
26
26
|
}
|
|
27
27
|
const container = createContainer(ssrContext, serviceMap);
|
|
28
|
-
// Apply config from QuvelConfig
|
|
29
|
-
if (quvelConfig.userFactory) {
|
|
30
|
-
container.config.userFactory = quvelConfig.userFactory;
|
|
31
|
-
}
|
|
32
28
|
if (ssrContext) {
|
|
33
29
|
ssrContext.$quvel = container;
|
|
34
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/config/quvel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAItE,OAAO,EAAqB,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAI7F;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"quvel.d.ts","sourceRoot":"","sources":["../../src/config/quvel.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAItE,OAAO,EAAqB,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAI7F;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErF;;GAEG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,WAAW,CA4CvE"}
|
package/dist/config/quvel.js
CHANGED
|
@@ -36,7 +36,7 @@ export { DEFAULT_LOCALE_MAPPING };
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
export function defineQuvelConfig(config) {
|
|
39
|
-
const { modules = [], localeMapping, core = true,
|
|
39
|
+
const { modules = [], localeMapping, core = true, } = config;
|
|
40
40
|
const allModules = [];
|
|
41
41
|
if (core) {
|
|
42
42
|
const coreOptions = typeof core === 'object' ? core : {};
|
|
@@ -55,7 +55,6 @@ export function defineQuvelConfig(config) {
|
|
|
55
55
|
modules: allModules,
|
|
56
56
|
messages,
|
|
57
57
|
localeMapping: resolvedLocaleMapping,
|
|
58
|
-
userFactory,
|
|
59
58
|
getRoutes() {
|
|
60
59
|
return getRoutes(allModules);
|
|
61
60
|
},
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { RouteRecordRaw } from 'vue-router';
|
|
7
7
|
import type { Module, ServiceRegistry } from '../modules/types.js';
|
|
8
|
-
import type { UserFactory } from '../types/user.types.js';
|
|
9
8
|
/**
|
|
10
9
|
* Locale mapping configuration for validation
|
|
11
10
|
* Maps i18n locale codes to Zod locale codes
|
|
@@ -39,11 +38,6 @@ export interface QuvelConfigInput {
|
|
|
39
38
|
*/
|
|
40
39
|
includeI18n?: boolean;
|
|
41
40
|
};
|
|
42
|
-
/**
|
|
43
|
-
* User factory function for creating user instances
|
|
44
|
-
* Override to use a custom user model
|
|
45
|
-
*/
|
|
46
|
-
userFactory?: UserFactory;
|
|
47
41
|
}
|
|
48
42
|
/**
|
|
49
43
|
* Resolved Quvel configuration
|
|
@@ -62,10 +56,6 @@ export interface QuvelConfig {
|
|
|
62
56
|
* Locale mapping for validation
|
|
63
57
|
*/
|
|
64
58
|
localeMapping: LocaleMapping;
|
|
65
|
-
/**
|
|
66
|
-
* User factory function for creating user instances
|
|
67
|
-
*/
|
|
68
|
-
userFactory?: UserFactory;
|
|
69
59
|
/**
|
|
70
60
|
* Get all routes from modules
|
|
71
61
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quvel.types.d.ts","sourceRoot":"","sources":["../../src/config/quvel.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"quvel.types.d.ts","sourceRoot":"","sources":["../../src/config/quvel.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QACf;;;WAGG;QACH,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAElD;;OAEG;IACH,aAAa,EAAE,aAAa,CAAC;IAE7B;;OAEG;IACH,SAAS,IAAI,cAAc,EAAE,CAAC;IAE9B;;OAEG;IACH,WAAW,IAAI,eAAe,CAAC;IAE/B;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,6 @@ export * from './types/websocket.types.js';
|
|
|
31
31
|
export * from './types/laravel.types.js';
|
|
32
32
|
export * from './types/task.types.js';
|
|
33
33
|
export * from './types/scripts.types.js';
|
|
34
|
-
export * from './types/user.types.js';
|
|
35
34
|
export * from './types/theme.types.js';
|
|
36
35
|
export * from './utils/logging.js';
|
|
37
36
|
export * from './utils/axios.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;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AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAG9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC9E,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,6 @@ export * from './types/websocket.types.js';
|
|
|
41
41
|
export * from './types/laravel.types.js';
|
|
42
42
|
export * from './types/task.types.js';
|
|
43
43
|
export * from './types/scripts.types.js';
|
|
44
|
-
export * from './types/user.types.js';
|
|
45
44
|
export * from './types/theme.types.js';
|
|
46
45
|
// Utilities
|
|
47
46
|
export * from './utils/logging.js';
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Dynamic server-side configuration for the Quasar app
|
|
5
5
|
*/
|
|
6
|
-
import type { UserFactory } from './user.types';
|
|
7
6
|
import type { TraceInfo } from './logging.types';
|
|
8
7
|
/**
|
|
9
8
|
* CSS asset configuration for dynamic injection
|
|
@@ -179,16 +178,6 @@ export interface AppConfig {
|
|
|
179
178
|
* Defaults to 'user-locale' if not specified
|
|
180
179
|
*/
|
|
181
180
|
i18nCookie?: string;
|
|
182
|
-
/**
|
|
183
|
-
* User factory function for creating user instances
|
|
184
|
-
*
|
|
185
|
-
* Override this to use a custom user model:
|
|
186
|
-
* @example
|
|
187
|
-
* ```typescript
|
|
188
|
-
* userFactory: (data) => new CustomUser(data)
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
userFactory?: UserFactory;
|
|
192
181
|
/**
|
|
193
182
|
* Trace information for request/response tracking
|
|
194
183
|
* Populated by SSRTraceService and tenant resolution hooks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.types.d.ts","sourceRoot":"","sources":["../../src/types/app.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"app.types.d.ts","sourceRoot":"","sources":["../../src/types/app.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IAC9C,QAAQ,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;IAC9C,QAAQ,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;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,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAElC;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication status codes
|
|
3
|
-
*/
|
|
4
|
-
export declare enum AuthStatus {
|
|
5
|
-
USER_NOT_FOUND = "user_not_found",
|
|
6
|
-
INVALID_CREDENTIALS = "invalid_credentials",
|
|
7
|
-
EMAIL_ALREADY_IN_USE = "email_already_in_use",
|
|
8
|
-
EMAIL_NOT_VERIFIED = "email_not_verified",
|
|
9
|
-
LOGOUT_SUCCESS = "logout_success",
|
|
10
|
-
LOGIN_SUCCESS = "login_success",
|
|
11
|
-
REGISTER_SUCCESS = "register_success"
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=AuthStatusEnum.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthStatusEnum.d.ts","sourceRoot":"","sources":["../../../src/auth/enums/AuthStatusEnum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,UAAU;IACpB,cAAc,mBAAmB;IACjC,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,kBAAkB,uBAAuB;IAEzC,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;CACtC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication status codes
|
|
3
|
-
*/
|
|
4
|
-
export var AuthStatus;
|
|
5
|
-
(function (AuthStatus) {
|
|
6
|
-
AuthStatus["USER_NOT_FOUND"] = "user_not_found";
|
|
7
|
-
AuthStatus["INVALID_CREDENTIALS"] = "invalid_credentials";
|
|
8
|
-
AuthStatus["EMAIL_ALREADY_IN_USE"] = "email_already_in_use";
|
|
9
|
-
AuthStatus["EMAIL_NOT_VERIFIED"] = "email_not_verified";
|
|
10
|
-
AuthStatus["LOGOUT_SUCCESS"] = "logout_success";
|
|
11
|
-
AuthStatus["LOGIN_SUCCESS"] = "login_success";
|
|
12
|
-
AuthStatus["REGISTER_SUCCESS"] = "register_success";
|
|
13
|
-
})(AuthStatus || (AuthStatus = {}));
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { IUser, QuvelTypes } from '@quvel-kit/core';
|
|
2
|
-
/**
|
|
3
|
-
* Type for the authenticated user.
|
|
4
|
-
* Uses QuvelTypes['User'] which can be augmented by consuming applications.
|
|
5
|
-
*/
|
|
6
|
-
type StateUser = QuvelTypes['User'] | null;
|
|
7
|
-
/**
|
|
8
|
-
* Interface defining the structure of the session state.
|
|
9
|
-
*/
|
|
10
|
-
interface SessionState {
|
|
11
|
-
user: StateUser;
|
|
12
|
-
initialized: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Interface defining getters for the session store.
|
|
16
|
-
*/
|
|
17
|
-
type SessionGetters = {
|
|
18
|
-
isAuthenticated: (state: SessionState) => boolean;
|
|
19
|
-
isInitialized: (state: SessionState) => boolean;
|
|
20
|
-
getUser: (state: SessionState) => StateUser;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Interface defining actions for the session store.
|
|
24
|
-
*/
|
|
25
|
-
interface SessionActions {
|
|
26
|
-
setSession(data: IUser): void;
|
|
27
|
-
clearSession(): void;
|
|
28
|
-
markInitialized(): void;
|
|
29
|
-
fetchSession(): Promise<void>;
|
|
30
|
-
getUserFactory(): (data: IUser) => QuvelTypes['User'];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Pinia store for managing user session state.
|
|
34
|
-
*
|
|
35
|
-
* This is a generic session store that can be extended with auth-specific
|
|
36
|
-
* actions (login, signup, etc.) in your application.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```typescript
|
|
40
|
-
* // Use in a component
|
|
41
|
-
* const session = useSessionStore();
|
|
42
|
-
*
|
|
43
|
-
* // Check auth status
|
|
44
|
-
* if (session.isAuthenticated) {
|
|
45
|
-
* console.log(session.user?.name);
|
|
46
|
-
* }
|
|
47
|
-
*
|
|
48
|
-
* // Set session (typically after login)
|
|
49
|
-
* session.setSession(userData);
|
|
50
|
-
*
|
|
51
|
-
* // Clear session (typically after logout)
|
|
52
|
-
* session.clearSession();
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* // Extend with custom actions
|
|
58
|
-
* export const useAuthStore = defineStore('auth', {
|
|
59
|
-
* ...useSessionStore(),
|
|
60
|
-
* actions: {
|
|
61
|
-
* async login(email: string, password: string) {
|
|
62
|
-
* const response = await authService.login(email, password);
|
|
63
|
-
* this.setSession(response.user);
|
|
64
|
-
* }
|
|
65
|
-
* }
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export declare const useSessionStore: import("pinia").StoreDefinition<"session", SessionState, SessionGetters, SessionActions>;
|
|
70
|
-
export {};
|
|
71
|
-
//# sourceMappingURL=sessionStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../../src/auth/stores/sessionStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGzD;;;GAGG;AACH,KAAK,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAClD,aAAa,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC;IAChD,OAAO,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,SAAS,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,UAAU,cAAc;IACtB,UAAU,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,YAAY,IAAI,IAAI,CAAC;IACrB,eAAe,IAAI,IAAI,CAAC;IACxB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,cAAc,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,UAAU,CAAC,MAAM,CAAC,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,eAAe,0FAiG1B,CAAC"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { acceptHMRUpdate, defineStore } from 'pinia';
|
|
2
|
-
import { AuthService } from '../services/AuthService.js';
|
|
3
|
-
/**
|
|
4
|
-
* Pinia store for managing user session state.
|
|
5
|
-
*
|
|
6
|
-
* This is a generic session store that can be extended with auth-specific
|
|
7
|
-
* actions (login, signup, etc.) in your application.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // Use in a component
|
|
12
|
-
* const session = useSessionStore();
|
|
13
|
-
*
|
|
14
|
-
* // Check auth status
|
|
15
|
-
* if (session.isAuthenticated) {
|
|
16
|
-
* console.log(session.user?.name);
|
|
17
|
-
* }
|
|
18
|
-
*
|
|
19
|
-
* // Set session (typically after login)
|
|
20
|
-
* session.setSession(userData);
|
|
21
|
-
*
|
|
22
|
-
* // Clear session (typically after logout)
|
|
23
|
-
* session.clearSession();
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* // Extend with custom actions
|
|
29
|
-
* export const useAuthStore = defineStore('auth', {
|
|
30
|
-
* ...useSessionStore(),
|
|
31
|
-
* actions: {
|
|
32
|
-
* async login(email: string, password: string) {
|
|
33
|
-
* const response = await authService.login(email, password);
|
|
34
|
-
* this.setSession(response.user);
|
|
35
|
-
* }
|
|
36
|
-
* }
|
|
37
|
-
* });
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export const useSessionStore = defineStore('session', {
|
|
41
|
-
state: () => ({
|
|
42
|
-
user: null,
|
|
43
|
-
initialized: false,
|
|
44
|
-
}),
|
|
45
|
-
getters: {
|
|
46
|
-
/**
|
|
47
|
-
* Determines if a user is authenticated.
|
|
48
|
-
*/
|
|
49
|
-
isAuthenticated: (state) => state.user !== null && state.user !== undefined,
|
|
50
|
-
/**
|
|
51
|
-
* Determines if the session store has been initialized.
|
|
52
|
-
*/
|
|
53
|
-
isInitialized: (state) => state.initialized,
|
|
54
|
-
/**
|
|
55
|
-
* Retrieves the authenticated user.
|
|
56
|
-
*/
|
|
57
|
-
getUser: (state) => state.user,
|
|
58
|
-
},
|
|
59
|
-
actions: {
|
|
60
|
-
/**
|
|
61
|
-
* Gets the user factory function from config or returns default.
|
|
62
|
-
* This allows users to provide custom user models.
|
|
63
|
-
*/
|
|
64
|
-
getUserFactory() {
|
|
65
|
-
// Default factory just returns the data as-is (IUser compatible)
|
|
66
|
-
const defaultFactory = (data) => data;
|
|
67
|
-
try {
|
|
68
|
-
return this.$quvel.config.userFactory || defaultFactory;
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
return defaultFactory;
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* Sets the user session using the configured user factory.
|
|
76
|
-
*
|
|
77
|
-
* @param data - Raw user data from API
|
|
78
|
-
*/
|
|
79
|
-
setSession(data) {
|
|
80
|
-
const factory = this.getUserFactory();
|
|
81
|
-
this.user = factory(data);
|
|
82
|
-
this.initialized = true;
|
|
83
|
-
this.$quvel.api.markSessionExists();
|
|
84
|
-
},
|
|
85
|
-
/**
|
|
86
|
-
* Clears the user session.
|
|
87
|
-
*/
|
|
88
|
-
clearSession() {
|
|
89
|
-
this.user = null;
|
|
90
|
-
this.$quvel.api.markSessionCleared();
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* Marks the session store as initialized without setting a user.
|
|
94
|
-
* Used when a session check is complete but no user is authenticated.
|
|
95
|
-
*/
|
|
96
|
-
markInitialized() {
|
|
97
|
-
this.initialized = true;
|
|
98
|
-
},
|
|
99
|
-
/**
|
|
100
|
-
* Fetches the current session from the API using AuthService.
|
|
101
|
-
* Sets the session if a user is authenticated, otherwise marks as initialized.
|
|
102
|
-
*/
|
|
103
|
-
async fetchSession() {
|
|
104
|
-
if (this.initialized) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
try {
|
|
108
|
-
const userData = await this.$quvel.get(AuthService).fetchSession();
|
|
109
|
-
if (userData) {
|
|
110
|
-
this.setSession(userData);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this.markInitialized();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
this.markInitialized();
|
|
118
|
-
throw error;
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
});
|
|
123
|
-
if (import.meta.hot) {
|
|
124
|
-
import.meta.hot.accept(acceptHMRUpdate(useSessionStore, import.meta.hot));
|
|
125
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base User Interface
|
|
3
|
-
*
|
|
4
|
-
* Core user properties that all user implementations should have.
|
|
5
|
-
* Applications can extend this interface for custom user models.
|
|
6
|
-
*/
|
|
7
|
-
export interface IUser {
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
email: string;
|
|
11
|
-
email_verified_at: string | null;
|
|
12
|
-
two_factor_enabled: boolean;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
avatarUrl?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* User Factory Function Type
|
|
19
|
-
*
|
|
20
|
-
* Factory function that creates user instances from API data.
|
|
21
|
-
* Users can provide their own factory to create custom user models.
|
|
22
|
-
*/
|
|
23
|
-
export type UserFactory<T extends IUser = IUser> = (data: IUser) => T;
|
|
24
|
-
/**
|
|
25
|
-
* QuvelTypes Interface
|
|
26
|
-
*
|
|
27
|
-
* This interface is designed to be augmented by consuming applications.
|
|
28
|
-
* Apps can override the User type with their own implementations.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* // In your app's types/quvel.d.ts
|
|
33
|
-
* declare module '@quvel-kit/core' {
|
|
34
|
-
* interface QuvelTypes {
|
|
35
|
-
* User: import('../models/User').User;
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export interface QuvelTypes {
|
|
41
|
-
User: IUser;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=user.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.types.d.ts","sourceRoot":"","sources":["../../src/types/user.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,KAAK,CAAC;CACb"}
|
package/dist/types/user.types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|