@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,63 +1,74 @@
1
1
  /**
2
- * Capitalizes the first character of a string.
3
- * @param {string} s The string to capitalize.
4
- * @returns {string} The capitalized string.
2
+ * Capitalizes the first letter of a string.
3
+ *
4
+ * @param {string} s - The input string.
5
+ * @returns {string} The string with the first letter capitalized.
5
6
  */
6
7
  export declare function upperFirst(s: string): string;
7
8
  /**
8
- * Lowercases the first character of a string.
9
- * @param {string} s The string to lowercase.
10
- * @returns {string} The lowercased string.
9
+ * Converts the first letter of a string to lowercase.
10
+ *
11
+ * @param {string} s - The input string.
12
+ * @returns {string} The string with the first letter in lowercase.
11
13
  */
12
14
  export declare function lowerFirst(s: string): string;
13
15
  /**
14
- * Removes accents and special characters from a string and converts it to a URL-friendly format.
15
- * @param {string} input The string to process.
16
- * @returns {string} The processed string.
16
+ * Normalizes a string by converting it to lowercase, trimming whitespace, replacing spaces with hyphens,
17
+ * and removing diacritical marks (accents).
18
+ *
19
+ * @param {string} input - The string to normalize.
20
+ * @returns {string} The URL-friendly, normalized string.
17
21
  */
18
22
  export declare function removeAccent(input: string): string;
19
23
  /**
20
- * Reverses a string.
21
- * @param {string} str The string to reverse.
24
+ * Reverses the characters of a string.
25
+ *
26
+ * @param {string} str - The input string.
22
27
  * @returns {string} The reversed string.
23
28
  */
24
29
  export declare function reverseString(str: string): string;
25
30
  /**
26
- * Counts the number of words in a string.
27
- * @param {string} str The string to analyze.
28
- * @returns {number} The word count.
31
+ * Counts the number of words in a string, based on whitespace separation.
32
+ *
33
+ * @param {string} str - The input string.
34
+ * @returns {number} The number of words in the string.
29
35
  */
30
36
  export declare function countWords(str: string): number;
31
37
  /**
32
- * Truncates a string to the specified length and adds ellipsis if necessary.
33
- * @param {string} str The string to truncate.
34
- * @param {number} maxLength The maximum length of the string.
38
+ * Truncates a string to a specified maximum length, appending '...' if the string is cut.
39
+ *
40
+ * @param {string} str - The input string.
41
+ * @param {number} maxLength - The maximum desired length of the string.
35
42
  * @returns {string} The truncated string.
36
43
  */
37
44
  export declare function truncateString(str: string, maxLength: number): string;
38
45
  /**
39
- * Converts a string to camel case.
40
- * @param {string} str The string to convert.
41
- * @returns {string} The camel cased string.
46
+ * Converts a string from various cases (e.g., snake_case, kebab-case, space separated) into camelCase.
47
+ *
48
+ * @param {string} str - The input string.
49
+ * @returns {string} The camelCase version of the string.
42
50
  */
43
51
  export declare function toCamelCase(str: string): string;
44
52
  /**
45
- * Converts a string to kebab case.
46
- * @param {string} str The string to convert.
47
- * @returns {string} The kebab cased string.
53
+ * Converts a string from various cases (e.g., camelCase, PascalCase, space separated) into kebab-case.
54
+ *
55
+ * @param {string} str - The input string.
56
+ * @returns {string} The kebab-case version of the string.
48
57
  */
49
58
  export declare function toKebabCase(str: string): string;
50
59
  /**
51
- * Replaces all instances of a substring within a string.
52
- * @param {string} str The original string.
53
- * @param {string} find The substring to find.
54
- * @param {string} replace The substring to replace with.
55
- * @returns {string} The modified string.
60
+ * Replaces all occurrences of a substring with a new substring.
61
+ *
62
+ * @param {string} str - The original string.
63
+ * @param {string} find - The substring to find and replace.
64
+ * @param {string} replace - The substring to replace with.
65
+ * @returns {string} A new string with all replacements made.
56
66
  */
57
67
  export declare function replaceAll(str: string, find: string, replace: string): string;
58
68
  /**
59
- * Generates a random string of a specific length.
60
- * @param {number} length The length of the string to generate.
61
- * @returns {string} The random string.
69
+ * Generates a random alphanumeric string of a specified length.
70
+ *
71
+ * @param {number} length - The desired length of the random string.
72
+ * @returns {string} The generated random string.
62
73
  */
