@arex95/vue-core 1.1.41 → 3.0.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.
Files changed (89) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +97 -64
  3. package/dist/composables/auth/useAuth.d.ts +20 -6
  4. package/dist/composables/axios/axiosFetch.d.ts +7 -5
  5. package/dist/composables/axios/index.d.ts +0 -1
  6. package/dist/composables/axios/useFetch.d.ts +14 -5
  7. package/dist/composables/breakpoints/useBreakpoint.d.ts +11 -2
  8. package/dist/composables/filters/useFilter.d.ts +13 -8
  9. package/dist/composables/monitoring/useApiActivity.d.ts +17 -6
  10. package/dist/composables/monitoring/useUserActivity.d.ts +20 -5
  11. package/dist/composables/paginators/usePaginator.d.ts +13 -5
  12. package/dist/composables/sorters/useSorter.d.ts +13 -7
  13. package/dist/config/auth/authFetcher.d.ts +30 -0
  14. package/dist/config/auth/index.d.ts +1 -0
  15. package/dist/config/axios/axiosConfig.d.ts +30 -0
  16. package/dist/config/axios/axiosInstance.d.ts +14 -0
  17. package/dist/config/global/endpointsConfig.d.ts +9 -13
  18. package/dist/config/global/keyConfig.d.ts +7 -10
  19. package/dist/config/global/sessionConfig.d.ts +15 -17
  20. package/dist/config/global/tokenPathsConfig.d.ts +17 -18
  21. package/dist/config/global/tokensConfig.d.ts +9 -9
  22. package/dist/config/index.d.ts +1 -0
  23. package/dist/enums/breakpointsEnums.d.ts +7 -4
  24. package/dist/enums/errorsEnums.d.ts +26 -19
  25. package/dist/enums/fileTypesEnums.d.ts +33 -1
  26. package/dist/enums/httpExceptionsEnums.d.ts +3 -1
  27. package/dist/enums/keyCodesEnums.d.ts +2 -4
  28. package/dist/enums/storageEnums.d.ts +4 -4
  29. package/dist/errors/AuthError.d.ts +10 -0
  30. package/dist/errors/BaseError.d.ts +16 -0
  31. package/dist/errors/NetworkError.d.ts +9 -0
  32. package/dist/errors/ServerError.d.ts +10 -0
  33. package/dist/errors/ValidationError.d.ts +14 -0
  34. package/dist/errors/index.d.ts +5 -0
  35. package/dist/fetchers/axios.d.ts +22 -0
  36. package/dist/fetchers/index.d.ts +2 -0
  37. package/dist/fetchers/ofetch.d.ts +33 -0
  38. package/dist/index.d.ts +8 -6
  39. package/dist/index.mjs +1633 -875
  40. package/dist/rest/RestStd.d.ts +146 -102
  41. package/dist/services/credentials.d.ts +24 -29
  42. package/dist/services/extractTokens.d.ts +7 -6
  43. package/dist/services/refreshTokens.d.ts +11 -12
  44. package/dist/services/storeTokens.d.ts +8 -6
  45. package/dist/types/AppKeyConfig.d.ts +7 -0
  46. package/dist/types/ArexVueCoreOptions.d.ts +20 -0
  47. package/dist/types/Auth.d.ts +15 -0
  48. package/dist/types/AxiosOptionsParameter.d.ts +14 -7
  49. package/dist/types/AxiosServiceOptions.d.ts +9 -0
  50. package/dist/types/DecodedJwtPayload.d.ts +12 -0
  51. package/dist/types/EndpointsConfig.d.ts +7 -0
  52. package/dist/types/ErrorType.d.ts +4 -2
  53. package/dist/types/ExtendedQueryOptions.d.ts +10 -0
  54. package/dist/types/Fetcher.d.ts +24 -0
  55. package/dist/types/RestStdOptions.d.ts +62 -0
  56. package/dist/types/SessionConfig.d.ts +25 -1
  57. package/dist/types/TokenConfig.d.ts +7 -0
  58. package/dist/types/TokenValidationResult.d.ts +7 -0
  59. package/dist/types/index.d.ts +2 -0
  60. package/dist/utils/browser.d.ts +20 -14
  61. package/dist/utils/dates.d.ts +47 -34
  62. package/dist/utils/debounces.d.ts +54 -32
  63. package/dist/utils/encryption.d.ts +28 -24
  64. package/dist/utils/errors.d.ts +27 -8
  65. package/dist/utils/exports.d.ts +24 -19
  66. package/dist/utils/files.d.ts +33 -25
  67. package/dist/utils/index.d.ts +3 -0
  68. package/dist/utils/io.d.ts +70 -54
  69. package/dist/utils/objects.d.ts +78 -60
  70. package/dist/utils/retry.d.ts +8 -0
  71. package/dist/utils/ssr.d.ts +27 -0
  72. package/dist/utils/storage.d.ts +20 -14
  73. package/dist/utils/strings.d.ts +42 -31
  74. package/dist/utils/validations.d.ts +76 -57
  75. package/package.json +71 -76
  76. package/dist/composables/axios/createFetch.d.ts +0 -9
  77. package/dist/config/global/tokenConfig.d.ts +0 -31
  78. package/dist/constants/breakpointEnum.d.ts +0 -31
  79. package/dist/constants/errorsEnum.d.ts +0 -3
  80. package/dist/constants/exceptionEnum.d.ts +0 -30
  81. package/dist/constants/fileTypesEnum.d.ts +0 -25
  82. package/dist/constants/httpEnum.d.ts +0 -21
  83. package/dist/constants/index.d.ts +0 -7
  84. package/dist/constants/keyCodeEnum.d.ts +0 -10
  85. package/dist/constants/storageEnum.d.ts +0 -50
  86. package/dist/types/AuthConfig.d.ts +0 -5
  87. package/dist/types/AuthParams.d.ts +0 -4
  88. package/dist/types/AuthResponse.d.ts +0 -5
  89. package/dist/utils/credentials.d.ts +0 -56
