@quvel-kit/core 1.1.0
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/README.md +670 -0
- package/dist/auth/boot/defineAuthGuard.d.ts +54 -0
- package/dist/auth/boot/defineAuthGuard.d.ts.map +1 -0
- package/dist/auth/boot/defineAuthGuard.js +72 -0
- package/dist/auth/enums/AuthStatusEnum.d.ts +13 -0
- package/dist/auth/enums/AuthStatusEnum.d.ts.map +1 -0
- package/dist/auth/enums/AuthStatusEnum.js +13 -0
- package/dist/auth/index.d.ts +13 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +13 -0
- package/dist/auth/services/AuthGuard.d.ts +58 -0
- package/dist/auth/services/AuthGuard.d.ts.map +1 -0
- package/dist/auth/services/AuthGuard.js +51 -0
- package/dist/auth/services/AuthService.d.ts +52 -0
- package/dist/auth/services/AuthService.d.ts.map +1 -0
- package/dist/auth/services/AuthService.js +67 -0
- package/dist/auth/services/PasswordResetService.d.ts +34 -0
- package/dist/auth/services/PasswordResetService.d.ts.map +1 -0
- package/dist/auth/services/PasswordResetService.js +45 -0
- package/dist/auth/services/TwoFactorChallengeService.d.ts +22 -0
- package/dist/auth/services/TwoFactorChallengeService.d.ts.map +1 -0
- package/dist/auth/services/TwoFactorChallengeService.js +29 -0
- package/dist/auth/services/TwoFactorService.d.ts +64 -0
- package/dist/auth/services/TwoFactorService.d.ts.map +1 -0
- package/dist/auth/services/TwoFactorService.js +68 -0
- package/dist/auth/services/index.d.ts +8 -0
- package/dist/auth/services/index.d.ts.map +1 -0
- package/dist/auth/services/index.js +5 -0
- package/dist/auth/types/auth-meta.d.ts +54 -0
- package/dist/auth/types/auth-meta.d.ts.map +1 -0
- package/dist/auth/types/auth-meta.js +6 -0
- package/dist/auth/types/index.d.ts +5 -0
- package/dist/auth/types/index.d.ts.map +1 -0
- package/dist/auth/types/index.js +4 -0
- package/dist/auth/utils/auth-meta.d.ts +75 -0
- package/dist/auth/utils/auth-meta.d.ts.map +1 -0
- package/dist/auth/utils/auth-meta.js +93 -0
- package/dist/boot/quvel.d.ts +26 -0
- package/dist/boot/quvel.d.ts.map +1 -0
- package/dist/boot/quvel.js +38 -0
- package/dist/build/index.d.ts +9 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +8 -0
- package/dist/build/loadEnv.d.ts +14 -0
- package/dist/build/loadEnv.d.ts.map +1 -0
- package/dist/build/loadEnv.js +33 -0
- package/dist/build/quasarConfig.d.ts +67 -0
- package/dist/build/quasarConfig.d.ts.map +1 -0
- package/dist/build/quasarConfig.js +126 -0
- package/dist/components/Common/TaskErrors.vue +47 -0
- package/dist/components/Inputs/BaseInput.vue +88 -0
- package/dist/components/Misc/ClientOnly.vue +22 -0
- package/dist/components/Transitions/FadeInOut.vue +9 -0
- package/dist/components/Transitions/SlowExpand.vue +13 -0
- package/dist/components/WebSocketChannelManager.vue +634 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +16 -0
- package/dist/composables/index.d.ts +19 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/composables/index.js +16 -0
- package/dist/composables/useClient.d.ts +16 -0
- package/dist/composables/useClient.d.ts.map +1 -0
- package/dist/composables/useClient.js +28 -0
- package/dist/composables/useMetaConfig.d.ts +14 -0
- package/dist/composables/useMetaConfig.d.ts.map +1 -0
- package/dist/composables/useMetaConfig.js +77 -0
- package/dist/composables/useQueryMessageHandler.d.ts +44 -0
- package/dist/composables/useQueryMessageHandler.d.ts.map +1 -0
- package/dist/composables/useQueryMessageHandler.js +74 -0
- package/dist/composables/useQuvel.d.ts +15 -0
- package/dist/composables/useQuvel.d.ts.map +1 -0
- package/dist/composables/useQuvel.js +38 -0
- package/dist/composables/useRecaptcha.d.ts +35 -0
- package/dist/composables/useRecaptcha.d.ts.map +1 -0
- package/dist/composables/useRecaptcha.js +87 -0
- package/dist/composables/useScopedService.d.ts +18 -0
- package/dist/composables/useScopedService.d.ts.map +1 -0
- package/dist/composables/useScopedService.js +25 -0
- package/dist/composables/useScript.d.ts +25 -0
- package/dist/composables/useScript.d.ts.map +1 -0
- package/dist/composables/useScript.js +106 -0
- package/dist/composables/useUrlQueryHandler.d.ts +38 -0
- package/dist/composables/useUrlQueryHandler.d.ts.map +1 -0
- package/dist/composables/useUrlQueryHandler.js +76 -0
- package/dist/composables/useWebSockets.d.ts +18 -0
- package/dist/composables/useWebSockets.d.ts.map +1 -0
- package/dist/composables/useWebSockets.js +55 -0
- package/dist/composables/useWindowEvent.d.ts +16 -0
- package/dist/composables/useWindowEvent.d.ts.map +1 -0
- package/dist/composables/useWindowEvent.js +27 -0
- package/dist/composables/useXsrf.d.ts +29 -0
- package/dist/composables/useXsrf.d.ts.map +1 -0
- package/dist/composables/useXsrf.js +59 -0
- package/dist/config/QuasarConfigBuilder.d.ts +100 -0
- package/dist/config/QuasarConfigBuilder.d.ts.map +1 -0
- package/dist/config/QuasarConfigBuilder.js +98 -0
- package/dist/config/i18n.d.ts +23 -0
- package/dist/config/i18n.d.ts.map +1 -0
- package/dist/config/i18n.js +43 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +7 -0
- package/dist/config/moduleTransformer.d.ts +18 -0
- package/dist/config/moduleTransformer.d.ts.map +1 -0
- package/dist/config/moduleTransformer.js +76 -0
- package/dist/config/quvel.d.ts +40 -0
- package/dist/config/quvel.d.ts.map +1 -0
- package/dist/config/quvel.js +59 -0
- package/dist/config/quvel.types.d.ts +59 -0
- package/dist/config/quvel.types.d.ts.map +1 -0
- package/dist/config/quvel.types.js +6 -0
- package/dist/container/ServiceContainer.d.ts +107 -0
- package/dist/container/ServiceContainer.d.ts.map +1 -0
- package/dist/container/ServiceContainer.js +201 -0
- package/dist/container/types/vue.d.ts +9 -0
- package/dist/container/types.d.ts +81 -0
- package/dist/container/types.d.ts.map +1 -0
- package/dist/container/types.js +1 -0
- package/dist/i18n/en-US/common.d.ts +19 -0
- package/dist/i18n/en-US/common.d.ts.map +1 -0
- package/dist/i18n/en-US/common.js +17 -0
- package/dist/i18n/en-US/index.d.ts +21 -0
- package/dist/i18n/en-US/index.d.ts.map +1 -0
- package/dist/i18n/en-US/index.js +4 -0
- package/dist/i18n/es-MX/common.d.ts +19 -0
- package/dist/i18n/es-MX/common.d.ts.map +1 -0
- package/dist/i18n/es-MX/common.js +17 -0
- package/dist/i18n/es-MX/index.d.ts +21 -0
- package/dist/i18n/es-MX/index.d.ts.map +1 -0
- package/dist/i18n/es-MX/index.js +4 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/models/User.d.ts +32 -0
- package/dist/models/User.d.ts.map +1 -0
- package/dist/models/User.js +48 -0
- package/dist/module.d.ts +21 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +45 -0
- package/dist/modules/helpers.d.ts +30 -0
- package/dist/modules/helpers.d.ts.map +1 -0
- package/dist/modules/helpers.js +45 -0
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +6 -0
- package/dist/modules/types.d.ts +141 -0
- package/dist/modules/types.d.ts.map +1 -0
- package/dist/modules/types.js +7 -0
- package/dist/pages/ErrorNotFound.vue +300 -0
- package/dist/pages/index.d.ts +7 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +6 -0
- package/dist/services/ApiService.d.ts +90 -0
- package/dist/services/ApiService.d.ts.map +1 -0
- package/dist/services/ApiService.js +159 -0
- package/dist/services/I18nService.d.ts +67 -0
- package/dist/services/I18nService.d.ts.map +1 -0
- package/dist/services/I18nService.js +92 -0
- package/dist/services/LogService.d.ts +31 -0
- package/dist/services/LogService.d.ts.map +1 -0
- package/dist/services/LogService.js +49 -0
- package/dist/services/Service.d.ts +10 -0
- package/dist/services/Service.d.ts.map +1 -0
- package/dist/services/Service.js +8 -0
- package/dist/services/TaskService.d.ts +64 -0
- package/dist/services/TaskService.d.ts.map +1 -0
- package/dist/services/TaskService.js +188 -0
- package/dist/services/ThemeService.d.ts +28 -0
- package/dist/services/ThemeService.d.ts.map +1 -0
- package/dist/services/ThemeService.js +77 -0
- package/dist/services/ValidationService.d.ts +55 -0
- package/dist/services/ValidationService.d.ts.map +1 -0
- package/dist/services/ValidationService.js +81 -0
- package/dist/services/WebSocketService.d.ts +59 -0
- package/dist/services/WebSocketService.d.ts.map +1 -0
- package/dist/services/WebSocketService.js +148 -0
- package/dist/services/logger/BaseLogger.d.ts +35 -0
- package/dist/services/logger/BaseLogger.d.ts.map +1 -0
- package/dist/services/logger/BaseLogger.js +66 -0
- package/dist/services/logger/ConsoleLogger.d.ts +21 -0
- package/dist/services/logger/ConsoleLogger.d.ts.map +1 -0
- package/dist/services/logger/ConsoleLogger.js +60 -0
- package/dist/services/logger/NullLogger.d.ts +10 -0
- package/dist/services/logger/NullLogger.d.ts.map +1 -0
- package/dist/services/logger/NullLogger.js +10 -0
- package/dist/stores/plugins/serviceContainer.d.ts +10 -0
- package/dist/stores/plugins/serviceContainer.d.ts.map +1 -0
- package/dist/stores/plugins/serviceContainer.js +14 -0
- package/dist/stores/sessionStore.d.ts +71 -0
- package/dist/stores/sessionStore.d.ts.map +1 -0
- package/dist/stores/sessionStore.js +125 -0
- package/dist/types/app.types.d.ts +202 -0
- package/dist/types/app.types.d.ts.map +1 -0
- package/dist/types/app.types.js +6 -0
- package/dist/types/config.types.d.ts +2 -0
- package/dist/types/config.types.d.ts.map +1 -0
- package/dist/types/config.types.js +1 -0
- package/dist/types/global.d.ts +33 -0
- package/dist/types/i18n.types.d.ts +21 -0
- package/dist/types/i18n.types.d.ts.map +1 -0
- package/dist/types/i18n.types.js +6 -0
- package/dist/types/laravel.types.d.ts +167 -0
- package/dist/types/laravel.types.d.ts.map +1 -0
- package/dist/types/laravel.types.js +6 -0
- package/dist/types/logging.types.d.ts +81 -0
- package/dist/types/logging.types.d.ts.map +1 -0
- package/dist/types/logging.types.js +22 -0
- package/dist/types/pinia.d.ts +24 -0
- package/dist/types/scripts.types.d.ts +31 -0
- package/dist/types/scripts.types.d.ts.map +1 -0
- package/dist/types/scripts.types.js +6 -0
- package/dist/types/ssr.d.ts +11 -0
- package/dist/types/task.types.d.ts +121 -0
- package/dist/types/task.types.d.ts.map +1 -0
- package/dist/types/task.types.js +7 -0
- package/dist/types/theme.types.d.ts +13 -0
- package/dist/types/theme.types.d.ts.map +1 -0
- package/dist/types/theme.types.js +17 -0
- package/dist/types/user.types.d.ts +24 -0
- package/dist/types/user.types.d.ts.map +1 -0
- package/dist/types/user.types.js +1 -0
- package/dist/types/vue-shim.d.ts +11 -0
- package/dist/types/websocket.types.d.ts +62 -0
- package/dist/types/websocket.types.d.ts.map +1 -0
- package/dist/types/websocket.types.js +6 -0
- package/dist/utils/apiInterceptors.d.ts +76 -0
- package/dist/utils/apiInterceptors.d.ts.map +1 -0
- package/dist/utils/apiInterceptors.js +149 -0
- package/dist/utils/assets.d.ts +40 -0
- package/dist/utils/assets.d.ts.map +1 -0
- package/dist/utils/assets.js +340 -0
- package/dist/utils/axios.d.ts +19 -0
- package/dist/utils/axios.d.ts.map +1 -0
- package/dist/utils/axios.js +113 -0
- package/dist/utils/config.d.ts +16 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +48 -0
- package/dist/utils/container.d.ts +12 -0
- package/dist/utils/container.d.ts.map +1 -0
- package/dist/utils/container.js +11 -0
- package/dist/utils/deepMerge.d.ts +28 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/deepMerge.js +59 -0
- package/dist/utils/envConfig.d.ts +73 -0
- package/dist/utils/envConfig.d.ts.map +1 -0
- package/dist/utils/envConfig.js +161 -0
- package/dist/utils/error.d.ts +44 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +67 -0
- package/dist/utils/headers.d.ts +36 -0
- package/dist/utils/headers.d.ts.map +1 -0
- package/dist/utils/headers.js +54 -0
- package/dist/utils/i18n.d.ts +26 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +56 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +13 -0
- package/dist/utils/loading.d.ts +29 -0
- package/dist/utils/loading.d.ts.map +1 -0
- package/dist/utils/loading.js +46 -0
- package/dist/utils/logging.d.ts +20 -0
- package/dist/utils/logging.d.ts.map +1 -0
- package/dist/utils/logging.js +54 -0
- package/dist/utils/notify.d.ts +15 -0
- package/dist/utils/notify.d.ts.map +1 -0
- package/dist/utils/notify.js +30 -0
- package/dist/utils/object.d.ts +28 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +48 -0
- package/dist/utils/pagination.d.ts +60 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/pagination.js +252 -0
- package/dist/utils/paths.d.ts +54 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +48 -0
- package/dist/utils/platform.d.ts +25 -0
- package/dist/utils/platform.d.ts.map +1 -0
- package/dist/utils/platform.js +64 -0
- package/dist/utils/scripts.d.ts +20 -0
- package/dist/utils/scripts.d.ts.map +1 -0
- package/dist/utils/scripts.js +39 -0
- package/global.d.ts +29 -0
- package/package.json +119 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { acceptHMRUpdate, defineStore } from 'pinia';
|
|
2
|
+
import { defaultUserFactory } from '../models/User.js';
|
|
3
|
+
import { AuthService } from '../auth/services/AuthService.js';
|
|
4
|
+
/**
|
|
5
|
+
* Pinia store for managing user session state.
|
|
6
|
+
*
|
|
7
|
+
* This is a generic session store that can be extended with auth-specific
|
|
8
|
+
* actions (login, signup, etc.) in your application.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Use in a component
|
|
13
|
+
* const session = useSessionStore();
|
|
14
|
+
*
|
|
15
|
+
* // Check auth status
|
|
16
|
+
* if (session.isAuthenticated) {
|
|
17
|
+
* console.log(session.user?.name);
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* // Set session (typically after login)
|
|
21
|
+
* session.setSession(userData);
|
|
22
|
+
*
|
|
23
|
+
* // Clear session (typically after logout)
|
|
24
|
+
* session.clearSession();
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Extend with custom actions
|
|
30
|
+
* export const useAuthStore = defineStore('auth', {
|
|
31
|
+
* ...useSessionStore(),
|
|
32
|
+
* actions: {
|
|
33
|
+
* async login(email: string, password: string) {
|
|
34
|
+
* const response = await authService.login(email, password);
|
|
35
|
+
* this.setSession(response.user);
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export const useSessionStore = defineStore('session', {
|
|
42
|
+
state: () => ({
|
|
43
|
+
user: null,
|
|
44
|
+
initialized: false,
|
|
45
|
+
}),
|
|
46
|
+
getters: {
|
|
47
|
+
/**
|
|
48
|
+
* Determines if a user is authenticated.
|
|
49
|
+
*/
|
|
50
|
+
isAuthenticated: (state) => state.user !== null && state.user !== undefined,
|
|
51
|
+
/**
|
|
52
|
+
* Determines if the session store has been initialized.
|
|
53
|
+
*/
|
|
54
|
+
isInitialized: (state) => state.initialized,
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves the authenticated user.
|
|
57
|
+
*/
|
|
58
|
+
getUser: (state) => state.user,
|
|
59
|
+
},
|
|
60
|
+
actions: {
|
|
61
|
+
/**
|
|
62
|
+
* Gets the user factory function from config or returns default.
|
|
63
|
+
* This allows users to provide custom user models.
|
|
64
|
+
*/
|
|
65
|
+
getUserFactory() {
|
|
66
|
+
try {
|
|
67
|
+
return this.$quvel.config.userFactory || defaultUserFactory;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return defaultUserFactory;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* Sets the user session using the configured user factory.
|
|
75
|
+
*
|
|
76
|
+
* @param data - Raw user data from API
|
|
77
|
+
*/
|
|
78
|
+
setSession(data) {
|
|
79
|
+
const factory = this.getUserFactory();
|
|
80
|
+
this.user = factory(data);
|
|
81
|
+
this.initialized = true;
|
|
82
|
+
this.$quvel.api.markSessionExists();
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Clears the user session.
|
|
86
|
+
*/
|
|
87
|
+
clearSession() {
|
|
88
|
+
this.user = null;
|
|
89
|
+
this.$quvel.api.markSessionCleared();
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Marks the session store as initialized without setting a user.
|
|
93
|
+
* Used when a session check is complete but no user is authenticated.
|
|
94
|
+
*/
|
|
95
|
+
markInitialized() {
|
|
96
|
+
this.initialized = true;
|
|
97
|
+
},
|
|
98
|
+
/**
|
|
99
|
+
* Fetches the current session from the API using AuthService.
|
|
100
|
+
* Sets the session if a user is authenticated, otherwise marks as initialized.
|
|
101
|
+
*/
|
|
102
|
+
async fetchSession() {
|
|
103
|
+
if (this.initialized) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const authService = this.$quvel.get(AuthService);
|
|
108
|
+
const userData = await 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
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Dynamic server-side configuration for the Quasar app
|
|
5
|
+
*/
|
|
6
|
+
import type { UserFactory } from './user.types';
|
|
7
|
+
import type { TraceInfo } from './logging.types';
|
|
8
|
+
/**
|
|
9
|
+
* CSS asset configuration for dynamic injection
|
|
10
|
+
*/
|
|
11
|
+
export interface CSSAssetConfig {
|
|
12
|
+
url?: string;
|
|
13
|
+
inline?: string;
|
|
14
|
+
media?: string;
|
|
15
|
+
integrity?: string;
|
|
16
|
+
crossorigin?: string;
|
|
17
|
+
position?: 'head' | 'body-start' | 'body-end';
|
|
18
|
+
priority?: 'critical' | 'normal' | 'low';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* JavaScript asset configuration for dynamic injection
|
|
22
|
+
*/
|
|
23
|
+
export interface JSAssetConfig {
|
|
24
|
+
url?: string;
|
|
25
|
+
inline?: string;
|
|
26
|
+
defer?: boolean;
|
|
27
|
+
async?: boolean;
|
|
28
|
+
integrity?: string;
|
|
29
|
+
crossorigin?: string;
|
|
30
|
+
position?: 'head' | 'body-start' | 'body-end';
|
|
31
|
+
priority?: 'critical' | 'normal' | 'low';
|
|
32
|
+
loading?: 'immediate' | 'deferred' | 'lazy';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* App assets configuration
|
|
36
|
+
*/
|
|
37
|
+
export interface AppAssets {
|
|
38
|
+
css?: CSSAssetConfig[];
|
|
39
|
+
js?: JSAssetConfig[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* App meta configuration for SEO and social sharing
|
|
43
|
+
*/
|
|
44
|
+
export interface AppMeta {
|
|
45
|
+
title?: string;
|
|
46
|
+
titleTemplate?: string;
|
|
47
|
+
description?: string;
|
|
48
|
+
keywords?: string;
|
|
49
|
+
ogTitle?: string;
|
|
50
|
+
ogDescription?: string;
|
|
51
|
+
ogImage?: string;
|
|
52
|
+
twitterTitle?: string;
|
|
53
|
+
twitterDescription?: string;
|
|
54
|
+
twitterImage?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* HTTP headers configuration
|
|
58
|
+
* Allows customization of header names to match backend configuration
|
|
59
|
+
*/
|
|
60
|
+
export interface HeadersConfig {
|
|
61
|
+
/** Accept-Language header name (default: 'Accept-Language') */
|
|
62
|
+
acceptLanguage?: string;
|
|
63
|
+
/** Trace ID header name (default: 'X-Trace-ID') */
|
|
64
|
+
traceId?: string;
|
|
65
|
+
/** Tenant ID header name (default: 'X-Tenant-ID') */
|
|
66
|
+
tenantId?: string;
|
|
67
|
+
/** API Key header name (default: 'X-API-Key') */
|
|
68
|
+
apiKey?: string;
|
|
69
|
+
/** Platform header name (default: 'X-Platform') */
|
|
70
|
+
platform?: string;
|
|
71
|
+
/** Device ID header name (default: 'X-Device-ID') */
|
|
72
|
+
deviceId?: string;
|
|
73
|
+
/** Push token header name (default: 'X-Push-Token') */
|
|
74
|
+
pushToken?: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* API configuration
|
|
78
|
+
*/
|
|
79
|
+
export interface AppApiConfig {
|
|
80
|
+
/** SSR API key for internal SSR requests (matches backend X-SSR-Key) */
|
|
81
|
+
ssrKey?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Broadcasting configuration (matches Laravel's broadcasting.php structure)
|
|
85
|
+
*/
|
|
86
|
+
export interface BroadcastingConfig {
|
|
87
|
+
/** Pusher configuration (matches broadcasting.connections.pusher in Laravel) */
|
|
88
|
+
pusher?: {
|
|
89
|
+
/** Pusher app key */
|
|
90
|
+
key?: string;
|
|
91
|
+
/** Pusher app secret (not used on frontend) */
|
|
92
|
+
secret?: string;
|
|
93
|
+
/** Pusher app ID */
|
|
94
|
+
app_id?: string;
|
|
95
|
+
/** Pusher options */
|
|
96
|
+
options?: {
|
|
97
|
+
/** Pusher cluster (e.g., 'us2', 'eu', 'mt1') */
|
|
98
|
+
cluster?: string;
|
|
99
|
+
/** Pusher host */
|
|
100
|
+
host?: string;
|
|
101
|
+
/** Pusher port */
|
|
102
|
+
port?: number;
|
|
103
|
+
/** Pusher scheme ('http' or 'https') */
|
|
104
|
+
scheme?: string;
|
|
105
|
+
/** Whether to use encryption */
|
|
106
|
+
encrypted?: boolean;
|
|
107
|
+
/** Whether to use TLS */
|
|
108
|
+
useTLS?: boolean;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Session configuration (mirrors Laravel's session.php)
|
|
114
|
+
*/
|
|
115
|
+
export interface SessionConfig {
|
|
116
|
+
/** Session cookie name */
|
|
117
|
+
cookie?: string;
|
|
118
|
+
/** XSRF token cookie name */
|
|
119
|
+
xsrf_cookie?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* App configuration
|
|
123
|
+
*/
|
|
124
|
+
export interface AppConfig {
|
|
125
|
+
/**
|
|
126
|
+
* Application configuration
|
|
127
|
+
*/
|
|
128
|
+
app: {
|
|
129
|
+
/** Application name */
|
|
130
|
+
name: string;
|
|
131
|
+
/** Backend API URL (Laravel) */
|
|
132
|
+
url: string;
|
|
133
|
+
/** Application environment (local, development, staging, production) */
|
|
134
|
+
env?: string;
|
|
135
|
+
/** Debug mode enabled */
|
|
136
|
+
debug?: boolean;
|
|
137
|
+
/** Application timezone */
|
|
138
|
+
timezone?: string;
|
|
139
|
+
/** Application locale */
|
|
140
|
+
locale?: string;
|
|
141
|
+
/** Fallback locale */
|
|
142
|
+
fallback_locale?: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Frontend configuration
|
|
146
|
+
*/
|
|
147
|
+
frontend: {
|
|
148
|
+
/** Frontend app URL (Quasar) */
|
|
149
|
+
url: string;
|
|
150
|
+
/** Custom URL scheme for mobile/desktop apps (e.g., 'myapp://') */
|
|
151
|
+
custom_scheme?: string;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Assets configuration (dynamic CSS/JS injection)
|
|
155
|
+
*/
|
|
156
|
+
assets?: AppAssets;
|
|
157
|
+
/**
|
|
158
|
+
* Meta configuration (dynamic meta tags)
|
|
159
|
+
*/
|
|
160
|
+
meta?: AppMeta;
|
|
161
|
+
/**
|
|
162
|
+
* HTTP headers configuration
|
|
163
|
+
*/
|
|
164
|
+
headers?: HeadersConfig;
|
|
165
|
+
/**
|
|
166
|
+
* API configuration (for internal requests)
|
|
167
|
+
*/
|
|
168
|
+
api?: AppApiConfig;
|
|
169
|
+
/**
|
|
170
|
+
* Broadcasting configuration (WebSocket/Pusher)
|
|
171
|
+
*/
|
|
172
|
+
broadcasting?: BroadcastingConfig;
|
|
173
|
+
/**
|
|
174
|
+
* Session configuration (matches Laravel's session.php)
|
|
175
|
+
*/
|
|
176
|
+
session?: SessionConfig;
|
|
177
|
+
/**
|
|
178
|
+
* I18n cookie name for storing user's locale preference
|
|
179
|
+
* Defaults to 'user-locale' if not specified
|
|
180
|
+
*/
|
|
181
|
+
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
|
+
/**
|
|
193
|
+
* Trace information for request/response tracking
|
|
194
|
+
* Populated by SSRTraceService and tenant resolution hooks
|
|
195
|
+
*/
|
|
196
|
+
trace?: TraceInfo;
|
|
197
|
+
/**
|
|
198
|
+
* Allow additional config keys for extensibility
|
|
199
|
+
*/
|
|
200
|
+
[key: string]: any;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=app.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.types.d.ts","sourceRoot":"","sources":["../../src/types/app.types.ts"],"names":[],"mappings":"AAAA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IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../src/types/config.types.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AppConfig } from './app.types';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
__APP_CONFIG__: AppConfig | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Vite HMR API
|
|
10
|
+
*/
|
|
11
|
+
interface ImportMeta {
|
|
12
|
+
hot?: {
|
|
13
|
+
accept: (callback?: (mod: any) => void) => void;
|
|
14
|
+
dispose: (callback: (data: any) => void) => void;
|
|
15
|
+
decline: () => void;
|
|
16
|
+
invalidate: () => void;
|
|
17
|
+
on: (event: string, callback: (...args: any[]) => void) => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Extend axios request config to include metadata for timing
|
|
24
|
+
*/
|
|
25
|
+
declare module 'axios' {
|
|
26
|
+
export interface InternalAxiosRequestConfig {
|
|
27
|
+
metadata?: {
|
|
28
|
+
startTime: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I18n Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for internationalization
|
|
5
|
+
*/
|
|
6
|
+
import type { I18n } from 'vue-i18n';
|
|
7
|
+
/**
|
|
8
|
+
* Supported message languages
|
|
9
|
+
*/
|
|
10
|
+
export type MessageLanguages = 'en-US' | 'es-MX';
|
|
11
|
+
/**
|
|
12
|
+
* Message schema for translations
|
|
13
|
+
*/
|
|
14
|
+
export type MessageSchema = Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Shared type for Vue I18n configuration
|
|
17
|
+
*/
|
|
18
|
+
export type I18nType = I18n<{
|
|
19
|
+
messages: MessageSchema;
|
|
20
|
+
}, Record<string, unknown>, Record<string, unknown>, string, false>;
|
|
21
|
+
//# sourceMappingURL=i18n.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.types.d.ts","sourceRoot":"","sources":["../../src/types/i18n.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB;IAAE,QAAQ,EAAE,aAAa,CAAA;CAAE,EAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvB,MAAM,EACN,KAAK,CACN,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Laravel Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for Laravel API responses
|
|
5
|
+
*/
|
|
6
|
+
import type { AxiosError } from 'axios';
|
|
7
|
+
/**
|
|
8
|
+
* Generic error bag structure
|
|
9
|
+
* Always a Map<string, string> for predictability
|
|
10
|
+
*/
|
|
11
|
+
export type ErrorBag = Map<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Laravel error response structure
|
|
14
|
+
*/
|
|
15
|
+
export type LaravelErrorResponse = AxiosError<{
|
|
16
|
+
message?: string;
|
|
17
|
+
errors?: Record<string, string | string[]>;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Laravel pagination links
|
|
21
|
+
*/
|
|
22
|
+
export interface PaginationLinks {
|
|
23
|
+
first: string | null;
|
|
24
|
+
last: string | null;
|
|
25
|
+
prev: string | null;
|
|
26
|
+
next: string | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Laravel length-aware paginator metadata
|
|
30
|
+
*/
|
|
31
|
+
export interface LengthAwareMeta {
|
|
32
|
+
current_page: number;
|
|
33
|
+
from: number | null;
|
|
34
|
+
last_page: number;
|
|
35
|
+
links: Array<{
|
|
36
|
+
url: string | null;
|
|
37
|
+
label: string;
|
|
38
|
+
active: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
path: string;
|
|
41
|
+
per_page: number;
|
|
42
|
+
to: number | null;
|
|
43
|
+
total: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Laravel simple paginator metadata
|
|
47
|
+
*/
|
|
48
|
+
export interface SimpleMeta {
|
|
49
|
+
current_page: number;
|
|
50
|
+
from: number | null;
|
|
51
|
+
path: string;
|
|
52
|
+
per_page: number;
|
|
53
|
+
to: number | null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Laravel cursor paginator metadata
|
|
57
|
+
*/
|
|
58
|
+
export interface CursorMeta {
|
|
59
|
+
path: string;
|
|
60
|
+
per_page: number;
|
|
61
|
+
next_cursor: string | null;
|
|
62
|
+
prev_cursor: string | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Laravel length-aware paginator response
|
|
66
|
+
*/
|
|
67
|
+
export interface LengthAwarePaginatorResponse<T> {
|
|
68
|
+
data: T[];
|
|
69
|
+
meta: LengthAwareMeta;
|
|
70
|
+
links: PaginationLinks;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Laravel simple paginator response
|
|
74
|
+
*/
|
|
75
|
+
export interface SimplePaginatorResponse<T> {
|
|
76
|
+
data: T[];
|
|
77
|
+
meta: SimpleMeta;
|
|
78
|
+
links: PaginationLinks;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Laravel cursor paginator response
|
|
82
|
+
*/
|
|
83
|
+
export interface CursorPaginatorResponse<T> {
|
|
84
|
+
data: T[];
|
|
85
|
+
meta: CursorMeta;
|
|
86
|
+
links: PaginationLinks;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Interface defining the structure of a pagination request
|
|
90
|
+
*/
|
|
91
|
+
export interface PaginationRequest {
|
|
92
|
+
filter?: Record<string, string>;
|
|
93
|
+
sort?: string;
|
|
94
|
+
per_page?: number;
|
|
95
|
+
page?: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Base pagination state
|
|
99
|
+
*/
|
|
100
|
+
export interface BasePaginationState<Model> {
|
|
101
|
+
data: Model[];
|
|
102
|
+
isLoadingMore: boolean;
|
|
103
|
+
hasMore: boolean;
|
|
104
|
+
currentPage: number;
|
|
105
|
+
hasLoaded: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Length-aware pagination state
|
|
109
|
+
*/
|
|
110
|
+
export interface LengthAwareState<T> extends BasePaginationState<T> {
|
|
111
|
+
meta: LengthAwareMeta;
|
|
112
|
+
links: PaginationLinks;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Simple pagination state
|
|
116
|
+
*/
|
|
117
|
+
export interface SimpleState<T> extends BasePaginationState<T> {
|
|
118
|
+
meta: SimpleMeta;
|
|
119
|
+
links: PaginationLinks;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Cursor pagination state
|
|
123
|
+
*/
|
|
124
|
+
export interface CursorState<T> extends BasePaginationState<T> {
|
|
125
|
+
meta: CursorMeta;
|
|
126
|
+
links: PaginationLinks;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Union type for all pagination states
|
|
130
|
+
*/
|
|
131
|
+
export type PaginatedModuleState<T> = LengthAwareState<T> | SimpleState<T> | CursorState<T>;
|
|
132
|
+
/**
|
|
133
|
+
* Pagination action keys
|
|
134
|
+
*/
|
|
135
|
+
export type PaginationActionKeys<Prefix extends string> = `${Prefix}Fetch` | `${Prefix}Next` | `${Prefix}Previous` | `${Prefix}Reload`;
|
|
136
|
+
/**
|
|
137
|
+
* Pagination actions
|
|
138
|
+
*/
|
|
139
|
+
export type PaginationActions<Prefix extends string, State> = {
|
|
140
|
+
[K in PaginationActionKeys<Prefix>]: (this: StoreContext<Prefix, State>, ...args: K extends `${Prefix}Fetch` ? [options?: PaginationRequest, clearPrevious?: boolean] : []) => Promise<void>;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Store context with state key
|
|
144
|
+
*/
|
|
145
|
+
export type StoreContext<Prefix extends string, State> = {
|
|
146
|
+
[key in Prefix]: State;
|
|
147
|
+
} & PaginationActions<Prefix, State>;
|
|
148
|
+
/**
|
|
149
|
+
* Fetcher function type
|
|
150
|
+
*/
|
|
151
|
+
export type Fetcher<Prefix extends string, Response, State> = (this: StoreContext<Prefix, State>, options: PaginationRequest, clearPrevious?: boolean) => Promise<Response | false>;
|
|
152
|
+
/**
|
|
153
|
+
* Pagination options
|
|
154
|
+
*/
|
|
155
|
+
export interface PaginationOptions<Prefix extends string, Response, State> {
|
|
156
|
+
stateKey: Prefix;
|
|
157
|
+
fetcher: Fetcher<Prefix, Response, State>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Pagination getters
|
|
161
|
+
*/
|
|
162
|
+
export type PaginationGetters<Key extends string, Model, State extends PaginatedModuleState<Model>> = {
|
|
163
|
+
[K in `get${Capitalize<Key>}`]: (state: Record<Key, State>) => Model[];
|
|
164
|
+
} & {
|
|
165
|
+
[K in `has${Capitalize<Key>}`]: (state: Record<Key, State>) => boolean;
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=laravel.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
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MAAM,MAAM,OAAO,CAAC,MAAM,SAAS,MAAM,EAAE,QAAQ,EAAE,KAAK,IAAI,CAC5D,IAAI,EAAE,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,OAAO,EAAE,iBAAiB,EAC1B,aAAa,CAAC,EAAE,OAAO,KACpB,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,MAAM,SAAS,MAAM,EAAE,QAAQ,EAAE,KAAK;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAC3B,GAAG,SAAS,MAAM,EAClB,KAAK,EACL,KAAK,SAAS,oBAAoB,CAAC,KAAK,CAAC,IACvC;KACD,CAAC,IAAI,MAAM,UAAU,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,EAAE;CACvE,GAAG;KACD,CAAC,IAAI,MAAM,UAAU,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,OAAO;CACvE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log levels (RFC 5424 severity levels)
|
|
3
|
+
*/
|
|
4
|
+
export declare enum LogLevel {
|
|
5
|
+
EMERGENCY = "emergency",
|
|
6
|
+
ALERT = "alert",
|
|
7
|
+
CRITICAL = "critical",
|
|
8
|
+
ERROR = "error",
|
|
9
|
+
WARNING = "warning",
|
|
10
|
+
NOTICE = "notice",
|
|
11
|
+
INFO = "info",
|
|
12
|
+
DEBUG = "debug"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Logger implementation types
|
|
16
|
+
*/
|
|
17
|
+
export declare enum LoggerType {
|
|
18
|
+
CONSOLE = "console",
|
|
19
|
+
NULL = "null"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Trace information for request/response tracking
|
|
23
|
+
*/
|
|
24
|
+
export interface TraceInfo {
|
|
25
|
+
/** Unique trace ID */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Timestamp */
|
|
28
|
+
timestamp: string;
|
|
29
|
+
/** Environment (development, production, etc.) */
|
|
30
|
+
environment: string;
|
|
31
|
+
/** Tenant ID (null = no tenant available, undefined = not yet determined) */
|
|
32
|
+
tenant?: string | null;
|
|
33
|
+
/** Runtime context */
|
|
34
|
+
runtime: 'server' | 'client' | 'native';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Logger interface
|
|
38
|
+
*/
|
|
39
|
+
export interface LoggerInterface {
|
|
40
|
+
/**
|
|
41
|
+
* Gets the current trace info
|
|
42
|
+
*/
|
|
43
|
+
getTraceInfo(): TraceInfo;
|
|
44
|
+
/**
|
|
45
|
+
* System is unusable
|
|
46
|
+
*/
|
|
47
|
+
emergency(message: string, context?: Record<string, unknown>): void;
|
|
48
|
+
/**
|
|
49
|
+
* Action must be taken immediately
|
|
50
|
+
*/
|
|
51
|
+
alert(message: string, context?: Record<string, unknown>): void;
|
|
52
|
+
/**
|
|
53
|
+
* Critical conditions
|
|
54
|
+
*/
|
|
55
|
+
critical(message: string, context?: Record<string, unknown>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Runtime errors that do not require immediate action
|
|
58
|
+
*/
|
|
59
|
+
error(message: string, context?: Record<string, unknown>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Exceptional occurrences that are not errors
|
|
62
|
+
*/
|
|
63
|
+
warning(message: string, context?: Record<string, unknown>): void;
|
|
64
|
+
/**
|
|
65
|
+
* Normal but significant events
|
|
66
|
+
*/
|
|
67
|
+
notice(message: string, context?: Record<string, unknown>): void;
|
|
68
|
+
/**
|
|
69
|
+
* Interesting events
|
|
70
|
+
*/
|
|
71
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
72
|
+
/**
|
|
73
|
+
* Detailed debug information
|
|
74
|
+
*/
|
|
75
|
+
debug(message: string, context?: Record<string, unknown>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Logs with an arbitrary level
|
|
78
|
+
*/
|
|
79
|
+
log(level: string, message: string, context?: Record<string, unknown>): void;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=logging.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.types.d.ts","sourceRoot":"","sources":["../../src/types/logging.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,QAAQ;IAClB,SAAS,cAAc;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,sBAAsB;IACtB,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,IAAI,SAAS,CAAC;IAE1B;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEpE;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE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