@arex95/vue-core 1.0.7 → 1.0.9

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.
@@ -17,11 +17,11 @@ export declare function configureAuth(options: {
17
17
  refreshToken?: string;
18
18
  };
19
19
  }): void;
20
- export declare function useAuth(secretKey: string): {
20
+ export declare function useAuth(secretKey?: string): {
21
21
  jwt: import("vue").ComputedRef<string | null>;
22
22
  refresh_token: import("vue").ComputedRef<string | null>;
23
23
  tokenExpiry: import("vue").ComputedRef<number | null>;
24
- login: (params?: {}) => Promise<import("axios").AxiosResponse<any, any>>;
24
+ login: (params: {} | undefined, isRememberMe: boolean) => Promise<import("axios").AxiosResponse<any, any>>;
25
25
  refresh: () => Promise<import("axios").AxiosResponse<any, any> | undefined>;
26
26
  logout: (params?: {}) => Promise<void>;
27
27
  cleanStorage: () => Promise<void>;
@@ -0,0 +1,5 @@
1
+ export declare function useApiActivity(sessionTimeoutMin: number, checkIntervalSec: number): {
2
+ pause: import("@vueuse/shared").Fn;
3
+ resume: import("@vueuse/shared").Fn;
4
+ updateTimestamp: () => void;
5
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Hook para detectar la inactividad del usuario.
3
+ * @param timeout - Tiempo en milisegundos antes de considerar al usuario inactivo. Por defecto es 5 minutos.
4
+ * @param useDefaultEvents - Si se deben usar los eventos por defecto (mousemove, keydown, scroll, touchstart).
5
+ * @param customEvents - Lista personalizada de eventos para detectar actividad.
6
+ * @returns Un objeto con el estado de inactividad, funciones para controlar el temporizador y registrar callbacks.
7
+ */
8
+ export declare function useUserInactivity(timeout?: number, useDefaultEvents?: boolean, customEvents?: Array<keyof WindowEventMap>): {
9
+ isInactive: import("vue").Ref<boolean, boolean>;
10
+ startInactivityTimer: () => void;
11
+ stopInactivityTimer: () => void;
12
+ resetInactivityTimer: () => void;
13
+ onTimeout: (callback: () => void) => void;
14
+ removeTimeoutCallback: (callback: () => void) => void;
15
+ };
@@ -1,15 +1,27 @@
1
+ interface TokenConfig {
2
+ readonly ACCESS_TOKEN: string;
3
+ readonly REFRESH_TOKEN: string;
4
+ }
1
5
  /**
2
- * Función para configurar las claves globalmente.
3
- * Esta función congela el objeto para evitar modificaciones posteriores.
4
- * @param {string} accessTokenKey - Nombre de la clave del token de acceso
5
- * @param {string} refreshTokenKey - Nombre de la clave del refresh token
6
+ * Configura las claves globales para los tokens de acceso y refresh.
7
+ * Una vez establecidas, no pueden ser modificadas.
8
+ * @param accessTokenKey - Nombre de la clave del token de acceso.
9
+ * @param refreshTokenKey - Nombre de la clave del refresh token.
6
10
  */
7
- export declare function configureTokenKeys(accessTokenKey: string, refreshTokenKey: string): void;
11
+ export declare function setTokenConfig(accessTokenKey: string, refreshTokenKey: string): void;
8
12
  /**
9
- * Obtiene las claves configuradas para los tokens.
10
- * El objeto está congelado, por lo que no se puede modificar directamente.
13
+ * Obtiene la configuración actual de las claves de tokens.
14
+ * @returns Configuración de los tokens.
11
15
  */
12
- export declare function getTokenConfig(): {
13
- ACCESS_TOKEN: string;
14
- REFRESH_TOKEN: string;
15
- };
16
+ export declare function getTokenConfig(): TokenConfig;
17
+ /**
18
+ * Establece la clave secreta para su uso en autenticación.
19
+ * @param key - Nueva clave secreta.
20
+ */
21
+ export declare function setSecretKey(key: string): void;
22
+ /**
23
+ * Obtiene la clave secreta actual.
24
+ * @returns Clave secreta configurada.
25
+ */
26
+ export declare function getSecretKey(): string;
27
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Enum defining available screen sizes.
3
+ */
4
+ export declare enum ScreenSize {
5
+ XS = "XS",
6
+ SM = "SM",
7
+ MD = "MD",
8
+ LG = "LG",
9
+ XL = "XL",
10
+ XXL = "XXL"
11
+ }
12
+ /**
13
+ * Enum defining breakpoints for design based on screen width.
14
+ * Values are in pixels.
15
+ */
16
+ export declare enum ScreenBreakpoint {
17
+ XS = 480,
18
+ SM = 576,
19
+ MD = 768,
20
+ LG = 992,
21
+ XL = 1200,
22
+ XXL = 1600
23
+ }
24
+ /**
25
+ * Map that associates each screen size defined in `ScreenSize` with its corresponding pixel value from `ScreenBreakpoint`.
26
+ * @type {Map<ScreenSize, number>}
27
+ */
28
+ declare const screenMap: Map<ScreenSize, number>;
29
+ export { screenMap };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Enum representing different content types for HTTP headers.
3
+ * @readonly
4
+ */
5
+ export declare enum ContentTypeEnum {
6
+ /**
7
+ * Content type for JSON.
8
+ * @constant
9
+ */
10
+ JSON = "application/json;charset=UTF-8",
11
+ /**
12
+ * Content type for URL-encoded form data.
13
+ * @constant
14
+ */
15
+ FORM_URLENCODED = "application/x-www-form-urlencoded;charset=UTF-8",
16
+ /**
17
+ * Content type for multipart form data with file uploads.
18
+ * @constant
19
+ */
20
+ FORM_DATA = "multipart/form-data;charset=UTF-8",
21
+ /**
22
+ * Content type for plain text.
23
+ * @constant
24
+ */
25
+ TEXT_PLAIN = "text/plain;charset=UTF-8",
26
+ /**
27
+ * Content type for XML data.
28
+ * @constant
29
+ */
30
+ XML = "application/xml;charset=UTF-8",
31
+ /**
32
+ * Content type for HTML data.
33
+ * @constant
34
+ */
35
+ HTML = "text/html;charset=UTF-8",
36
+ /**
37
+ * Content type for JavaScript files.
38
+ * @constant
39
+ */
40
+ JS = "application/javascript;charset=UTF-8",
41
+ /**
42
+ * Content type for CSV files.
43
+ * @constant
44
+ */
45
+ CSV = "text/csv;charset=UTF-8",
46
+ /**
47
+ * Content type for PDF files.
48
+ * @constant
49
+ */
50
+ PDF = "application/pdf",
51
+ /**
52
+ * Content type for octet-stream (binary data).
53
+ * @constant
54
+ */
55
+ OCTET_STREAM = "application/octet-stream"
56
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Enum representing different types of errors.
3
+ * @readonly
4
+ */
5
+ export declare enum ErrorEnum {
6
+ WARNING = "warning",
7
+ ERROR = "error",
8
+ CRITICAL = "critical",
9
+ VALIDATION = "validation",
10
+ COMPONENT = "component",
11
+ NETWORK = "network",
12
+ AUTHENTICATION = "authentication",
13
+ RUNTIME = "runtime",
14
+ TYPE = "type",
15
+ REFERENCE = "reference",
16
+ SYNTAX = "syntax",
17
+ RANGE = "range",
18
+ EVAL = "eval",
19
+ URI = "uri"
20
+ }
21
+ /**
22
+ * Enum representing different error messages.
23
+ * @readonly
24
+ */
25
+ export declare enum ErrorMessages {
26
+ WARNING = "Algo no est\u00E1 del todo bien. Verifica y vuelve a intentar.",
27
+ ERROR = "Ocurri\u00F3 un error inesperado.",
28
+ CRITICAL = "Error cr\u00EDtico. Contacta al soporte t\u00E9cnico.",
29
+ VALIDATION = "Hay errores en el formulario. Revisa los campos.",
30
+ COMPONENT = "Error en la carga del componente. Intenta recargar.",
31
+ NETWORK = "Problema de conexi\u00F3n. Verifica tu internet.",
32
+ AUTHENTICATION = "No tienes permisos para realizar esta acci\u00F3n.",
33
+ RUNTIME = "Error de ejecuci\u00F3n. Intenta nuevamente.",
34
+ TYPE = "Tipo de error no identificado.",
35
+ REFERENCE = "Referencia no v\u00E1lida.",
36
+ SYNTAX = "Error de sintaxis en el c\u00F3digo.",
37
+ RANGE = "Error en el rango de valores.",
38
+ EVAL = "Error en la evaluaci\u00F3n.",
39
+ URI = "URI no v\u00E1lida."
40
+ }
41
+ /**
42
+ * Enum representing different error styles.
43
+ * @readonly
44
+ */
45
+ export declare enum ErrorStyles {
46
+ WARNING = "color: orange; font-weight: bold;",
47
+ ERROR = "color: red; font-weight: bold;",
48
+ CRITICAL = "color: white; background-color: red; font-weight: bold; padding: 2px;",
49
+ VALIDATION = "color: blue; font-weight: bold;",
50
+ COMPONENT = "color: purple; font-weight: bold;",
51
+ NETWORK = "color: cyan; font-weight: bold;",
52
+ AUTHENTICATION = "color: brown; font-weight: bold;",
53
+ RUNTIME = "color: darkred; font-weight: bold;",
54
+ TYPE = "color: gray; font-weight: bold;",
55
+ REFERENCE = "color: darkorange; font-weight: bold;",
56
+ SYNTAX = "color: darkblue; font-weight: bold;",
57
+ RANGE = "color: darkgreen; font-weight: bold;",
58
+ EVAL = "color: darkviolet; font-weight: bold;",
59
+ URI = "color: darkcyan; font-weight: bold;"
60
+ }
61
+ /**
62
+ * A record mapping ErrorEnum to their corresponding error messages.
63
+ */
64
+ export declare const ERROR_MESSAGES: Record<ErrorEnum, string>;
65
+ /**
66
+ * A record mapping ErrorEnum to their corresponding error styles.
67
+ */
68
+ export declare const ERROR_STYLES: Record<ErrorEnum, string>;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Enum representing various MIME types for different file categories.
3
+ * @readonly
4
+ */
5
+ export declare enum ImageTypes {
6
+ APNG = "image/apng",
7
+ BMP = "image/bmp",
8
+ GIF = "image/gif",
9
+ JPEG = "image/jpeg",
10
+ PJPEG = "image/pjpeg",
11
+ PNG = "image/png",
12
+ SVG = "image/svg+xml",
13
+ TIFF = "image/tiff",
14
+ WEBP = "image/webp",
15
+ XICON = "image/x-icon"
16
+ }
17
+ export declare enum AudioTypes {
18
+ Audios = "audio/*"
19
+ }
20
+ export declare enum VideoTypes {
21
+ Videos = "video/*"
22
+ }
23
+ export declare enum TextTypes {
24
+ PlainText = "text/plain",
25
+ HTML = "text/html",
26
+ CSS = "text/css",
27
+ JavaScript = "application/javascript",
28
+ CSV = "text/csv",
29
+ JSON = "application/json",
30
+ XML = "application/xml"
31
+ }
32
+ export declare enum DocumentTypes {
33
+ PDF = "application/pdf",
34
+ Word = "application/msword",
35
+ WordOpenXML = "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
36
+ Excel = "application/vnd.ms-excel",
37
+ ExcelOpenXML = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
38
+ PowerPoint = "application/vnd.ms-powerpoint",
39
+ PowerPointOpenXML = "application/vnd.openxmlformats-officedocument.presentationml.presentation"
40
+ }
41
+ export declare enum ArchiveTypes {
42
+ ZIP = "application/zip",
43
+ GZIP = "application/gzip",
44
+ TAR = "application/x-tar",
45
+ RAR = "application/x-rar-compressed"
46
+ }
47
+ export declare enum FontTypes {
48
+ TrueType = "font/ttf",
49
+ OpenType = "font/otf",
50
+ WebOpenFont = "font/woff",
51
+ WebOpenFont2 = "font/woff2"
52
+ }
53
+ export declare enum AppTypes {
54
+ Executable = "application/octet-stream",
55
+ AndroidAPK = "application/vnd.android.package-archive",
56
+ Java = "application/java-archive"
57
+ }
58
+ export declare enum OtherTypes {
59
+ JSONLD = "application/ld+json",
60
+ WASM = "application/wasm"
61
+ }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Enum representing all HTTP exception codes.
3
+ * @readonly
4
+ */
5
+ export declare enum ExceptionEnum {
6
+ CONTINUE = 100,
7
+ SWITCHING_PROTOCOLS = 101,
8
+ PROCESSING = 102,
9
+ EARLY_HINTS = 103,
10
+ OK = 200,
11
+ CREATED = 201,
12
+ ACCEPTED = 202,
13
+ NON_AUTHORITATIVE_INFORMATION = 203,
14
+ NO_CONTENT = 204,
15
+ RESET_CONTENT = 205,
16
+ PARTIAL_CONTENT = 206,
17
+ MULTI_STATUS = 207,
18
+ ALREADY_REPORTED = 208,
19
+ IM_USED = 226,
20
+ MULTIPLE_CHOICES = 300,
21
+ MOVED_PERMANENTLY = 301,
22
+ FOUND = 302,
23
+ SEE_OTHER = 303,
24
+ NOT_MODIFIED = 304,
25
+ USE_PROXY = 305,
26
+ UNUSED = 306,// Deprecated
27
+ TEMPORARY_REDIRECT = 307,
28
+ PERMANENT_REDIRECT = 308,
29
+ BAD_REQUEST = 400,
30
+ UNAUTHORIZED = 401,
31
+ PAYMENT_REQUIRED = 402,
32
+ FORBIDDEN = 403,
33
+ NOT_FOUND = 404,
34
+ METHOD_NOT_ALLOWED = 405,
35
+ NOT_ACCEPTABLE = 406,
36
+ PROXY_AUTHENTICATION_REQUIRED = 407,
37
+ REQUEST_TIMEOUT = 408,
38
+ CONFLICT = 409,
39
+ GONE = 410,
40
+ LENGTH_REQUIRED = 411,
41
+ PRECONDITION_FAILED = 412,
42
+ PAYLOAD_TOO_LARGE = 413,
43
+ URI_TOO_LONG = 414,
44
+ UNSUPPORTED_MEDIA_TYPE = 415,
45
+ RANGE_NOT_SATISFIABLE = 416,
46
+ EXPECTATION_FAILED = 417,
47
+ IM_A_TEAPOT = 418,// RFC 2324 - Easter egg
48
+ MISDIRECTED_REQUEST = 421,
49
+ UNPROCESSABLE_ENTITY = 422,
50
+ LOCKED = 423,
51
+ FAILED_DEPENDENCY = 424,
52
+ TOO_EARLY = 425,
53
+ UPGRADE_REQUIRED = 426,
54
+ PRECONDITION_REQUIRED = 428,
55
+ TOO_MANY_REQUESTS = 429,
56
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
57
+ UNAVAILABLE_FOR_LEGAL_REASONS = 451,
58
+ INTERNAL_SERVER_ERROR = 500,
59
+ NOT_IMPLEMENTED = 501,
60
+ BAD_GATEWAY = 502,
61
+ SERVICE_UNAVAILABLE = 503,
62
+ GATEWAY_TIMEOUT = 504,
63
+ HTTP_VERSION_NOT_SUPPORTED = 505,
64
+ VARIANT_ALSO_NEGOTIATES = 506,
65
+ INSUFFICIENT_STORAGE = 507,
66
+ LOOP_DETECTED = 508,
67
+ NOT_EXTENDED = 510,
68
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
69
+ NET_WORK_ERROR = 10000,// Custom network error
70
+ PAGE_NOT_DATA = 10100
71
+ }
@@ -0,0 +1,7 @@
1
+ export * from './breakpointsEnums';
2
+ export * from './httpExceptionsEnums';
3
+ export * from './fileTypesEnums';
4
+ export * from './contentTypesEnums';
5
+ export * from './keyCodesEnums';
6
+ export * from './storageEnums';
7
+ export * from './errorsEnums';
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Enum for key codes used in keyboard events.
3
+ * This object holds various key codes commonly used for handling keyboard events.
4
+ * The keys defined here correspond to specific key codes that can be used to detect
5
+ * user input in web applications.
6
+ * @readonly
7
+ * @enum {number}
8
+ */
9
+ export declare enum KeyCodeEnum {
10
+ /** Arrow Up key */
11
+ UP = 38,
12
+ /** Arrow Down key */
13
+ DOWN = 40,
14
+ /** Enter key */
15
+ ENTER = 13,
16
+ /** Escape key */
17
+ ESC = 27,
18
+ /** Spacebar key */
19
+ SPACE = 32,
20
+ /** Tab key */
21
+ TAB = 9,
22
+ /** Backspace key */
23
+ BACKSPACE = 8,
24
+ /** Delete key */
25
+ DELETE = 46,
26
+ /** Arrow Left key */
27
+ LEFT = 37,
28
+ /** Arrow Right key */
29
+ RIGHT = 39,
30
+ /** Shift key */
31
+ SHIFT = 16,
32
+ /** Control key */
33
+ CONTROL = 17,
34
+ /** Alt key */
35
+ ALT = 18,
36
+ /** Caps Lock key */
37
+ CAPS_LOCK = 20,
38
+ /** F1 key */
39
+ F1 = 112,
40
+ /** F2 key */
41
+ F2 = 113,
42
+ /** F3 key */
43
+ F3 = 114,
44
+ /** F4 key */
45
+ F4 = 115,
46
+ /** F5 key */
47
+ F5 = 116,
48
+ /** F6 key */
49
+ F6 = 117,
50
+ /** F7 key */
51
+ F7 = 118,
52
+ /** F8 key */
53
+ F8 = 119,
54
+ /** F9 key */
55
+ F9 = 120,
56
+ /** F10 key */
57
+ F10 = 121,
58
+ /** F11 key */
59
+ F11 = 122,
60
+ /** F12 key */
61
+ F12 = 123
62
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Enum for different storage keys used in the application.
3
+ * This enum contains the keys for storing authentication token, locale information, user info, roles, and more.
4
+ * @readonly
5
+ * @enum {string}
6
+ */
7
+ export declare enum StorageKeyEnum {
8
+ /**
9
+ * Key used for storing the authentication token.
10
+ * @constant {string}
11
+ */
12
+ TOKEN_KEY = "TOKEN__",
13
+ /**
14
+ * Key used for storing the locale information.
15
+ * @constant {string}
16
+ */
17
+ LOCALE_KEY = "LOCALE__",
18
+ /**
19
+ * Key used for storing user information.
20
+ * @constant {string}
21
+ */
22
+ USER_INFO_KEY = "USER__INFO__",
23
+ /**
24
+ * Key used for storing role information.
25
+ * @constant {string}
26
+ */
27
+ ROLES_KEY = "ROLES__KEY__",
28
+ /**
29
+ * Key used for storing project configuration.
30
+ * @constant {string}
31
+ */
32
+ PROJ_CFG_KEY = "PROJ__CFG__KEY__",
33
+ /**
34
+ * Key used for storing lock information.
35
+ * @constant {string}
36
+ */
37
+ LOCK_INFO_KEY = "LOCK__INFO__KEY__",
38
+ /**
39
+ * Key used for base global local cache.
40
+ * @constant {string}
41
+ */
42
+ APP_LOCAL_CACHE_KEY = "COMMON__LOCAL__KEY",
43
+ /**
44
+ * Key used for base global session cache.
45
+ * @constant {string}
46
+ */
47
+ APP_SESSION_CACHE_KEY = "COMMON__SESSION__KEY"
48
+ }
49
+ /**
50
+ * Enum defining types of storage.
51
+ * @readonly
52
+ * @enum {number}
53
+ */
54
+ export declare const StorageTypeEnum: {
55
+ /**
56
+ * Represents session storage.
57
+ * @constant {number}
58
+ */
59
+ readonly SESSION: 0;
60
+ /**
61
+ * Represents local storage.
62
+ * @constant {number}
63
+ */
64
+ readonly LOCAL: 1;
65
+ };
66
+ export type StorageTypeEnum = keyof typeof StorageTypeEnum;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from './rest';
2
2
  export * from './composables';
3
3
  export * from './config';
4
- export * from './constants';
4
+ export * from './enums';
5
5
  export * from './types';
6
6
  export * from './utils';
package/dist/index.mjs CHANGED
@@ -1667,214 +1667,481 @@ function isValidHexNumber(hex) {
1667
1667
  // console.log(isValidHexNumber('GHIJ')); // false
1668
1668
 
1669
1669
  /**
1670
- * Object defining available screen sizes as constants.
1671
- * @readonly
1670
+ * Enum defining available screen sizes.
1671
+ */
1672
+ var ScreenSize;
1673
+ (function (ScreenSize) {
1674
+ ScreenSize["XS"] = "XS";
1675
+ ScreenSize["SM"] = "SM";
1676
+ ScreenSize["MD"] = "MD";
1677
+ ScreenSize["LG"] = "LG";
1678
+ ScreenSize["XL"] = "XL";
1679
+ ScreenSize["XXL"] = "XXL";
1680
+ })(ScreenSize || (ScreenSize = {}));
1681
+ /**
1682
+ * Enum defining breakpoints for design based on screen width.
1683
+ * Values are in pixels.
1672
1684
  */
1673
- const sizeEnum = {
1674
- XS: 'XS',
1675
- SM: 'SM',
1676
- MD: 'MD',
1677
- LG: 'LG',
1678
- XL: 'XL',
1679
- XXL: 'XXL',
1680
- };
1685
+ var ScreenBreakpoint;
1686
+ (function (ScreenBreakpoint) {
1687
+ ScreenBreakpoint[ScreenBreakpoint["XS"] = 480] = "XS";
1688
+ ScreenBreakpoint[ScreenBreakpoint["SM"] = 576] = "SM";
1689
+ ScreenBreakpoint[ScreenBreakpoint["MD"] = 768] = "MD";
1690
+ ScreenBreakpoint[ScreenBreakpoint["LG"] = 992] = "LG";
1691
+ ScreenBreakpoint[ScreenBreakpoint["XL"] = 1200] = "XL";
1692
+ ScreenBreakpoint[ScreenBreakpoint["XXL"] = 1600] = "XXL";
1693
+ })(ScreenBreakpoint || (ScreenBreakpoint = {}));
1681
1694
  /**
1682
- * Object defining breakpoints for design based on screen width.
1683
- * Values are in pixels.
1695
+ * Map that associates each screen size defined in `ScreenSize` with its corresponding pixel value from `ScreenBreakpoint`.
1696
+ * @type {Map<ScreenSize, number>}
1697
+ */
1698
+ const screenMap = new Map();
1699
+ screenMap.set(ScreenSize.XS, ScreenBreakpoint.XS);
1700
+ screenMap.set(ScreenSize.SM, ScreenBreakpoint.SM);
1701
+ screenMap.set(ScreenSize.MD, ScreenBreakpoint.MD);
1702
+ screenMap.set(ScreenSize.LG, ScreenBreakpoint.LG);
1703
+ screenMap.set(ScreenSize.XL, ScreenBreakpoint.XL);
1704
+ screenMap.set(ScreenSize.XXL, ScreenBreakpoint.XXL);
1705
+
1706
+ /**
1707
+ * Enum representing all HTTP exception codes.
1684
1708
  * @readonly
1685
1709
  */
1686
- const screenEnum = {
1687
- XS: 480,
1688
- SM: 576,
1689
- MD: 768,
1690
- LG: 992,
1691
- XL: 1200,
1692
- XXL: 1600,
1693
- };
1710
+ var ExceptionEnum;
1711
+ (function (ExceptionEnum) {
1712
+ // 1xx - Informational
1713
+ ExceptionEnum[ExceptionEnum["CONTINUE"] = 100] = "CONTINUE";
1714
+ ExceptionEnum[ExceptionEnum["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
1715
+ ExceptionEnum[ExceptionEnum["PROCESSING"] = 102] = "PROCESSING";
1716
+ ExceptionEnum[ExceptionEnum["EARLY_HINTS"] = 103] = "EARLY_HINTS";
1717
+ // 2xx - Success
1718
+ ExceptionEnum[ExceptionEnum["OK"] = 200] = "OK";
1719
+ ExceptionEnum[ExceptionEnum["CREATED"] = 201] = "CREATED";
1720
+ ExceptionEnum[ExceptionEnum["ACCEPTED"] = 202] = "ACCEPTED";
1721
+ ExceptionEnum[ExceptionEnum["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
1722
+ ExceptionEnum[ExceptionEnum["NO_CONTENT"] = 204] = "NO_CONTENT";
1723
+ ExceptionEnum[ExceptionEnum["RESET_CONTENT"] = 205] = "RESET_CONTENT";
1724
+ ExceptionEnum[ExceptionEnum["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
1725
+ ExceptionEnum[ExceptionEnum["MULTI_STATUS"] = 207] = "MULTI_STATUS";
1726
+ ExceptionEnum[ExceptionEnum["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
1727
+ ExceptionEnum[ExceptionEnum["IM_USED"] = 226] = "IM_USED";
1728
+ // 3xx - Redirection
1729
+ ExceptionEnum[ExceptionEnum["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
1730
+ ExceptionEnum[ExceptionEnum["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
1731
+ ExceptionEnum[ExceptionEnum["FOUND"] = 302] = "FOUND";
1732
+ ExceptionEnum[ExceptionEnum["SEE_OTHER"] = 303] = "SEE_OTHER";
1733
+ ExceptionEnum[ExceptionEnum["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
1734
+ ExceptionEnum[ExceptionEnum["USE_PROXY"] = 305] = "USE_PROXY";
1735
+ ExceptionEnum[ExceptionEnum["UNUSED"] = 306] = "UNUSED";
1736
+ ExceptionEnum[ExceptionEnum["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
1737
+ ExceptionEnum[ExceptionEnum["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
1738
+ // 4xx - Client Errors
1739
+ ExceptionEnum[ExceptionEnum["BAD_REQUEST"] = 400] = "BAD_REQUEST";
1740
+ ExceptionEnum[ExceptionEnum["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
1741
+ ExceptionEnum[ExceptionEnum["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
1742
+ ExceptionEnum[ExceptionEnum["FORBIDDEN"] = 403] = "FORBIDDEN";
1743
+ ExceptionEnum[ExceptionEnum["NOT_FOUND"] = 404] = "NOT_FOUND";
1744
+ ExceptionEnum[ExceptionEnum["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
1745
+ ExceptionEnum[ExceptionEnum["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
1746
+ ExceptionEnum[ExceptionEnum["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
1747
+ ExceptionEnum[ExceptionEnum["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
1748
+ ExceptionEnum[ExceptionEnum["CONFLICT"] = 409] = "CONFLICT";
1749
+ ExceptionEnum[ExceptionEnum["GONE"] = 410] = "GONE";
1750
+ ExceptionEnum[ExceptionEnum["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
1751
+ ExceptionEnum[ExceptionEnum["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
1752
+ ExceptionEnum[ExceptionEnum["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
1753
+ ExceptionEnum[ExceptionEnum["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
1754
+ ExceptionEnum[ExceptionEnum["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
1755
+ ExceptionEnum[ExceptionEnum["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
1756
+ ExceptionEnum[ExceptionEnum["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
1757
+ ExceptionEnum[ExceptionEnum["IM_A_TEAPOT"] = 418] = "IM_A_TEAPOT";
1758
+ ExceptionEnum[ExceptionEnum["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
1759
+ ExceptionEnum[ExceptionEnum["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
1760
+ ExceptionEnum[ExceptionEnum["LOCKED"] = 423] = "LOCKED";
1761
+ ExceptionEnum[ExceptionEnum["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
1762
+ ExceptionEnum[ExceptionEnum["TOO_EARLY"] = 425] = "TOO_EARLY";
1763
+ ExceptionEnum[ExceptionEnum["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
1764
+ ExceptionEnum[ExceptionEnum["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
1765
+ ExceptionEnum[ExceptionEnum["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
1766
+ ExceptionEnum[ExceptionEnum["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
1767
+ ExceptionEnum[ExceptionEnum["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
1768
+ // 5xx - Server Errors
1769
+ ExceptionEnum[ExceptionEnum["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
1770
+ ExceptionEnum[ExceptionEnum["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
1771
+ ExceptionEnum[ExceptionEnum["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
1772
+ ExceptionEnum[ExceptionEnum["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
1773
+ ExceptionEnum[ExceptionEnum["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
1774
+ ExceptionEnum[ExceptionEnum["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
1775
+ ExceptionEnum[ExceptionEnum["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
1776
+ ExceptionEnum[ExceptionEnum["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
1777
+ ExceptionEnum[ExceptionEnum["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
1778
+ ExceptionEnum[ExceptionEnum["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
1779
+ ExceptionEnum[ExceptionEnum["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
1780
+ // Custom Error Codes
1781
+ ExceptionEnum[ExceptionEnum["NET_WORK_ERROR"] = 10000] = "NET_WORK_ERROR";
1782
+ ExceptionEnum[ExceptionEnum["PAGE_NOT_DATA"] = 10100] = "PAGE_NOT_DATA";
1783
+ })(ExceptionEnum || (ExceptionEnum = {}));
1784
+
1694
1785
  /**
1695
- * Map that associates each screen size defined in `sizeEnum` with its corresponding pixel value from `screenEnum`.
1696
- * @type {Map<typeof sizeEnum[keyof typeof sizeEnum], number>}
1786
+ * Enum representing various MIME types for different file categories.
1787
+ * @readonly
1697
1788
  */
1698
- const screenMap = new Map();
1699
- screenMap.set(sizeEnum.XS, screenEnum.XS);
1700
- screenMap.set(sizeEnum.SM, screenEnum.SM);
1701
- screenMap.set(sizeEnum.MD, screenEnum.MD);
1702
- screenMap.set(sizeEnum.LG, screenEnum.LG);
1703
- screenMap.set(sizeEnum.XL, screenEnum.XL);
1704
- screenMap.set(sizeEnum.XXL, screenEnum.XXL);
1789
+ var ImageTypes;
1790
+ (function (ImageTypes) {
1791
+ ImageTypes["APNG"] = "image/apng";
1792
+ ImageTypes["BMP"] = "image/bmp";
1793
+ ImageTypes["GIF"] = "image/gif";
1794
+ ImageTypes["JPEG"] = "image/jpeg";
1795
+ ImageTypes["PJPEG"] = "image/pjpeg";
1796
+ ImageTypes["PNG"] = "image/png";
1797
+ ImageTypes["SVG"] = "image/svg+xml";
1798
+ ImageTypes["TIFF"] = "image/tiff";
1799
+ ImageTypes["WEBP"] = "image/webp";
1800
+ ImageTypes["XICON"] = "image/x-icon";
1801
+ })(ImageTypes || (ImageTypes = {}));
1802
+ var AudioTypes;
1803
+ (function (AudioTypes) {
1804
+ AudioTypes["Audios"] = "audio/*";
1805
+ })(AudioTypes || (AudioTypes = {}));
1806
+ var VideoTypes;
1807
+ (function (VideoTypes) {
1808
+ VideoTypes["Videos"] = "video/*";
1809
+ })(VideoTypes || (VideoTypes = {}));
1810
+ var TextTypes;
1811
+ (function (TextTypes) {
1812
+ TextTypes["PlainText"] = "text/plain";
1813
+ TextTypes["HTML"] = "text/html";
1814
+ TextTypes["CSS"] = "text/css";
1815
+ TextTypes["JavaScript"] = "application/javascript";
1816
+ TextTypes["CSV"] = "text/csv";
1817
+ TextTypes["JSON"] = "application/json";
1818
+ TextTypes["XML"] = "application/xml";
1819
+ })(TextTypes || (TextTypes = {}));
1820
+ var DocumentTypes;
1821
+ (function (DocumentTypes) {
1822
+ DocumentTypes["PDF"] = "application/pdf";
1823
+ DocumentTypes["Word"] = "application/msword";
1824
+ DocumentTypes["WordOpenXML"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
1825
+ DocumentTypes["Excel"] = "application/vnd.ms-excel";
1826
+ DocumentTypes["ExcelOpenXML"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
1827
+ DocumentTypes["PowerPoint"] = "application/vnd.ms-powerpoint";
1828
+ DocumentTypes["PowerPointOpenXML"] = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
1829
+ })(DocumentTypes || (DocumentTypes = {}));
1830
+ var ArchiveTypes;
1831
+ (function (ArchiveTypes) {
1832
+ ArchiveTypes["ZIP"] = "application/zip";
1833
+ ArchiveTypes["GZIP"] = "application/gzip";
1834
+ ArchiveTypes["TAR"] = "application/x-tar";
1835
+ ArchiveTypes["RAR"] = "application/x-rar-compressed";
1836
+ })(ArchiveTypes || (ArchiveTypes = {}));
1837
+ var FontTypes;
1838
+ (function (FontTypes) {
1839
+ FontTypes["TrueType"] = "font/ttf";
1840
+ FontTypes["OpenType"] = "font/otf";
1841
+ FontTypes["WebOpenFont"] = "font/woff";
1842
+ FontTypes["WebOpenFont2"] = "font/woff2";
1843
+ })(FontTypes || (FontTypes = {}));
1844
+ var AppTypes;
1845
+ (function (AppTypes) {
1846
+ AppTypes["Executable"] = "application/octet-stream";
1847
+ AppTypes["AndroidAPK"] = "application/vnd.android.package-archive";
1848
+ AppTypes["Java"] = "application/java-archive";
1849
+ })(AppTypes || (AppTypes = {}));
1850
+ var OtherTypes;
1851
+ (function (OtherTypes) {
1852
+ OtherTypes["JSONLD"] = "application/ld+json";
1853
+ OtherTypes["WASM"] = "application/wasm";
1854
+ })(OtherTypes || (OtherTypes = {}));
1705
1855
 
1706
1856
  /**
1707
- * Object defining various exception codes.
1857
+ * Enum representing different content types for HTTP headers.
1708
1858
  * @readonly
1709
1859
  */
1710
- const ExceptionEnum = {
1860
+ var ContentTypeEnum;
1861
+ (function (ContentTypeEnum) {
1711
1862
  /**
1712
- * HTTP status code for page access forbidden.
1863
+ * Content type for JSON.
1864
+ * @constant
1713
1865
  */
1714
- PAGE_NOT_ACCESS: 403,
1866
+ ContentTypeEnum["JSON"] = "application/json;charset=UTF-8";
1715
1867
  /**
1716
- * HTTP status code for page not found.
1868
+ * Content type for URL-encoded form data.
1869
+ * @constant
1717
1870
  */
1718
- PAGE_NOT_FOUND: 404,
1871
+ ContentTypeEnum["FORM_URLENCODED"] = "application/x-www-form-urlencoded;charset=UTF-8";
1719
1872
  /**
1720
- * HTTP status code for general server error.
1873
+ * Content type for multipart form data with file uploads.
1874
+ * @constant
1721
1875
  */
1722
- ERROR: 500,
1876
+ ContentTypeEnum["FORM_DATA"] = "multipart/form-data;charset=UTF-8";
1723
1877
  /**
1724
- * HTTP status code for bad request.
1878
+ * Content type for plain text.
1879
+ * @constant
1725
1880
  */
1726
- BAD_REQUEST: 406,
1881
+ ContentTypeEnum["TEXT_PLAIN"] = "text/plain;charset=UTF-8";
1727
1882
  /**
1728
- * Custom error code for network errors.
1883
+ * Content type for XML data.
1884
+ * @constant
1729
1885
  */
1730
- NET_WORK_ERROR: 10000,
1886
+ ContentTypeEnum["XML"] = "application/xml;charset=UTF-8";
1731
1887
  /**
1732
- * Custom code indicating no data on the page, not actually an exception page.
1888
+ * Content type for HTML data.
1889
+ * @constant
1733
1890
  */
1734
- PAGE_NOT_DATA: 10100,
1735
- };
1891
+ ContentTypeEnum["HTML"] = "text/html;charset=UTF-8";
1892
+ /**
1893
+ * Content type for JavaScript files.
1894
+ * @constant
1895
+ */
1896
+ ContentTypeEnum["JS"] = "application/javascript;charset=UTF-8";
1897
+ /**
1898
+ * Content type for CSV files.
1899
+ * @constant
1900
+ */
1901
+ ContentTypeEnum["CSV"] = "text/csv;charset=UTF-8";
1902
+ /**
1903
+ * Content type for PDF files.
1904
+ * @constant
1905
+ */
1906
+ ContentTypeEnum["PDF"] = "application/pdf";
1907
+ /**
1908
+ * Content type for octet-stream (binary data).
1909
+ * @constant
1910
+ */
1911
+ ContentTypeEnum["OCTET_STREAM"] = "application/octet-stream";
1912
+ })(ContentTypeEnum || (ContentTypeEnum = {}));
1736
1913
 
1737
1914
  /**
1738
- * Object defining various image MIME types.
1739
- * @readonly
1740
- */
1741
- const ImageTypes = {
1742
- apng: 'image/apng',
1743
- bmp: 'image/bmp',
1744
- gif: 'image/gif',
1745
- jpeg: 'image/jpeg',
1746
- pjpeg: 'image/pjpeg',
1747
- png: 'image/png',
1748
- svg: 'image/svg+xml',
1749
- tiff: 'image/tiff',
1750
- webp: 'image/webp',
1751
- xicon: 'image/x-icon',
1752
- };
1753
- /**
1754
- * Object defining various file meta types.
1915
+ * Enum for key codes used in keyboard events.
1916
+ * This object holds various key codes commonly used for handling keyboard events.
1917
+ * The keys defined here correspond to specific key codes that can be used to detect
1918
+ * user input in web applications.
1755
1919
  * @readonly
1756
- */
1757
- const FileMetaTypes = {
1758
- images: 'image/*',
1759
- audios: 'audio/*',
1760
- videos: 'video/*',
1761
- };
1920
+ * @enum {number}
1921
+ */
1922
+ var KeyCodeEnum;
1923
+ (function (KeyCodeEnum) {
1924
+ /** Arrow Up key */
1925
+ KeyCodeEnum[KeyCodeEnum["UP"] = 38] = "UP";
1926
+ /** Arrow Down key */
1927
+ KeyCodeEnum[KeyCodeEnum["DOWN"] = 40] = "DOWN";
1928
+ /** Enter key */
1929
+ KeyCodeEnum[KeyCodeEnum["ENTER"] = 13] = "ENTER";
1930
+ /** Escape key */
1931
+ KeyCodeEnum[KeyCodeEnum["ESC"] = 27] = "ESC";
1932
+ /** Spacebar key */
1933
+ KeyCodeEnum[KeyCodeEnum["SPACE"] = 32] = "SPACE";
1934
+ /** Tab key */
1935
+ KeyCodeEnum[KeyCodeEnum["TAB"] = 9] = "TAB";
1936
+ /** Backspace key */
1937
+ KeyCodeEnum[KeyCodeEnum["BACKSPACE"] = 8] = "BACKSPACE";
1938
+ /** Delete key */
1939
+ KeyCodeEnum[KeyCodeEnum["DELETE"] = 46] = "DELETE";
1940
+ /** Arrow Left key */
1941
+ KeyCodeEnum[KeyCodeEnum["LEFT"] = 37] = "LEFT";
1942
+ /** Arrow Right key */
1943
+ KeyCodeEnum[KeyCodeEnum["RIGHT"] = 39] = "RIGHT";
1944
+ /** Shift key */
1945
+ KeyCodeEnum[KeyCodeEnum["SHIFT"] = 16] = "SHIFT";
1946
+ /** Control key */
1947
+ KeyCodeEnum[KeyCodeEnum["CONTROL"] = 17] = "CONTROL";
1948
+ /** Alt key */
1949
+ KeyCodeEnum[KeyCodeEnum["ALT"] = 18] = "ALT";
1950
+ /** Caps Lock key */
1951
+ KeyCodeEnum[KeyCodeEnum["CAPS_LOCK"] = 20] = "CAPS_LOCK";
1952
+ /** F1 key */
1953
+ KeyCodeEnum[KeyCodeEnum["F1"] = 112] = "F1";
1954
+ /** F2 key */
1955
+ KeyCodeEnum[KeyCodeEnum["F2"] = 113] = "F2";
1956
+ /** F3 key */
1957
+ KeyCodeEnum[KeyCodeEnum["F3"] = 114] = "F3";
1958
+ /** F4 key */
1959
+ KeyCodeEnum[KeyCodeEnum["F4"] = 115] = "F4";
1960
+ /** F5 key */
1961
+ KeyCodeEnum[KeyCodeEnum["F5"] = 116] = "F5";
1962
+ /** F6 key */
1963
+ KeyCodeEnum[KeyCodeEnum["F6"] = 117] = "F6";
1964
+ /** F7 key */
1965
+ KeyCodeEnum[KeyCodeEnum["F7"] = 118] = "F7";
1966
+ /** F8 key */
1967
+ KeyCodeEnum[KeyCodeEnum["F8"] = 119] = "F8";
1968
+ /** F9 key */
1969
+ KeyCodeEnum[KeyCodeEnum["F9"] = 120] = "F9";
1970
+ /** F10 key */
1971
+ KeyCodeEnum[KeyCodeEnum["F10"] = 121] = "F10";
1972
+ /** F11 key */
1973
+ KeyCodeEnum[KeyCodeEnum["F11"] = 122] = "F11";
1974
+ /** F12 key */
1975
+ KeyCodeEnum[KeyCodeEnum["F12"] = 123] = "F12";
1976
+ })(KeyCodeEnum || (KeyCodeEnum = {}));
1762
1977
 
1763
1978
  /**
1764
- * Object representing different content types for HTTP headers.
1979
+ * Enum for different storage keys used in the application.
1980
+ * This enum contains the keys for storing authentication token, locale information, user info, roles, and more.
1765
1981
  * @readonly
1982
+ * @enum {string}
1766
1983
  */
1767
- const ContentTypeEnum = {
1984
+ var StorageKeyEnum;
1985
+ (function (StorageKeyEnum) {
1768
1986
  /**
1769
- * Content type for JSON.
1770
- * @constant
1987
+ * Key used for storing the authentication token.
1988
+ * @constant {string}
1771
1989
  */
1772
- JSON: 'application/json;charset=UTF-8',
1990
+ StorageKeyEnum["TOKEN_KEY"] = "TOKEN__";
1773
1991
  /**
1774
- * Content type for URL-encoded form data.
1775
- * @constant
1992
+ * Key used for storing the locale information.
1993
+ * @constant {string}
1776
1994
  */
1777
- FORM_URLENCODED: 'application/x-www-form-urlencoded;charset=UTF-8',
1995
+ StorageKeyEnum["LOCALE_KEY"] = "LOCALE__";
1778
1996
  /**
1779
- * Content type for multipart form data with file uploads.
1780
- * @constant
1997
+ * Key used for storing user information.
1998
+ * @constant {string}
1781
1999
  */
1782
- FORM_DATA: 'multipart/form-data;charset=UTF-8',
1783
- };
1784
-
2000
+ StorageKeyEnum["USER_INFO_KEY"] = "USER__INFO__";
2001
+ /**
2002
+ * Key used for storing role information.
2003
+ * @constant {string}
2004
+ */
2005
+ StorageKeyEnum["ROLES_KEY"] = "ROLES__KEY__";
2006
+ /**
2007
+ * Key used for storing project configuration.
2008
+ * @constant {string}
2009
+ */
2010
+ StorageKeyEnum["PROJ_CFG_KEY"] = "PROJ__CFG__KEY__";
2011
+ /**
2012
+ * Key used for storing lock information.
2013
+ * @constant {string}
2014
+ */
2015
+ StorageKeyEnum["LOCK_INFO_KEY"] = "LOCK__INFO__KEY__";
2016
+ /**
2017
+ * Key used for base global local cache.
2018
+ * @constant {string}
2019
+ */
2020
+ StorageKeyEnum["APP_LOCAL_CACHE_KEY"] = "COMMON__LOCAL__KEY";
2021
+ /**
2022
+ * Key used for base global session cache.
2023
+ * @constant {string}
2024
+ */
2025
+ StorageKeyEnum["APP_SESSION_CACHE_KEY"] = "COMMON__SESSION__KEY";
2026
+ })(StorageKeyEnum || (StorageKeyEnum = {}));
1785
2027
  /**
1786
- * Object defining various key codes for keyboard events.
2028
+ * Enum defining types of storage.
1787
2029
  * @readonly
2030
+ * @enum {number}
1788
2031
  */
1789
- const KeyCodeEnum = {
1790
- UP: 38,
1791
- DOWN: 40,
1792
- ENTER: 13,
1793
- ESC: 27,
2032
+ const StorageTypeEnum = {
2033
+ /**
2034
+ * Represents session storage.
2035
+ * @constant {number}
2036
+ */
2037
+ SESSION: 0,
2038
+ /**
2039
+ * Represents local storage.
2040
+ * @constant {number}
2041
+ */
2042
+ LOCAL: 1,
1794
2043
  };
1795
2044
 
1796
2045
  /**
1797
- * Key used for storing the authentication token.
1798
- * @constant {string}
1799
- */
1800
- const TOKEN_KEY = 'TOKEN__';
1801
- /**
1802
- * Key used for storing the locale information.
1803
- * @constant {string}
1804
- */
1805
- const LOCALE_KEY = 'LOCALE__';
1806
- /**
1807
- * Key used for storing user information.
1808
- * @constant {string}
1809
- */
1810
- const USER_INFO_KEY = 'USER__INFO__';
1811
- /**
1812
- * Key used for storing role information.
1813
- * @constant {string}
1814
- */
1815
- const ROLES_KEY = 'ROLES__KEY__';
1816
- /**
1817
- * Key used for storing project configuration.
1818
- * @constant {string}
1819
- */
1820
- const PROJ_CFG_KEY = 'PROJ__CFG__KEY__';
1821
- /**
1822
- * Key used for storing lock information.
1823
- * @constant {string}
1824
- */
1825
- const LOCK_INFO_KEY = 'LOCK__INFO__KEY__';
1826
- /**
1827
- * Key used for base global local cache.
1828
- * @constant {string}
2046
+ * Enum representing different types of errors.
2047
+ * @readonly
1829
2048
  */
1830
- const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY';
1831
- /**
1832
- * Key used for base global session cache.
1833
- * @constant {string}
2049
+ var ErrorEnum;
2050
+ (function (ErrorEnum) {
2051
+ ErrorEnum["WARNING"] = "warning";
2052
+ ErrorEnum["ERROR"] = "error";
2053
+ ErrorEnum["CRITICAL"] = "critical";
2054
+ ErrorEnum["VALIDATION"] = "validation";
2055
+ ErrorEnum["COMPONENT"] = "component";
2056
+ ErrorEnum["NETWORK"] = "network";
2057
+ ErrorEnum["AUTHENTICATION"] = "authentication";
2058
+ ErrorEnum["RUNTIME"] = "runtime";
2059
+ ErrorEnum["TYPE"] = "type";
2060
+ ErrorEnum["REFERENCE"] = "reference";
2061
+ ErrorEnum["SYNTAX"] = "syntax";
2062
+ ErrorEnum["RANGE"] = "range";
2063
+ ErrorEnum["EVAL"] = "eval";
2064
+ ErrorEnum["URI"] = "uri";
2065
+ })(ErrorEnum || (ErrorEnum = {}));
2066
+ /**
2067
+ * Enum representing different error messages.
2068
+ * @readonly
1834
2069
  */
1835
- const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY';
1836
- /**
1837
- * Object defining types of cache storage.
2070
+ var ErrorMessages;
2071
+ (function (ErrorMessages) {
2072
+ ErrorMessages["WARNING"] = "Algo no est\u00E1 del todo bien. Verifica y vuelve a intentar.";
2073
+ ErrorMessages["ERROR"] = "Ocurri\u00F3 un error inesperado.";
2074
+ ErrorMessages["CRITICAL"] = "Error cr\u00EDtico. Contacta al soporte t\u00E9cnico.";
2075
+ ErrorMessages["VALIDATION"] = "Hay errores en el formulario. Revisa los campos.";
2076
+ ErrorMessages["COMPONENT"] = "Error en la carga del componente. Intenta recargar.";
2077
+ ErrorMessages["NETWORK"] = "Problema de conexi\u00F3n. Verifica tu internet.";
2078
+ ErrorMessages["AUTHENTICATION"] = "No tienes permisos para realizar esta acci\u00F3n.";
2079
+ ErrorMessages["RUNTIME"] = "Error de ejecuci\u00F3n. Intenta nuevamente.";
2080
+ ErrorMessages["TYPE"] = "Tipo de error no identificado.";
2081
+ ErrorMessages["REFERENCE"] = "Referencia no v\u00E1lida.";
2082
+ ErrorMessages["SYNTAX"] = "Error de sintaxis en el c\u00F3digo.";
2083
+ ErrorMessages["RANGE"] = "Error en el rango de valores.";
2084
+ ErrorMessages["EVAL"] = "Error en la evaluaci\u00F3n.";
2085
+ ErrorMessages["URI"] = "URI no v\u00E1lida.";
2086
+ })(ErrorMessages || (ErrorMessages = {}));
2087
+ /**
2088
+ * Enum representing different error styles.
1838
2089
  * @readonly
1839
2090
  */
1840
- const CacheTypeEnum = {
1841
- /** Represents session storage */
1842
- SESSION: 0,
1843
- /** Represents local storage */
1844
- LOCAL: 1,
1845
- };
1846
-
2091
+ var ErrorStyles;
2092
+ (function (ErrorStyles) {
2093
+ ErrorStyles["WARNING"] = "color: orange; font-weight: bold;";
2094
+ ErrorStyles["ERROR"] = "color: red; font-weight: bold;";
2095
+ ErrorStyles["CRITICAL"] = "color: white; background-color: red; font-weight: bold; padding: 2px;";
2096
+ ErrorStyles["VALIDATION"] = "color: blue; font-weight: bold;";
2097
+ ErrorStyles["COMPONENT"] = "color: purple; font-weight: bold;";
2098
+ ErrorStyles["NETWORK"] = "color: cyan; font-weight: bold;";
2099
+ ErrorStyles["AUTHENTICATION"] = "color: brown; font-weight: bold;";
2100
+ ErrorStyles["RUNTIME"] = "color: darkred; font-weight: bold;";
2101
+ ErrorStyles["TYPE"] = "color: gray; font-weight: bold;";
2102
+ ErrorStyles["REFERENCE"] = "color: darkorange; font-weight: bold;";
2103
+ ErrorStyles["SYNTAX"] = "color: darkblue; font-weight: bold;";
2104
+ ErrorStyles["RANGE"] = "color: darkgreen; font-weight: bold;";
2105
+ ErrorStyles["EVAL"] = "color: darkviolet; font-weight: bold;";
2106
+ ErrorStyles["URI"] = "color: darkcyan; font-weight: bold;";
2107
+ })(ErrorStyles || (ErrorStyles = {}));
2108
+ /**
2109
+ * A record mapping ErrorEnum to their corresponding error messages.
2110
+ */
1847
2111
  const ERROR_MESSAGES = {
1848
- warning: 'Algo no está del todo bien. Verifica y vuelve a intentar.',
1849
- error: 'Ocurrió un error inesperado.',
1850
- critical: 'Error crítico. Contacta al soporte técnico.',
1851
- validation: 'Hay errores en el formulario. Revisa los campos.',
1852
- component: 'Error en la carga del componente. Intenta recargar.',
1853
- network: 'Problema de conexión. Verifica tu internet.',
1854
- authentication: 'No tienes permisos para realizar esta acción.',
1855
- runtime: 'Error de ejecución. Intenta nuevamente.',
1856
- type: 'Tipo de error no identificado.',
1857
- reference: 'Referencia no válida.',
1858
- syntax: 'Error de sintaxis en el código.',
1859
- range: 'Error en el rango de valores.',
1860
- eval: 'Error en la evaluación.',
1861
- uri: 'URI no válida.',
2112
+ [ErrorEnum.WARNING]: ErrorMessages.WARNING,
2113
+ [ErrorEnum.ERROR]: ErrorMessages.ERROR,
2114
+ [ErrorEnum.CRITICAL]: ErrorMessages.CRITICAL,
2115
+ [ErrorEnum.VALIDATION]: ErrorMessages.VALIDATION,
2116
+ [ErrorEnum.COMPONENT]: ErrorMessages.COMPONENT,
2117
+ [ErrorEnum.NETWORK]: ErrorMessages.NETWORK,
2118
+ [ErrorEnum.AUTHENTICATION]: ErrorMessages.AUTHENTICATION,
2119
+ [ErrorEnum.RUNTIME]: ErrorMessages.RUNTIME,
2120
+ [ErrorEnum.TYPE]: ErrorMessages.TYPE,
2121
+ [ErrorEnum.REFERENCE]: ErrorMessages.REFERENCE,
2122
+ [ErrorEnum.SYNTAX]: ErrorMessages.SYNTAX,
2123
+ [ErrorEnum.RANGE]: ErrorMessages.RANGE,
2124
+ [ErrorEnum.EVAL]: ErrorMessages.EVAL,
2125
+ [ErrorEnum.URI]: ErrorMessages.URI,
1862
2126
  };
2127
+ /**
2128
+ * A record mapping ErrorEnum to their corresponding error styles.
2129
+ */
1863
2130
  const ERROR_STYLES = {
1864
- warning: 'color: orange; font-weight: bold;',
1865
- error: 'color: red; font-weight: bold;',
1866
- critical: 'color: white; background-color: red; font-weight: bold; padding: 2px;',
1867
- validation: 'color: blue; font-weight: bold;',
1868
- component: 'color: purple; font-weight: bold;',
1869
- network: 'color: cyan; font-weight: bold;',
1870
- authentication: 'color: brown; font-weight: bold;',
1871
- runtime: 'color: darkred; font-weight: bold;',
1872
- type: 'color: gray; font-weight: bold;',
1873
- reference: 'color: darkorange; font-weight: bold;',
1874
- syntax: 'color: darkblue; font-weight: bold;',
1875
- range: 'color: darkgreen; font-weight: bold;',
1876
- eval: 'color: darkviolet; font-weight: bold;',
1877
- uri: 'color: darkcyan; font-weight: bold;',
2131
+ [ErrorEnum.WARNING]: ErrorStyles.WARNING,
2132
+ [ErrorEnum.ERROR]: ErrorStyles.ERROR,
2133
+ [ErrorEnum.CRITICAL]: ErrorStyles.CRITICAL,
2134
+ [ErrorEnum.VALIDATION]: ErrorStyles.VALIDATION,
2135
+ [ErrorEnum.COMPONENT]: ErrorStyles.COMPONENT,
2136
+ [ErrorEnum.NETWORK]: ErrorStyles.NETWORK,
2137
+ [ErrorEnum.AUTHENTICATION]: ErrorStyles.AUTHENTICATION,
2138
+ [ErrorEnum.RUNTIME]: ErrorStyles.RUNTIME,
2139
+ [ErrorEnum.TYPE]: ErrorStyles.TYPE,
2140
+ [ErrorEnum.REFERENCE]: ErrorStyles.REFERENCE,
2141
+ [ErrorEnum.SYNTAX]: ErrorStyles.SYNTAX,
2142
+ [ErrorEnum.RANGE]: ErrorStyles.RANGE,
2143
+ [ErrorEnum.EVAL]: ErrorStyles.EVAL,
2144
+ [ErrorEnum.URI]: ErrorStyles.URI,
1878
2145
  };
1879
2146
 
1880
2147
  class RestStd {
@@ -1908,7 +2175,7 @@ class RestStd {
1908
2175
  * @param options Additional options for the fetch composable.
1909
2176
  * @returns The result of the fetch composable (typically a promise).
1910
2177
  */
1911
- static getMany(params, options = {}) {
2178
+ static getAll(params, options = {}) {
1912
2179
  return this.fetchComposable({
1913
2180
  method: 'GET',
1914
2181
  url: this.resource,
@@ -2117,29 +2384,44 @@ function inferErrorType(error) {
2117
2384
  return 'error';
2118
2385
  }
2119
2386
 
2120
- let tokenConfig = {
2387
+ let secretKey = '12345678901234567890123456789012';
2388
+ let tokenConfig = Object.freeze({
2121
2389
  ACCESS_TOKEN: 'authToken',
2122
2390
  REFRESH_TOKEN: 'refreshToken',
2123
- };
2391
+ });
2124
2392
  /**
2125
- * Función para configurar las claves globalmente.
2126
- * Esta función congela el objeto para evitar modificaciones posteriores.
2127
- * @param {string} accessTokenKey - Nombre de la clave del token de acceso
2128
- * @param {string} refreshTokenKey - Nombre de la clave del refresh token
2393
+ * Configura las claves globales para los tokens de acceso y refresh.
2394
+ * Una vez establecidas, no pueden ser modificadas.
2395
+ * @param accessTokenKey - Nombre de la clave del token de acceso.
2396
+ * @param refreshTokenKey - Nombre de la clave del refresh token.
2129
2397
  */
2130
- function configureTokenKeys(accessTokenKey, refreshTokenKey) {
2398
+ function setTokenConfig(accessTokenKey, refreshTokenKey) {
2131
2399
  tokenConfig = Object.freeze({
2132
2400
  ACCESS_TOKEN: accessTokenKey,
2133
2401
  REFRESH_TOKEN: refreshTokenKey,
2134
2402
  });
2135
2403
  }
2136
2404
  /**
2137
- * Obtiene las claves configuradas para los tokens.
2138
- * El objeto está congelado, por lo que no se puede modificar directamente.
2405
+ * Obtiene la configuración actual de las claves de tokens.
2406
+ * @returns Configuración de los tokens.
2139
2407
  */
2140
2408
  function getTokenConfig() {
2141
2409
  return tokenConfig;
2142
2410
  }
2411
+ /**
2412
+ * Establece la clave secreta para su uso en autenticación.
2413
+ * @param key - Nueva clave secreta.
2414
+ */
2415
+ function setSecretKey(key) {
2416
+ secretKey = key;
2417
+ }
2418
+ /**
2419
+ * Obtiene la clave secreta actual.
2420
+ * @returns Clave secreta configurada.
2421
+ */
2422
+ function getSecretKey() {
2423
+ return secretKey;
2424
+ }
2143
2425
 
2144
2426
  let endpointsConfig = {
2145
2427
  LOGIN: '/login',
@@ -2697,4 +2979,4 @@ function useSorter(items, criteriaList, selectedCriteria) {
2697
2979
  }).value;
2698
2980
  }
2699
2981
 
2700
- export { APP_LOCAL_CACHE_KEY, APP_SESSION_CACHE_KEY, AxiosService, CacheTypeEnum, ContentTypeEnum, ERROR_MESSAGES, ERROR_STYLES, ExceptionEnum, FileMetaTypes, ImageTypes, KeyCodeEnum, LOCALE_KEY, LOCK_INFO_KEY, PROJ_CFG_KEY, ROLES_KEY, RestStd, TOKEN_KEY, USER_INFO_KEY, addCustomKeyboardShortcut, addDays, addDoubleClickListener, addKeyListener, ageAtDate, axiosFetch, blobToFormData, bufferToBlob, calculateAge, clickOutside, compareObject, configureAxios, configureEndpoints, configureTokenKeys, copyToClipboard, countWords, createCustomAxiosInstance, createFetch, createKeyMap, customShortcut, daysBetween, daysToNextBirthday, debounce, debounceAsync, debounceAsyncValidator, debounceAsyncWithImmediate, debounceLeading, debounceLeadingTrailing, debounceTrailing, deepClone, deepEqual, deepMerge, detectKeyHold, disableCopy, disableF12Key, disableMouseButtons, disableRightClick, disableSpecificKeys, downloadBlob, enableMouseButtons, enableRightClick, enableSpecificKeys, exportToCSV, exportToExcel, exportToJSON, exportToText, exportToXML, filterObjectByKeys, flattenObject, formDataToObject, formatDate, generateRandomString, getAxiosInstance, getEndOfMonth, getEndpointsConfig, getObjectDifferences, getObjectKeys, getQueryParam, getStartOfMonth, getTokenConfig, hasNestedProperties, isEmptyObject, isLeapYear, isStrongPassword, isValidAge, isValidCreditCard, isValidDate, isValidEmail, isValidExpiryDate, isValidHexColor, isValidHexColorAlpha, isValidHexNumber, isValidIP, isValidPhoneNumber, isValidSSN, isValidTime, isValidURL, isValidUsername, isValidZIP, lowerFirst, objectToFormData, objectToFormDataEnhanced, objectToQueryString, openWindow, parseDate, proxyToPlainObject, readFileAsDataURL, readFileAsText, registerKeyboardShortcuts, removeAccent, removeClickOutside, removeCustomKeyboardShortcut, removeCustomShortcuts, removeDoubleClickListener, removeEmptyProperties, removeKeyListeners, replaceAll, reverseString, safeGet, screenEnum, screenMap, scrollToTop, simulateKeyPress, sizeEnum, stopDetectingKeyHold, stringToBlob, subtractDays, throttle, toCamelCase, toKebabCase, toggleTabNavigation, truncateString, unregisterKeyboardShortcuts, upperFirst, useBreakpoint, useFilter, usePagination, useSorter, useVueQuery, validateAlphanumeric, validateLetters, validateNumbers };
2982
+ export { AppTypes, ArchiveTypes, AudioTypes, AxiosService, ContentTypeEnum, DocumentTypes, ERROR_MESSAGES, ERROR_STYLES, ErrorEnum, ErrorMessages, ErrorStyles, ExceptionEnum, FontTypes, ImageTypes, KeyCodeEnum, OtherTypes, RestStd, ScreenBreakpoint, ScreenSize, StorageKeyEnum, StorageTypeEnum, TextTypes, VideoTypes, addCustomKeyboardShortcut, addDays, addDoubleClickListener, addKeyListener, ageAtDate, axiosFetch, blobToFormData, bufferToBlob, calculateAge, clickOutside, compareObject, configureAxios, configureEndpoints, copyToClipboard, countWords, createCustomAxiosInstance, createFetch, createKeyMap, customShortcut, daysBetween, daysToNextBirthday, debounce, debounceAsync, debounceAsyncValidator, debounceAsyncWithImmediate, debounceLeading, debounceLeadingTrailing, debounceTrailing, deepClone, deepEqual, deepMerge, detectKeyHold, disableCopy, disableF12Key, disableMouseButtons, disableRightClick, disableSpecificKeys, downloadBlob, enableMouseButtons, enableRightClick, enableSpecificKeys, exportToCSV, exportToExcel, exportToJSON, exportToText, exportToXML, filterObjectByKeys, flattenObject, formDataToObject, formatDate, generateRandomString, getAxiosInstance, getEndOfMonth, getEndpointsConfig, getObjectDifferences, getObjectKeys, getQueryParam, getSecretKey, getStartOfMonth, getTokenConfig, hasNestedProperties, isEmptyObject, isLeapYear, isStrongPassword, isValidAge, isValidCreditCard, isValidDate, isValidEmail, isValidExpiryDate, isValidHexColor, isValidHexColorAlpha, isValidHexNumber, isValidIP, isValidPhoneNumber, isValidSSN, isValidTime, isValidURL, isValidUsername, isValidZIP, lowerFirst, objectToFormData, objectToFormDataEnhanced, objectToQueryString, openWindow, parseDate, proxyToPlainObject, readFileAsDataURL, readFileAsText, registerKeyboardShortcuts, removeAccent, removeClickOutside, removeCustomKeyboardShortcut, removeCustomShortcuts, removeDoubleClickListener, removeEmptyProperties, removeKeyListeners, replaceAll, reverseString, safeGet, screenMap, scrollToTop, setSecretKey, setTokenConfig, simulateKeyPress, stopDetectingKeyHold, stringToBlob, subtractDays, throttle, toCamelCase, toKebabCase, toggleTabNavigation, truncateString, unregisterKeyboardShortcuts, upperFirst, useBreakpoint, useFilter, usePagination, useSorter, useVueQuery, validateAlphanumeric, validateLetters, validateNumbers };
@@ -21,7 +21,7 @@ export declare class RestStd {
21
21
  * @param options Additional options for the fetch composable.
22
22
  * @returns The result of the fetch composable (typically a promise).
23
23
  */
24
- static getMany<T>(params?: Record<string, any>, options?: object): any;
24
+ static getAll<T>(params?: Record<string, any>, options?: object): any;
25
25
  /**
26
26
  * Fetch a single item by ID from the server.
27
27
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arex95/vue-core",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Opinionated Vue Core",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -32,7 +32,7 @@
32
32
  "@vueuse/core": ">=12.8.2",
33
33
  "axios": ">=1.6.0",
34
34
  "vue": ">=3.0.0",
35
- "vue-router": "^4.5.0"
35
+ "vue-router": ">=4.5.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@rollup/plugin-commonjs": "^28.0.3",
@@ -49,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "crypto-js": "^4.2.0",
51
51
  "jwt-decode": "^4.0.0",
52
- "vue-router": "^4.5.0",
52
+ "vue-router": ">=4.5.0",
53
53
  "@tanstack/vue-query": ">=5.0.0",
54
54
  "@vueuse/core": ">=12.8.2",
55
55
  "axios": ">=1.6.0",