@@ -1,50 +0,0 @@
1
- /**
2
- * Key used for storing the authentication token.
3
- * @constant {string}
4
- */
5
- export declare const TOKEN_KEY = "TOKEN__";
6
- /**
7
- * Key used for storing the locale information.
8
- * @constant {string}
9
- */
10
- export declare const LOCALE_KEY = "LOCALE__";
11
- /**
12
- * Key used for storing user information.
13
- * @constant {string}
14
- */
15
- export declare const USER_INFO_KEY = "USER__INFO__";
16
- /**
17
- * Key used for storing role information.
18
- * @constant {string}
19
- */
20
- export declare const ROLES_KEY = "ROLES__KEY__";
21
- /**
22
- * Key used for storing project configuration.
23
- * @constant {string}
24
- */
25
- export declare const PROJ_CFG_KEY = "PROJ__CFG__KEY__";
26
- /**
27
- * Key used for storing lock information.
28
- * @constant {string}
29
- */
30
- export declare const LOCK_INFO_KEY = "LOCK__INFO__KEY__";
31
- /**
32
- * Key used for base global local cache.
33
- * @constant {string}
34
- */
35
- export declare const APP_LOCAL_CACHE_KEY = "COMMON__LOCAL__KEY";
36
- /**
37
- * Key used for base global session cache.
38
- * @constant {string}
39
- */
40
- export declare const APP_SESSION_CACHE_KEY = "COMMON__SESSION__KEY";
41
- /**
42
- * Object defining types of cache storage.
43
- * @readonly
44
- */
45
- export declare const CacheTypeEnum: {
46
- /** Represents session storage */
47
- readonly SESSION: 0;
48
- /** Represents local storage */
49
- readonly LOCAL: 1;
50
- };
@@ -1,5 +0,0 @@
1
- import { TokensConfig, EndpointsConfig } from "@/types";
2
- export type AuthConfig = {
3
- endpoints: EndpointsConfig;
4
- storageKeys: TokensConfig;
5
- };
@@ -1,4 +0,0 @@
1
- export interface AuthParams {
2
- username?: string;
3
- password?: string;
4
- }
@@ -1,5 +0,0 @@
1
- export interface AuthResponse {
2
- access_token: string;
3
- refresh_token: string;
4
- [key: string]: unknown;
5
- }
@@ -1,56 +0,0 @@
1
- import { LocationPreference } from "@/types/SessionConfig";
2
- /**
3
- * Clears all stored authentication data (access and refresh tokens)
4
- * from either sessionStorage, localStorage, or both based on the provided location preference.
5
- *
6
- * @param {LocationPreference} location - The storage preference ('local' for localStorage, 'session' for sessionStorage, 'any' for both).
7
- * @returns {Promise<void>} A promise that resolves when all relevant storage items are removed.
8
- */
9
- export declare const cleanCredentials: (location: LocationPreference) => Promise<void>;
10
- /**
11
- * Retrieves the authentication token (access token) from storage, decrypting it
12
- * using the provided secret key and based on the specified session preference.
13
- *
14
- * @param {string} secretKey - The secret key used for decryption.
15
- * @param {SessionPreference} preference - The storage preference ('local' for localStorage, 'session' for sessionStorage).
16
- * @returns {Promise<string | null>} A promise that resolves with the decrypted access token, or null if not found.
17
- */
18
- export declare const getAuthToken: (secretKey: string, location: LocationPreference) => Promise<string | null>;
19
- /**
20
- * Retrieves the authentication refresh token from storage, decrypting it
21
- * using the provided secret key and based on the specified session preference.
22
- *
23
- * @param {string} secretKey - The secret key used for decryption.
24
- * @param {SessionPreference} preference - The storage preference ('local' for localStorage, 'session' for sessionStorage).
25
- * @returns {Promise<string | null>} A promise that resolves with the decrypted refresh token, or null if not found.
26
- */
27
- export declare const getAuthRefreshToken: (secretKey: string, location: LocationPreference) => Promise<string | null>;
28
- /**
29
- * Stores the authentication token (access token) in storage after encrypting it,
30
- * based on the specified session preference.
31
- *
32
- * @param {string} token - The access token to store.
33
- * @param {string} secretKey - The secret key used for encryption.
34
- * @param {SessionPreference} preference - The storage preference ('local' for localStorage, 'session' for sessionStorage).
35
- * @returns {Promise<void>} A promise that resolves when the token is successfully stored.
36
- */
37
- export declare const storeAuthToken: (token: string, secretKey: string, location: LocationPreference) => Promise<void>;
38
- /**
39
- * Stores the authentication refresh token in storage after encrypting it,
40
- * based on the specified session preference.
41
- *
42
- * @param {string} token - The refresh token to store.
43
- * @param {string} secretKey - The secret key used for encryption.
44
- * @param {SessionPreference} preference - The storage preference ('local' for localStorage, 'session' for sessionStorage).
45
- * @returns {Promise<void>} A promise that resolves when the token is successfully stored.
46
- */
47
- export declare const storeAuthRefreshToken: (token: string, secretKey: string, location: LocationPreference) => Promise<void>;
48
- /**
49
- * Verifies the validity and expiration of the current authentication token.
50
- * If the token is missing, invalid, or expired, appropriate errors are thrown and credentials are cleaned.
51
- *
52
- * @returns {Promise<boolean>} True if the token is valid and unexpired.
53
- * @throws {Error} "TOKEN_MISSING" if no token is found, "TOKEN_EXPIRED" if the token has expired,
54
- * "TOKEN_INVALID" if the token format is invalid.
55
- */
56
- export declare const verifyAuth: () => Promise<boolean>;