@quvel-kit/core 1.3.6 → 1.3.8
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/stores/sessionStore.d.ts +12 -12
- package/dist/auth/stores/sessionStore.d.ts.map +1 -1
- package/dist/auth/stores/sessionStore.js +5 -5
- package/dist/boot/quvel.d.ts +5 -6
- package/dist/boot/quvel.d.ts.map +1 -1
- package/dist/boot/quvel.js +9 -5
- package/dist/build/quasarConfig.d.ts +1 -1
- package/dist/build/quasarConfig.d.ts.map +1 -1
- package/dist/build/quasarConfig.js +9 -10
- package/dist/composables/useMetaConfig.d.ts.map +1 -1
- package/dist/composables/useMetaConfig.js +11 -12
- package/dist/config/quvel.d.ts.map +1 -1
- package/dist/config/quvel.js +2 -1
- package/dist/config/quvel.types.d.ts +10 -0
- package/dist/config/quvel.types.d.ts.map +1 -1
- package/dist/container/ServiceContainer.d.ts +7 -8
- package/dist/container/ServiceContainer.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 -2
- package/dist/services/TaskService.d.ts +22 -10
- package/dist/services/TaskService.d.ts.map +1 -1
- package/dist/services/TaskService.js +5 -2
- package/dist/types/task.types.d.ts +21 -5
- package/dist/types/task.types.d.ts.map +1 -1
- package/dist/types/user.types.d.ts +20 -1
- package/dist/types/user.types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/models/User.d.ts +0 -32
- package/dist/models/User.d.ts.map +0 -1
- package/dist/models/User.js +0 -48
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import type { IUser } from '../../types/user.types.js';
|
|
1
|
+
import type { IUser, QuvelTypes } from '../../types/user.types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Type for the authenticated user.
|
|
4
|
-
*
|
|
4
|
+
* Uses QuvelTypes['User'] which can be augmented by consuming applications.
|
|
5
5
|
*/
|
|
6
|
-
type StateUser
|
|
6
|
+
type StateUser = QuvelTypes['User'] | null;
|
|
7
7
|
/**
|
|
8
8
|
* Interface defining the structure of the session state.
|
|
9
9
|
*/
|
|
10
|
-
interface SessionState
|
|
11
|
-
user: StateUser
|
|
10
|
+
interface SessionState {
|
|
11
|
+
user: StateUser;
|
|
12
12
|
initialized: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Interface defining getters for the session store.
|
|
16
16
|
*/
|
|
17
|
-
type SessionGetters
|
|
18
|
-
isAuthenticated: (state: SessionState
|
|
19
|
-
isInitialized: (state: SessionState
|
|
20
|
-
getUser: (state: SessionState
|
|
17
|
+
type SessionGetters = {
|
|
18
|
+
isAuthenticated: (state: SessionState) => boolean;
|
|
19
|
+
isInitialized: (state: SessionState) => boolean;
|
|
20
|
+
getUser: (state: SessionState) => StateUser;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
23
|
* Interface defining actions for the session store.
|
|
24
24
|
*/
|
|
25
|
-
interface SessionActions
|
|
25
|
+
interface SessionActions {
|
|
26
26
|
setSession(data: IUser): void;
|
|
27
27
|
clearSession(): void;
|
|
28
28
|
markInitialized(): void;
|
|
29
29
|
fetchSession(): Promise<void>;
|
|
30
|
-
getUserFactory(): (data: IUser) =>
|
|
30
|
+
getUserFactory(): (data: IUser) => QuvelTypes['User'];
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Pinia store for managing user session state.
|
|
@@ -66,6 +66,6 @@ interface SessionActions<T extends IUser = IUser> {
|
|
|
66
66
|
* });
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
|
-
export declare const useSessionStore: import("pinia").StoreDefinition<"session", SessionState
|
|
69
|
+
export declare const useSessionStore: import("pinia").StoreDefinition<"session", SessionState, SessionGetters, SessionActions>;
|
|
70
70
|
export {};
|
|
71
71
|
//# sourceMappingURL=sessionStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionStore.d.ts","sourceRoot":"","sources":["../../../src/auth/stores/sessionStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;
|
|
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,2BAA2B,CAAC;AAGnE;;;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,5 +1,4 @@
|
|
|
1
1
|
import { acceptHMRUpdate, defineStore } from 'pinia';
|
|
2
|
-
import { defaultUserFactory } from '../../models/User.js';
|
|
3
2
|
import { AuthService } from '../services/AuthService.js';
|
|
4
3
|
/**
|
|
5
4
|
* Pinia store for managing user session state.
|
|
@@ -63,11 +62,13 @@ export const useSessionStore = defineStore('session', {
|
|
|
63
62
|
* This allows users to provide custom user models.
|
|
64
63
|
*/
|
|
65
64
|
getUserFactory() {
|
|
65
|
+
// Default factory just returns the data as-is (IUser compatible)
|
|
66
|
+
const defaultFactory = (data) => data;
|
|
66
67
|
try {
|
|
67
|
-
return this.$quvel.config.userFactory ||
|
|
68
|
+
return this.$quvel.config.userFactory || defaultFactory;
|
|
68
69
|
}
|
|
69
70
|
catch {
|
|
70
|
-
return
|
|
71
|
+
return defaultFactory;
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
74
|
/**
|
|
@@ -104,8 +105,7 @@ export const useSessionStore = defineStore('session', {
|
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
107
|
try {
|
|
107
|
-
const
|
|
108
|
-
const userData = await authService.fetchSession();
|
|
108
|
+
const userData = await this.$quvel.get(AuthService).fetchSession();
|
|
109
109
|
if (userData) {
|
|
110
110
|
this.setSession(userData);
|
|
111
111
|
}
|
package/dist/boot/quvel.d.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import type { App } from 'vue';
|
|
2
2
|
import type { QSsrContext } from '@quasar/app-vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { QuvelConfig } from '../config/quvel.types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Define Quvel boot function
|
|
6
6
|
*
|
|
7
7
|
* This helper creates a Quasar boot function that initializes the Quvel service container
|
|
8
8
|
* with services from modules.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param quvelConfig - The Quvel configuration from defineQuvelConfig()
|
|
11
11
|
* @returns Boot function for Quasar
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* import { defineQuvelBoot } from '@quvel-kit/core';
|
|
16
|
-
* import {
|
|
17
|
-
* import { modules } from '../modules';
|
|
16
|
+
* import { config } from 'src/quvel';
|
|
18
17
|
*
|
|
19
|
-
* export default defineQuvelBoot(
|
|
18
|
+
* export default defineQuvelBoot(config);
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
|
-
export declare function defineQuvelBoot(
|
|
21
|
+
export declare function defineQuvelBoot(quvelConfig: QuvelConfig): ({ ssrContext, app }: {
|
|
23
22
|
ssrContext?: QSsrContext | null;
|
|
24
23
|
app: App;
|
|
25
24
|
}) => void;
|
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;
|
|
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,UAyBF"}
|
package/dist/boot/quvel.js
CHANGED
|
@@ -6,25 +6,29 @@ import { ContainerKey, setClientContainer } from '../composables/useQuvel.js';
|
|
|
6
6
|
* This helper creates a Quasar boot function that initializes the Quvel service container
|
|
7
7
|
* with services from modules.
|
|
8
8
|
*
|
|
9
|
-
* @param
|
|
9
|
+
* @param quvelConfig - The Quvel configuration from defineQuvelConfig()
|
|
10
10
|
* @returns Boot function for Quasar
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* import { defineQuvelBoot } from '@quvel-kit/core';
|
|
15
|
-
* import {
|
|
16
|
-
* import { modules } from '../modules';
|
|
15
|
+
* import { config } from 'src/quvel';
|
|
17
16
|
*
|
|
18
|
-
* export default defineQuvelBoot(
|
|
17
|
+
* export default defineQuvelBoot(config);
|
|
19
18
|
* ```
|
|
20
19
|
*/
|
|
21
|
-
export function defineQuvelBoot(
|
|
20
|
+
export function defineQuvelBoot(quvelConfig) {
|
|
22
21
|
return ({ ssrContext, app }) => {
|
|
23
22
|
const serviceMap = new Map();
|
|
23
|
+
const serviceRegistry = quvelConfig.getServices();
|
|
24
24
|
for (const [name, ServiceCls] of Object.entries(serviceRegistry)) {
|
|
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
|
+
}
|
|
28
32
|
if (ssrContext) {
|
|
29
33
|
ssrContext.$quvel = container;
|
|
30
34
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Configuration utilities for Quasar applications
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* Create configuration helper for Quasar applications
|
|
7
|
+
* Create a configuration helper for Quasar applications
|
|
8
8
|
*
|
|
9
9
|
* Loads environment variables from .env files in the current working directory
|
|
10
10
|
* and provides infrastructure settings and app metadata.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quasarConfig.d.ts","sourceRoot":"","sources":["../../src/build/quasarConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;;;;;;GAOG;AACH,iBAAS,kBAAkB;IAgBzB;;OAEG;;QAED,gCAAgC;qBACnB,OAAO;QAIpB,kEAAkE;oBACtD;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CA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|
|
9
|
-
* Create configuration helper for Quasar applications
|
|
9
|
+
* Create a configuration helper for Quasar applications
|
|
10
10
|
*
|
|
11
11
|
* Loads environment variables from .env files in the current working directory
|
|
12
12
|
* and provides infrastructure settings and app metadata.
|
|
@@ -58,11 +58,11 @@ function createQuasarConfig() {
|
|
|
58
58
|
getHost(type = 'dev') {
|
|
59
59
|
switch (type) {
|
|
60
60
|
case 'tenant':
|
|
61
|
-
return envConfig.get('DEV_TENANT_HOST', '
|
|
61
|
+
return envConfig.get('DEV_TENANT_HOST', 'localhost');
|
|
62
62
|
case 'prod':
|
|
63
63
|
return envConfig.get('PROD_HOST', '0.0.0.0');
|
|
64
64
|
default:
|
|
65
|
-
return envConfig.get('DEV_HOST', '
|
|
65
|
+
return envConfig.get('DEV_HOST', 'localhost');
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
/** Get dev server port for a specific mode */
|
|
@@ -90,13 +90,13 @@ function createQuasarConfig() {
|
|
|
90
90
|
},
|
|
91
91
|
/** Get a list of allowed hosts */
|
|
92
92
|
getAllowedHosts() {
|
|
93
|
-
return envConfig.getArray('ALLOWED_HOSTS', ['
|
|
93
|
+
return envConfig.getArray('ALLOWED_HOSTS', ['localhost', '127.0.0.1']);
|
|
94
94
|
},
|
|
95
95
|
/** Get HMR configuration for reverse proxy setups */
|
|
96
96
|
getHMR() {
|
|
97
97
|
return {
|
|
98
98
|
protocol: envConfig.get('HMR_PROTOCOL', 'wss'),
|
|
99
|
-
host: envConfig.get('HMR_HOST', '
|
|
99
|
+
host: envConfig.get('HMR_HOST', 'localhost'),
|
|
100
100
|
port: envConfig.getNumber('HMR_PORT', 443),
|
|
101
101
|
};
|
|
102
102
|
},
|
|
@@ -107,15 +107,15 @@ function createQuasarConfig() {
|
|
|
107
107
|
app: {
|
|
108
108
|
/** Get application ID */
|
|
109
109
|
getId() {
|
|
110
|
-
return envConfig.get('APP_ID', '
|
|
110
|
+
return envConfig.get('APP_ID', 'com.example.app');
|
|
111
111
|
},
|
|
112
112
|
/** Get application name */
|
|
113
113
|
getName() {
|
|
114
|
-
return envConfig.get('VITE_APP_NAME', '
|
|
114
|
+
return envConfig.get('VITE_APP_NAME', 'Quasar App');
|
|
115
115
|
},
|
|
116
116
|
/** Get application short name */
|
|
117
117
|
getShortName() {
|
|
118
|
-
return envConfig.get('APP_SHORT_NAME', '
|
|
118
|
+
return envConfig.get('APP_SHORT_NAME', 'App');
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
121
|
/**
|
|
@@ -130,8 +130,7 @@ function createQuasarConfig() {
|
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
|
-
* Default config instance
|
|
134
|
-
* For backward compatibility - prefer using createQuasarConfig() directly
|
|
133
|
+
* Default config instance
|
|
135
134
|
*/
|
|
136
135
|
let _config = null;
|
|
137
136
|
export const config = new Proxy({}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetaConfig.d.ts","sourceRoot":"","sources":["../../src/composables/useMetaConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"useMetaConfig.d.ts","sourceRoot":"","sources":["../../src/composables/useMetaConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAoEpF"}
|
|
@@ -16,19 +16,18 @@ export function useMetaConfig(pageTitle, overrides) {
|
|
|
16
16
|
// Get app meta-configuration from the service container
|
|
17
17
|
const { config } = useQuvel();
|
|
18
18
|
const appMeta = config.meta || {};
|
|
19
|
-
// Use app configuration or fallback to defaults
|
|
20
|
-
const title = pageTitle ?? appMeta?.title ?? '
|
|
19
|
+
// Use app configuration or fallback to empty defaults
|
|
20
|
+
const title = pageTitle ?? appMeta?.title ?? '';
|
|
21
21
|
// Create the title template function from app config or use default
|
|
22
22
|
const titleTemplate = appMeta?.titleTemplate
|
|
23
23
|
? (title) => appMeta.titleTemplate.replace('%s', title)
|
|
24
|
-
: (title) =>
|
|
25
|
-
const description = appMeta?.description ??
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const twitterDescription = appMeta?.twitterDescription ?? 'A Laravel & Quasar hybrid framework optimized for SSR.';
|
|
24
|
+
: (title) => title;
|
|
25
|
+
const description = appMeta?.description ?? '';
|
|
26
|
+
const keywords = appMeta?.keywords ?? '';
|
|
27
|
+
const ogTitle = appMeta?.ogTitle ?? pageTitle ?? '';
|
|
28
|
+
const ogDescription = appMeta?.ogDescription ?? '';
|
|
29
|
+
const twitterTitle = appMeta?.twitterTitle ?? pageTitle ?? '';
|
|
30
|
+
const twitterDescription = appMeta?.twitterDescription ?? '';
|
|
32
31
|
useMeta({
|
|
33
32
|
title,
|
|
34
33
|
titleTemplate,
|
|
@@ -63,8 +62,8 @@ export function useMetaConfig(pageTitle, overrides) {
|
|
|
63
62
|
innerHTML: JSON.stringify({
|
|
64
63
|
'@context': 'https://schema.org',
|
|
65
64
|
'@type': 'WebSite',
|
|
66
|
-
name: appMeta?.title ?? '
|
|
67
|
-
url: config.frontend?.url ?? '
|
|
65
|
+
name: appMeta?.title ?? '',
|
|
66
|
+
url: config.frontend?.url ?? '',
|
|
68
67
|
description,
|
|
69
68
|
}),
|
|
70
69
|
},
|
|
@@ -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,CA8CvE"}
|
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, } = config;
|
|
39
|
+
const { modules = [], localeMapping, core = true, userFactory, } = config;
|
|
40
40
|
const allModules = [];
|
|
41
41
|
if (core) {
|
|
42
42
|
const coreOptions = typeof core === 'object' ? core : {};
|
|
@@ -55,6 +55,7 @@ export function defineQuvelConfig(config) {
|
|
|
55
55
|
modules: allModules,
|
|
56
56
|
messages,
|
|
57
57
|
localeMapping: resolvedLocaleMapping,
|
|
58
|
+
userFactory,
|
|
58
59
|
getRoutes() {
|
|
59
60
|
return getRoutes(allModules);
|
|
60
61
|
},
|
|
@@ -5,6 +5,7 @@
|
|
|
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';
|
|
8
9
|
/**
|
|
9
10
|
* Locale mapping configuration for validation
|
|
10
11
|
* Maps i18n locale codes to Zod locale codes
|
|
@@ -38,6 +39,11 @@ export interface QuvelConfigInput {
|
|
|
38
39
|
*/
|
|
39
40
|
includeI18n?: boolean;
|
|
40
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* User factory function for creating user instances
|
|
44
|
+
* Override to use a custom user model
|
|
45
|
+
*/
|
|
46
|
+
userFactory?: UserFactory;
|
|
41
47
|
}
|
|
42
48
|
/**
|
|
43
49
|
* Resolved Quvel configuration
|
|
@@ -56,6 +62,10 @@ export interface QuvelConfig {
|
|
|
56
62
|
* Locale mapping for validation
|
|
57
63
|
*/
|
|
58
64
|
localeMapping: LocaleMapping;
|
|
65
|
+
/**
|
|
66
|
+
* User factory function for creating user instances
|
|
67
|
+
*/
|
|
68
|
+
userFactory?: UserFactory;
|
|
59
69
|
/**
|
|
60
70
|
* Get all routes from modules
|
|
61
71
|
*/
|
|
@@ -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;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D;;;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;IAEF;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;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,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;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"}
|
|
@@ -92,14 +92,13 @@ export declare class ServiceContainer {
|
|
|
92
92
|
get api(): ApiService;
|
|
93
93
|
get i18n(): I18nService;
|
|
94
94
|
get validation(): ValidationService;
|
|
95
|
-
get task():
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
result: import("vue").Ref<Result | undefined>;
|
|
95
|
+
get task(): {
|
|
96
|
+
<Result>(options: {
|
|
97
|
+
task: () => Result | Promise<Result>;
|
|
98
|
+
} & Omit<import("../index.js").TaskOptions<Result, void>, "task">, mutableProps?: (keyof import("../index.js").TaskOptions<Result, void>)[]): import("../services/TaskService.js").TaskReturn<Result, void>;
|
|
99
|
+
<Result, Payload>(options: {
|
|
100
|
+
task: (payload: Payload) => Result | Promise<Result>;
|
|
101
|
+
} & Omit<import("../index.js").TaskOptions<Result, Payload>, "task">, mutableProps?: (keyof import("../index.js").TaskOptions<Result, Payload>)[]): import("../services/TaskService.js").TaskReturn<Result, Payload>;
|
|
103
102
|
};
|
|
104
103
|
get ws(): WebSocketService;
|
|
105
104
|
get theme(): ThemeService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceContainer.d.ts","sourceRoot":"","sources":["../../src/container/ServiceContainer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,YAAY,EAGb,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAGzD;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IAL/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2C;IACpE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwC;IAC1E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AAE,cAAc,YAAY,CAAC,CAAC,CAAC,KAAG,CAAC,CAkBzD;IAEF;;OAEG;IACH,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIzD;;OAEG;IACH,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,UAAQ,GAAG,OAAO;IAgBxF;;OAEG;IACH,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO;IAIrE;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAUpC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAUnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,OAAO,CAAC,OAAO;IASf;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IAEH,IAAI,GAAG,IAAI,UAAU,CAEpB;IAED,IAAI,GAAG,IAAI,UAAU,CAEpB;IAED,IAAI,IAAI,IAAI,WAAW,CAEtB;IAED,IAAI,UAAU,IAAI,iBAAiB,CAElC;IAED,IAAI,IAAI;;;;;;;MAIP;IAED,IAAI,EAAE,IAAI,gBAAgB,CAEzB;IAED,IAAI,KAAK,IAAI,YAAY,CAExB;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,6 @@ export { createConfigFromEnv, createConfig } from './utils/config.js';
|
|
|
23
23
|
export { BaseLogger } from './services/logger/BaseLogger.js';
|
|
24
24
|
export { ConsoleLogger } from './services/logger/ConsoleLogger.js';
|
|
25
25
|
export { NullLogger } from './services/logger/NullLogger.js';
|
|
26
|
-
export { User, defaultUserFactory } from './models/User.js';
|
|
27
26
|
export * from './types/config.types.js';
|
|
28
27
|
export * from './types/logging.types.js';
|
|
29
28
|
export * from './types/app.types.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;;;;;;GAMG;AAUH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AAGjC,YAAY,EACV,OAAO,IAAI,QAAQ,EACnB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,cAAc,mBAAmB,CAAC;AAClC,cAAc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;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
|
@@ -32,8 +32,6 @@ export { createConfigFromEnv, createConfig } from './utils/config.js';
|
|
|
32
32
|
export { BaseLogger } from './services/logger/BaseLogger.js';
|
|
33
33
|
export { ConsoleLogger } from './services/logger/ConsoleLogger.js';
|
|
34
34
|
export { NullLogger } from './services/logger/NullLogger.js';
|
|
35
|
-
// Models
|
|
36
|
-
export { User, defaultUserFactory } from './models/User.js';
|
|
37
35
|
// Types
|
|
38
36
|
export * from './types/config.types.js';
|
|
39
37
|
export * from './types/logging.types.js';
|
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type Ref, type ComputedRef } from 'vue';
|
|
7
7
|
import type { TaskOptions, TaskState, ErrorBag } from '../types/task.types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Return type for the task() method
|
|
10
|
+
*/
|
|
11
|
+
export interface TaskReturn<Result, Payload = void> {
|
|
12
|
+
isActive: ComputedRef<boolean>;
|
|
13
|
+
run: (customOptions?: Partial<TaskOptions<Result, Payload>>) => Promise<Result | false>;
|
|
14
|
+
reset: () => void;
|
|
15
|
+
state: Ref<TaskState>;
|
|
16
|
+
error: Ref<unknown>;
|
|
17
|
+
errors: Ref<ErrorBag>;
|
|
18
|
+
result: Ref<Result | undefined>;
|
|
19
|
+
}
|
|
8
20
|
import type { RegisterService } from '../container/types.js';
|
|
9
21
|
import type { ServiceContainer } from '../container/ServiceContainer.js';
|
|
10
22
|
import { Service } from './Service.js';
|
|
@@ -25,17 +37,17 @@ export declare class TaskService extends Service implements RegisterService {
|
|
|
25
37
|
*/
|
|
26
38
|
register({ i18n }: ServiceContainer): void;
|
|
27
39
|
/**
|
|
28
|
-
* Creates a new managed task
|
|
40
|
+
* Creates a new managed task (no payload) - infers Result from callback return
|
|
41
|
+
*/
|
|
42
|
+
task<Result>(options: {
|
|
43
|
+
task: () => Result | Promise<Result>;
|
|
44
|
+
} & Omit<TaskOptions<Result, void>, 'task'>, mutableProps?: (keyof TaskOptions<Result, void>)[]): TaskReturn<Result, void>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new managed task (with payload) - infers Result and Payload from callback
|
|
29
47
|
*/
|
|
30
|
-
task<Result
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
reset: () => void;
|
|
34
|
-
state: Ref<TaskState>;
|
|
35
|
-
error: Ref<unknown>;
|
|
36
|
-
errors: Ref<ErrorBag>;
|
|
37
|
-
result: Ref<Result | undefined>;
|
|
38
|
-
};
|
|
48
|
+
task<Result, Payload>(options: {
|
|
49
|
+
task: (payload: Payload) => Result | Promise<Result>;
|
|
50
|
+
} & Omit<TaskOptions<Result, Payload>, 'task'>, mutableProps?: (keyof TaskOptions<Result, Payload>)[]): TaskReturn<Result, Payload>;
|
|
39
51
|
/**
|
|
40
52
|
* Resets the task state
|
|
41
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskService.d.ts","sourceRoot":"","sources":["../../src/services/TaskService.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,GAAG,EAAE,KAAK,WAAW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AEG;IACI,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,GAAG,IAAI;IAIjD;;OAEG;IACI,IAAI,CAAC,MAAM,EAChB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,EAC3F,YAAY,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,GACjD,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC;IAE3B;;OAEG;IACI,IAAI,CAAC,MAAM,EAAE,OAAO,EACzB,OAAO,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CACtE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,MAAM,CACP,EACD,YAAY,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,GACpD,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC;IA8C9B;;OAEG;IACH,OAAO,CAAC,SAAS;IAYjB;;OAEG;YACW,OAAO;IAmErB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgC5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA2C5B;;OAEG;YACW,wBAAwB;CAqBvC"}
|
|
@@ -27,7 +27,7 @@ export class TaskService extends Service {
|
|
|
27
27
|
this.i18n = i18n;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Creates a new managed task
|
|
30
|
+
* Creates a new managed task (implementation)
|
|
31
31
|
*/
|
|
32
32
|
task(options, mutableProps = []) {
|
|
33
33
|
const currentError = ref();
|
|
@@ -79,7 +79,10 @@ export class TaskService extends Service {
|
|
|
79
79
|
showLoading(0, taskOptions.loadingOptions);
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
// Resolve payload and call task - cast needed for conditional type handling
|
|
83
|
+
const payload = await resolveValue(taskOptions.taskPayload);
|
|
84
|
+
const taskFn = taskOptions.task;
|
|
85
|
+
const result = await taskFn(payload);
|
|
83
86
|
currentResult.value = result;
|
|
84
87
|
currentState.value = 'success';
|
|
85
88
|
this.handleTaskCompletion(result, currentErrors, taskOptions.successHandlers, taskOptions.showNotification?.success, false);
|
|
@@ -50,24 +50,40 @@ export type ErrorCallbackOrValue<Err = unknown> = Array<ErrorHandler<Err>> | ((e
|
|
|
50
50
|
* Callback for Laravel error handler
|
|
51
51
|
*/
|
|
52
52
|
export type ErrorHandlerCallback = (err: AxiosError, context: ErrorHandlerContext<LaravelErrorResponse>) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Extracts the return type from a task callback (unwraps Promise if async)
|
|
55
|
+
*/
|
|
56
|
+
export type InferTaskResult<T> = T extends (...args: never[]) => Promise<infer R> ? R : T extends (...args: never[]) => infer R ? R : unknown;
|
|
57
|
+
/**
|
|
58
|
+
* Extracts the payload type from a task callback's first parameter
|
|
59
|
+
*/
|
|
60
|
+
export type InferTaskPayload<T> = T extends (payload: infer P) => unknown ? P : void;
|
|
61
|
+
/**
|
|
62
|
+
* Task callback type - conditional based on whether Payload is void
|
|
63
|
+
*/
|
|
64
|
+
export type TaskCallback<Result, Payload> = Payload extends void ? () => Result | Promise<Result> : (payload: Payload) => Result | Promise<Result>;
|
|
65
|
+
/**
|
|
66
|
+
* Task payload resolver type - only present when Payload is not void
|
|
67
|
+
*/
|
|
68
|
+
export type TaskPayloadResolver<Payload> = Payload extends void ? never : Payload | (() => Payload) | (() => Promise<Payload>);
|
|
53
69
|
/**
|
|
54
70
|
* Defines the options available when creating a new task
|
|
55
71
|
*
|
|
56
72
|
* @template Result The result type of the task
|
|
57
73
|
* @template Payload The payload type of the task
|
|
58
74
|
*/
|
|
59
|
-
export interface TaskOptions<Result = unknown, Payload =
|
|
75
|
+
export interface TaskOptions<Result = unknown, Payload = void> {
|
|
60
76
|
/**
|
|
61
77
|
* The primary function executed when the task runs
|
|
62
78
|
*
|
|
63
79
|
* @returns The result of the task function
|
|
64
80
|
*/
|
|
65
|
-
task:
|
|
81
|
+
task: TaskCallback<Result, Payload>;
|
|
66
82
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
83
|
+
* Payload resolver for the task function.
|
|
84
|
+
* Required when Payload is specified, not allowed when Payload is void.
|
|
69
85
|
*/
|
|
70
|
-
taskPayload?:
|
|
86
|
+
taskPayload?: TaskPayloadResolver<Payload>;
|
|
71
87
|
/**
|
|
72
88
|
* Function executed at the end of the task, regardless of success or failure
|
|
73
89
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.types.d.ts","sourceRoot":"","sources":["../../src/types/task.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,MAAM,GAAG,OAAO;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,OAAO,GAAG,OAAO;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;CAC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;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAEhC;;OAEG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAEjD;;OAEG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;OAEG;IACH,kBAAkB,CAAC,EACf,OAAO,GACP;QACE,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,YAAY,CAAC,EAAE,oBAAoB,CAAC;KACrC,CAAC;CACP;AAGD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ export interface IUser {
|
|
|
9
9
|
name: string;
|
|
10
10
|
email: string;
|
|
11
11
|
email_verified_at: string | null;
|
|
12
|
-
two_factor_enabled
|
|
12
|
+
two_factor_enabled: boolean;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
15
|
avatarUrl?: string;
|
|
@@ -21,4 +21,23 @@ export interface IUser {
|
|
|
21
21
|
* Users can provide their own factory to create custom user models.
|
|
22
22
|
*/
|
|
23
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
|
+
}
|
|
24
43
|
//# sourceMappingURL=user.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quvel-kit/core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Core utilities for Quvel UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"pusher-js": "^8.0.0",
|
|
71
71
|
"quasar": "^2.0.0",
|
|
72
72
|
"vue": "^3.0.0",
|
|
73
|
-
"vue-i18n": "^
|
|
73
|
+
"vue-i18n": "^11.0.0",
|
|
74
74
|
"vue-router": "^4.0.0",
|
|
75
75
|
"zod": "^3.25.0"
|
|
76
76
|
},
|
package/dist/models/User.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IUser } from '../types/user.types';
|
|
2
|
-
/**
|
|
3
|
-
* Base User Model
|
|
4
|
-
*
|
|
5
|
-
* Default implementation of the IUser interface.
|
|
6
|
-
* Applications can extend this class or provide their own implementation.
|
|
7
|
-
*/
|
|
8
|
-
export declare class User implements IUser {
|
|
9
|
-
id: number;
|
|
10
|
-
name: string;
|
|
11
|
-
email: string;
|
|
12
|
-
email_verified_at: string | null;
|
|
13
|
-
two_factor_enabled?: boolean;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
updatedAt: string;
|
|
16
|
-
constructor(data?: Partial<IUser>);
|
|
17
|
-
/**
|
|
18
|
-
* Create a User instance from API data
|
|
19
|
-
*
|
|
20
|
-
* @param data - API response data
|
|
21
|
-
* @returns User instance
|
|
22
|
-
*/
|
|
23
|
-
static fromApi(data: IUser): User;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Default User Factory
|
|
27
|
-
*
|
|
28
|
-
* Default factory function for creating user instances.
|
|
29
|
-
* Can be overridden in AppConfig.
|
|
30
|
-
*/
|
|
31
|
-
export declare const defaultUserFactory: (data: IUser) => User;
|
|
32
|
-
//# sourceMappingURL=User.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../src/models/User.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,KAAK;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,GAAC,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;gBAEN,IAAI,GAAE,OAAO,CAAC,KAAK,CAAM;IAUrC;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;CAWlC;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,KAAK,KAAG,IAA0B,CAAC"}
|
package/dist/models/User.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base User Model
|
|
3
|
-
*
|
|
4
|
-
* Default implementation of the IUser interface.
|
|
5
|
-
* Applications can extend this class or provide their own implementation.
|
|
6
|
-
*/
|
|
7
|
-
export class User {
|
|
8
|
-
id;
|
|
9
|
-
name;
|
|
10
|
-
email;
|
|
11
|
-
email_verified_at;
|
|
12
|
-
two_factor_enabled;
|
|
13
|
-
createdAt;
|
|
14
|
-
updatedAt;
|
|
15
|
-
constructor(data = {}) {
|
|
16
|
-
this.id = data.id ?? 0;
|
|
17
|
-
this.name = data.name ?? '';
|
|
18
|
-
this.email = data.email ?? '';
|
|
19
|
-
this.email_verified_at = data.email_verified_at ?? null;
|
|
20
|
-
this.two_factor_enabled = data.two_factor_enabled;
|
|
21
|
-
this.createdAt = data.createdAt ?? '';
|
|
22
|
-
this.updatedAt = data.updatedAt ?? '';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Create a User instance from API data
|
|
26
|
-
*
|
|
27
|
-
* @param data - API response data
|
|
28
|
-
* @returns User instance
|
|
29
|
-
*/
|
|
30
|
-
static fromApi(data) {
|
|
31
|
-
return new User({
|
|
32
|
-
id: data.id,
|
|
33
|
-
name: data.name,
|
|
34
|
-
email: data.email,
|
|
35
|
-
email_verified_at: data.email_verified_at,
|
|
36
|
-
two_factor_enabled: data.two_factor_enabled,
|
|
37
|
-
createdAt: data.createdAt,
|
|
38
|
-
updatedAt: data.updatedAt,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Default User Factory
|
|
44
|
-
*
|
|
45
|
-
* Default factory function for creating user instances.
|
|
46
|
-
* Can be overridden in AppConfig.
|
|
47
|
-
*/
|
|
48
|
-
export const defaultUserFactory = (data) => User.fromApi(data);
|