63
74
  export declare function generateRandomString(length: number): string;
@@ -1,114 +1,133 @@
1
1
  /**
2
- * Validates if the key pressed is a valid letter or special character.
3
- * @param {KeyboardEvent} e The keyboard event.
4
- * @returns {boolean} True if the key is valid, otherwise false.
2
+ * An event handler that prevents a `KeyboardEvent`'s default action if the key pressed is not a letter or a specific special character.
3
+ *
4
+ * @param {KeyboardEvent} e - The `KeyboardEvent` object.
5
+ * @returns {boolean} `true` if the key is valid, `false` otherwise.
5
6
  */
6
7
  export declare function validateLetters(e: KeyboardEvent): boolean;
7
8
  /**
8
- * Validates if the key pressed is a valid alphanumeric character.
9
- * @param {KeyboardEvent} e The keyboard event.
10
- * @returns {boolean} True if the key is valid, otherwise false.
9
+ * An event handler that prevents a `KeyboardEvent`'s default action if the key pressed is not an alphanumeric character.
10
+ *
11
+ * @param {KeyboardEvent} e - The `KeyboardEvent` object.
12
+ * @returns {boolean} `true` if the key is valid, `false` otherwise.
11
13
  */
12
14
  export declare function validateAlphanumeric(e: KeyboardEvent): boolean;
13
15
  /**
14
- * Validates if the key pressed is a number.
15
- * @param {KeyboardEvent} e The keyboard event.
16
- * @returns {boolean} True if the key is a number, otherwise false.
16
+ * An event handler that prevents a `KeyboardEvent`'s default action if the key pressed is not a number.
17
+ *
18
+ * @param {KeyboardEvent} e - The `KeyboardEvent` object.
19
+ * @returns {boolean} `true` if the key is a number, otherwise `false`.
17
20
  */
18
21
  export declare function validateNumbers(e: KeyboardEvent): boolean;
19
22
  /**
20
- * Validates if a phone number is valid.
21
- * @param {string} phoneNumber The phone number to validate.
22
- * @returns {boolean} True if the phone number is valid, otherwise false.
23
+ * Validates a phone number against a regex for 10-digit numbers.
24
+ *
25
+ * @param {string} phoneNumber - The phone number to validate.
26
+ * @returns {boolean} `true` if the phone number is valid, otherwise `false`.
23
27
  */
24
28
  export declare function isValidPhoneNumber(phoneNumber: string): boolean;
25
29
  /**
26
- * Validates if a string is a valid email address.
27
- * @param {string} email The email address to validate.
28
- * @returns {boolean} True if the email address is valid, otherwise false.
30
+ * Validates an email address against a standard regex pattern.
31
+ *
32
+ * @param {string} email - The email address to validate.
33
+ * @returns {boolean} `true` if the email is valid, otherwise `false`.
29
34
  */
30
35
  export declare function isValidEmail(email: string): boolean;
31
36
  /**
32
- * Validates if a string is a valid URL.
33
- * @param {string} url The URL to validate.
34
- * @returns {boolean} True if the URL is valid, otherwise false.
37
+ * Validates a string to see if it is a well-formed URL.
38
+ *
39
+ * @param {string} url - The URL string to validate.
40
+ * @returns {boolean} `true` if the URL is valid, otherwise `false`.
35
41
  */
36
42
  export declare function isValidURL(url: string): boolean;
37
43
  /**
38
- * Validates if a string is a valid date in YYYY-MM-DD format.
39
- * @param {string} date The date string to validate.
40
- * @returns {boolean} True if the date is valid, otherwise false.
44
+ * Validates a string to ensure it is a valid date in 'YYYY-MM-DD' format.
45
+ *
46
+ * @param {string} date - The date string to validate.
47
+ * @returns {boolean} `true` if the date is valid, otherwise `false`.
41
48
  */
42
49
  export declare function isValidDate(date: string): boolean;
43
50
  /**
44
- * Validates if a password meets certain strength criteria.
45
- * @param {string} password The password to validate.
46
- * @returns {boolean} True if the password is strong, otherwise false.
51
+ * Checks if a password meets a set of strength requirements (minimum length, uppercase, lowercase, numbers, special characters).
52
+ *
53
+ * @param {string} password - The password to validate.
54
+ * @returns {boolean} `true` if the password is strong, otherwise `false`.
47
55
  */
48
56
  export declare function isStrongPassword(password: string): boolean;
49
57
  /**
50
- * Validates a credit card number using the Luhn algorithm.
51
- * @param {string} cardNumber The credit card number to validate.
52
- * @returns {boolean} True if the credit card number is valid, otherwise false.
58
+ * Validates a credit card number using the Luhn algorithm (mod-10 check).
59
+ *
60
+ * @param {string} cardNumber - The credit card number to validate.
61
+ * @returns {boolean} `true` if the credit card number is valid, otherwise `false`.
53
62
  */
54
63
  export declare function isValidCreditCard(cardNumber: string): boolean;
55
64
  /**
56
- * Validates if a string is a valid hex color code.
57
- * @param {string} color The color code to validate.
58
- * @returns {boolean} True if the color code is valid, otherwise false.
65
+ * Validates a string to check if it's a valid 3- or 6-digit hexadecimal color code.
66
+ *
67
+ * @param {string} color - The hex color string to validate.
68
+ * @returns {boolean} `true` if the color code is valid, otherwise `false`.
59
69
  */
60
70
  export declare function isValidHexColor(color: string): boolean;
61
71
  /**
62
- * Validates if a string is a valid time in HH:MM format.
63
- * @param {string} time The time string to validate.
64
- * @returns {boolean} True if the time is valid, otherwise false.
72
+ * Validates a string to ensure it represents a valid time in 24-hour HH:MM format.
73
+ *
74
+ * @param {string} time - The time string to validate.
75
+ * @returns {boolean} `true` if the time is valid, otherwise `false`.
65
76
  */
66
77
  export declare function isValidTime(time: string): boolean;
67
78
  /**
68
- * Validates if a string is a valid IPv4 address.
69
- * @param {string} ip The IP address to validate.
70
- * @returns {boolean} True if the IP address is valid, otherwise false.
79
+ * Validates a string to check if it is a valid IPv4 address.
80
+ *
81
+ * @param {string} ip - The IP address string to validate.
82
+ * @returns {boolean} `true` if the IP address is valid, otherwise `false`.
71
83
  */
72
84
  export declare function isValidIP(ip: string): boolean;
73
85
  /**
74
- * Validates if a string is a valid U.S. Social Security Number (SSN).
75
- * @param {string} ssn The SSN to validate.
76
- * @returns {boolean} True if the SSN is valid, otherwise false.
86
+ * Validates a string to check if it matches the format of a U.S. Social Security Number (SSN).
87
+ *
88
+ * @param {string} ssn - The SSN string to validate.
89
+ * @returns {boolean} `true` if the SSN format is valid, otherwise `false`.
77
90
  */
78
91
  export declare function isValidSSN(ssn: string): boolean;
79
92
  /**
80
- * Validates if a string is a valid U.S. ZIP code.
81
- * @param {string} zip The ZIP code to validate.
82
- * @returns {boolean} True if the ZIP code is valid, otherwise false.
93
+ * Validates a string to check if it is a valid 5-digit or 9-digit (ZIP+4) U.S. ZIP code.
94
+ *
95
+ * @param {string} zip - The ZIP code string to validate.
96
+ * @returns {boolean} `true` if the ZIP code is valid, otherwise `false`.
83
97
  */
84
98
  export declare function isValidZIP(zip: string): boolean;
85
99
  /**
86
- * Validates if a string is a valid credit card expiry date in MM/YY format.
87
- * @param {string} expiryDate The expiry date to validate.
88
- * @returns {boolean} True if the expiry date is valid, otherwise false.
100
+ * Validates a credit card expiry date string (MM/YY format) to ensure it is a valid, non-expired date.
101
+ *
102
+ * @param {string} expiryDate - The expiry date to validate.
103
+ * @returns {boolean} `true` if the expiry date is valid and not in the past, otherwise `false`.
89
104
  */
90
105
  export declare function isValidExpiryDate(expiryDate: string): boolean;
91
106
  /**
92
- * Validates if a string is a valid 8-character hexadecimal color code (including alpha).
93
- * @param {string} color The color code to validate.
94
- * @returns {boolean} True if the color code is valid, otherwise false.
107
+ * Validates a string to check if it's a valid 8-digit hexadecimal color code (with alpha channel).
108
+ *
109
+ * @param {string} color - The hex color string to validate.
110
+ * @returns {boolean} `true` if the color code is valid, otherwise `false`.
95
111
  */
96
112
  export declare function isValidHexColorAlpha(color: string): boolean;
97
113
  /**
98
- * Validates if a username meets specific criteria.
99
- * @param {string} username The username to validate.
100
- * @returns {boolean} True if the username is valid, otherwise false.
114
+ * Validates a username to ensure it contains only alphanumeric characters and underscores, with a length between 3 and 16 characters.
115
+ *
116
+ * @param {string} username - The username to validate.
117
+ * @returns {boolean} `true` if the username is valid, otherwise `false`.
101
118
  */
102
119
  export declare function isValidUsername(username: string): boolean;
103
120
  /**
104
- * Validates if a string represents a valid age between 0 and 120.
105
- * @param {string} age The age to validate.
106
- * @returns {boolean} True if the age is valid, otherwise false.
121
+ * Validates a string to ensure it represents a plausible human age (0-120).
122
+ *
123
+ * @param {string} age - The age string to validate.
124
+ * @returns {boolean} `true` if the age is valid, otherwise `false`.
107
125
  */
108
126
  export declare function isValidAge(age: string): boolean;
109
127
  /**
110
- * Validates if a string is a valid hexadecimal number.
111
- * @param {string} hex The hexadecimal number to validate.
112
- * @returns {boolean} True if the number is valid, otherwise false.
128
+ * Validates a string to check if it contains only valid hexadecimal characters.
129
+ *
130
+ * @param {string} hex - The string to validate.
131
+ * @returns {boolean} `true` if the string is a valid hexadecimal number, otherwise `false`.
113
132
  */
114
133
  export declare function isValidHexNumber(hex: string): boolean;
package/package.json CHANGED
@@ -1,76 +1,71 @@
1
- {
2
- "name": "@arex95/vue-core",
3
- "version": "1.1.41",
4
- "description": "Opinionated Vue Core",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "exports": {
8
- "import": "./dist/index.mjs"
9
- },
10
- "types": "dist/index.d.ts",
11
- "type": "module",
12
- "files": [
13
- "dist"
14
- ],
15
- "scripts": {
16
- "build": "rollup -c",
17
- "changelog": "conventional-changelog -p angular -o CHANGELOG.md -r 0",
18
- "release": "npm version patch && npm run changelog && git add CHANGELOG.md package.json pnpm-lock.yaml && git commit -m \"chore(release): update changelog\" && git push && npm publish --access public",
19
- "test": "vitest",
20
- "test:watch": "vitest --watch",
21
- "test:ui": "vitest --ui"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "https://github.com/Arex95/npm-arex-core.git"
26
- },
27
- "keywords": [
28
- "vue",
29
- "composables",
30
- "core",
31
- "npm"
32
- ],
33
- "author": "Arturo Rafael Serrano Girón",
34
- "license": "MIT",
35
- "peerDependencies": {
36
- "@tanstack/vue-query": ">=5.0.0",
37
- "@vueuse/core": ">=12.8.2",
38
- "axios": ">=1.6.0",
39
- "jwt-decode": "^4.0.0",
40
- "uuid": ">=11.1.0",
41
- "vue": ">=3.0.0",
42
- "vue-router": ">=4.5.0"
43
- },
44
- "devDependencies": {
45
- "@eslint/js": "^9.23.0",
46
- "@rollup/plugin-commonjs": "^28.0.3",
47
- "@rollup/plugin-json": "^6.1.0",
48
- "@rollup/plugin-node-resolve": "^16.0.0",
49
- "@rollup/plugin-typescript": "^12.1.2",
50
- "@types/crypto-js": "^4.2.2",
51
- "@types/node": "^22.13.10",
52
- "@vitest/spy": "^3.2.3",
53
- "@vitest/ui": "^3.2.3",
54
- "@vue/test-utils": "^2.4.6",
55
- "conventional-changelog-cli": "^5.0.0",
56
- "eslint": "^9.23.0",
57
- "eslint-plugin-vue": "^10.0.0",
58
- "globals": "^16.0.0",
59
- "jsdom": "^26.1.0",
60
- "rollup": "^4.35.0",
61
- "ts-node": "^10.9.2",
62
- "tslib": "^2.8.1",
63
- "typescript": "^5.8.2",
64
- "typescript-eslint": "^8.28.0",
65
- "vitest": "^3.2.3"
66
- },
67
- "dependencies": {
68
- "@tanstack/vue-query": ">=5.0.0",
69
- "@vueuse/core": ">=12.8.2",
70
- "axios": ">=1.6.0",
71
- "jwt-decode": "^4.0.0",
72
- "uuid": ">=11.1.0",
73
- "vue": ">=3.0.0",
74
- "vue-router": ">=4.5.0"
75
- }
76
- }
1
+ {
2
+ "name": "@arex95/vue-core",
3
+ "version": "3.0.0",
4
+ "description": "Opinionated Vue Core",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.js"
12
+ }
13
+ },
14
+ "types": "dist/index.d.ts",
15
+ "type": "module",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "rollup -c",
21
+ "changelog": "conventional-changelog -p angular -o CHANGELOG.md -r 0",
22
+ "release": "npm version patch && npm run changelog && git add CHANGELOG.md package.json pnpm-lock.yaml && git commit -m \"chore(release): update changelog\" && git push && npm publish --access public",
23
+ "release:major": "npm version major && npm run changelog && git add CHANGELOG.md package.json pnpm-lock.yaml && git commit -m \"chore(release): update changelog\" && git push && npm publish --access public",
24
+ "release:minor": "npm version minor && npm run changelog && git add CHANGELOG.md package.json pnpm-lock.yaml && git commit -m \"chore(release): update changelog\" && git push && npm publish --access public"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/Arex95/npm-arex-core.git"
29
+ },
30
+ "keywords": [
31
+ "vue",
32
+ "composables",
33
+ "core",
34
+ "npm"
35
+ ],
36
+ "author": "Arturo Rafael Serrano Girón",
37
+ "license": "MIT",
38
+ "peerDependencies": {
39
+ "@vueuse/core": ">=12.8.2",
40
+ "axios": ">=1.6.0",
41
+ "jwt-decode": "^4.0.0",
42
+ "ofetch": ">=1.0.0",
43
+ "uuid": ">=11.1.0",
44
+ "vue": ">=3.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@eslint/js": "^9.23.0",
48
+ "@rollup/plugin-commonjs": "^28.0.3",
49
+ "@rollup/plugin-json": "^6.1.0",
50
+ "@rollup/plugin-node-resolve": "^16.0.0",
51
+ "@rollup/plugin-typescript": "^12.1.2",
52
+ "@types/crypto-js": "^4.2.2",
53
+ "@types/node": "^22.13.10",
54
+ "conventional-changelog-cli": "^5.0.0",
55
+ "eslint": "^9.23.0",
56
+ "eslint-plugin-vue": "^10.0.0",
57
+ "globals": "^16.0.0",
58
+ "rollup": "^4.35.0",
59
+ "ts-node": "^10.9.2",
60
+ "tslib": "^2.8.1",
61
+ "typescript": "^5.8.2",
62
+ "typescript-eslint": "^8.28.0"
63
+ },
64
+ "dependencies": {
65
+ "@vueuse/core": ">=12.8.2",
66
+ "axios": ">=1.6.0",
67
+ "jwt-decode": "^4.0.0",
68
+ "uuid": ">=11.1.0",
69
+ "vue": ">=3.0.0"
70
+ }
71
+ }
@@ -1,9 +0,0 @@
1
- import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
- import { UseQueryOptions } from '@tanstack/vue-query';
3
- /**
4
- * Creates a fetchComposable for Axios requests with an optional custom instance.
5
- * @param fetchComposable - The composable to use for the request (can be any fetch function).
6
- * @param axiosCustomInstance - An optional custom Axios instance to use for the request.
7
- * @returns A function that handles the request using the provided composable.
8
- */
9
- export declare function createFetch(fetchComposable: Function, axiosCustomInstance?: AxiosInstance): (axiosRequestConfig: AxiosRequestConfig, options?: UseQueryOptions) => any;
@@ -1,31 +0,0 @@
1
- import { TokenConfig } from "@/types";
2
- /**
3
- * Configures the global keys for access and refresh tokens.
4
- * Once set, they cannot be modified.
5
- *
6
- * @param {string} accessTokenKey - The name of the access token key.
7
- * @param {string} refreshTokenKey - The name of the refresh token key.
8
- *
9
- * @returns {void} Does not return anything but freezes the token configuration object.
10
- */
11
- export declare function configTokens(accessTokenKey: string, refreshTokenKey: string): void;
12
- /**
13
- * Retrieves the current token configuration.
14
- *
15
- * @returns {TokenConfig} The configuration of the access and refresh token keys.
16
- */
17
- export declare function getTokenConfig(): TokenConfig;
18
- /**
19
- * Sets the secret key for use in authentication.
20
- *
21
- * @param {string} key - The new secret key.
22
- *
23
- * @returns {void} Does not return anything, but updates the secret key.
24
- */
25
- export declare function setSecretKey(key: string): void;
26
- /**
27
- * Retrieves the current secret key.
28
- *
29
- * @returns {string} The configured secret key.
30
- */
31
- export declare function getSecretKey(): string;
@@ -1,31 +0,0 @@
1
- /**
2
- * Object defining available screen sizes as constants.
3
- * @readonly
4
- */
5
- export declare const sizeEnum: {
6
- readonly XS: "XS";
7
- readonly SM: "SM";
8
- readonly MD: "MD";
9
- readonly LG: "LG";
10
- readonly XL: "XL";
11
- readonly XXL: "XXL";
12
- };
13
- /**
14
- * Object defining breakpoints for design based on screen width.
15
- * Values are in pixels.
16
- * @readonly
17
- */
18
- export declare const screenEnum: {
19
- readonly XS: 480;
20
- readonly SM: 576;
21
- readonly MD: 768;
22
- readonly LG: 992;
23
- readonly XL: 1200;
24
- readonly XXL: 1600;
25
- };
26
- /**
27
- * Map that associates each screen size defined in `sizeEnum` with its corresponding pixel value from `screenEnum`.
28
- * @type {Map<typeof sizeEnum[keyof typeof sizeEnum], number>}
29
- */
30
- declare const screenMap: Map<"XS" | "SM" | "MD" | "LG" | "XL" | "XXL", number>;
31
- export { screenMap };
@@ -1,3 +0,0 @@
1
- import { ErrorType } from '@/types';
2
- export declare const ERROR_MESSAGES: Record<ErrorType, string>;
3
- export declare const ERROR_STYLES: Record<ErrorType, string>;
@@ -1,30 +0,0 @@
1
- /**
2
- * Object defining various exception codes.
3
- * @readonly
4
- */
5
- export declare const ExceptionEnum: {
6
- /**
7
- * HTTP status code for page access forbidden.
8
- */
9
- readonly PAGE_NOT_ACCESS: 403;
10
- /**
11
- * HTTP status code for page not found.
12
- */
13
- readonly PAGE_NOT_FOUND: 404;
14
- /**
15
- * HTTP status code for general server error.
16
- */
17
- readonly ERROR: 500;
18
- /**
19
- * HTTP status code for bad request.
20
- */
21
- readonly BAD_REQUEST: 406;
22
- /**
23
- * Custom error code for network errors.
24
- */
25
- readonly NET_WORK_ERROR: 10000;
26
- /**
27
- * Custom code indicating no data on the page, not actually an exception page.
28
- */
29
- readonly PAGE_NOT_DATA: 10100;
30
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * Object defining various image MIME types.
3
- * @readonly
4
- */
5
- export declare const ImageTypes: {
6
- readonly apng: "image/apng";
7
- readonly bmp: "image/bmp";
8
- readonly gif: "image/gif";
9
- readonly jpeg: "image/jpeg";
10
- readonly pjpeg: "image/pjpeg";
11
- readonly png: "image/png";
12
- readonly svg: "image/svg+xml";
13
- readonly tiff: "image/tiff";
14
- readonly webp: "image/webp";
15
- readonly xicon: "image/x-icon";
16
- };
17
- /**
18
- * Object defining various file meta types.
19
- * @readonly
20
- */
21
- export declare const FileMetaTypes: {
22
- readonly images: "image/*";
23
- readonly audios: "audio/*";
24
- readonly videos: "video/*";
25
- };
@@ -1,21 +0,0 @@
1
- /**
2
- * Object representing different content types for HTTP headers.
3
- * @readonly
4
- */
5
- export declare const ContentTypeEnum: {
6
- /**
7
- * Content type for JSON.
8
- * @constant
9
- */
10
- readonly JSON: "application/json;charset=UTF-8";
11
- /**
12
- * Content type for URL-encoded form data.
13
- * @constant
14
- */
15
- readonly 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
- readonly FORM_DATA: "multipart/form-data;charset=UTF-8";
21
- };
@@ -1,7 +0,0 @@
1
- export * from './breakpointEnum';
2
- export * from './exceptionEnum';
3
- export * from './fileTypesEnum';
4
- export * from './httpEnum';
5
- export * from './keyCodeEnum';
6
- export * from './storageEnum';
7
- export * from './errorsEnum';
@@ -1,10 +0,0 @@
1
- /**
2
- * Object defining various key codes for keyboard events.
3
- * @readonly
4
- */
5
- export declare const KeyCodeEnum: {
6
- readonly UP: 38;
7
- readonly DOWN: 40;
8
- readonly ENTER: 13;
9
- readonly ESC: 27;
10
- };