@arex95/vue-core 1.1.43 → 3.0.1

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 (74) hide show
  1. package/README.md +90 -57
  2. package/dist/composables/auth/useAuth.d.ts +20 -6
  3. package/dist/composables/axios/axiosFetch.d.ts +7 -5
  4. package/dist/composables/axios/index.d.ts +0 -1
  5. package/dist/composables/axios/useFetch.d.ts +14 -5
  6. package/dist/composables/breakpoints/useBreakpoint.d.ts +11 -2
  7. package/dist/composables/filters/useFilter.d.ts +13 -8
  8. package/dist/composables/monitoring/useApiActivity.d.ts +17 -6
  9. package/dist/composables/monitoring/useUserActivity.d.ts +20 -5
  10. package/dist/composables/paginators/usePaginator.d.ts +13 -5
  11. package/dist/composables/sorters/useSorter.d.ts +13 -7
  12. package/dist/config/auth/authFetcher.d.ts +30 -0
  13. package/dist/config/auth/index.d.ts +1 -0
  14. package/dist/config/axios/axiosConfig.d.ts +30 -0
  15. package/dist/config/axios/axiosInstance.d.ts +15 -1
  16. package/dist/config/global/endpointsConfig.d.ts +9 -13
  17. package/dist/config/global/keyConfig.d.ts +7 -10
  18. package/dist/config/global/sessionConfig.d.ts +15 -17
  19. package/dist/config/global/tokenPathsConfig.d.ts +17 -18
  20. package/dist/config/global/tokensConfig.d.ts +9 -9
  21. package/dist/config/index.d.ts +1 -0
  22. package/dist/enums/breakpointsEnums.d.ts +7 -4
  23. package/dist/enums/errorsEnums.d.ts +26 -19
  24. package/dist/enums/fileTypesEnums.d.ts +33 -1
  25. package/dist/enums/httpExceptionsEnums.d.ts +3 -1
  26. package/dist/enums/keyCodesEnums.d.ts +2 -4
  27. package/dist/enums/storageEnums.d.ts +4 -4
  28. package/dist/errors/AuthError.d.ts +10 -0
  29. package/dist/errors/BaseError.d.ts +16 -0
  30. package/dist/errors/NetworkError.d.ts +9 -0
  31. package/dist/errors/ServerError.d.ts +10 -0
  32. package/dist/errors/ValidationError.d.ts +14 -0
  33. package/dist/errors/index.d.ts +5 -0
  34. package/dist/fetchers/axios.d.ts +22 -0
  35. package/dist/fetchers/index.d.ts +2 -0
  36. package/dist/fetchers/ofetch.d.ts +33 -0
  37. package/dist/index.d.ts +8 -6
  38. package/dist/index.mjs +1631 -875
  39. package/dist/rest/RestStd.d.ts +146 -102
  40. package/dist/services/credentials.d.ts +24 -29
  41. package/dist/services/extractTokens.d.ts +7 -6
  42. package/dist/services/refreshTokens.d.ts +11 -12
  43. package/dist/services/storeTokens.d.ts +8 -6
  44. package/dist/types/AppKeyConfig.d.ts +7 -0
  45. package/dist/types/ArexVueCoreOptions.d.ts +20 -0
  46. package/dist/types/Auth.d.ts +15 -0
  47. package/dist/types/AxiosOptionsParameter.d.ts +14 -7
  48. package/dist/types/AxiosServiceOptions.d.ts +9 -0
  49. package/dist/types/DecodedJwtPayload.d.ts +12 -0
  50. package/dist/types/EndpointsConfig.d.ts +7 -0
  51. package/dist/types/ErrorType.d.ts +4 -2
  52. package/dist/types/ExtendedQueryOptions.d.ts +10 -0
  53. package/dist/types/Fetcher.d.ts +24 -0
  54. package/dist/types/RestStdOptions.d.ts +62 -0
  55. package/dist/types/SessionConfig.d.ts +25 -1
  56. package/dist/types/TokenConfig.d.ts +7 -0
  57. package/dist/types/TokenValidationResult.d.ts +7 -0
  58. package/dist/types/index.d.ts +2 -0
  59. package/dist/utils/browser.d.ts +20 -14
  60. package/dist/utils/dates.d.ts +47 -34
  61. package/dist/utils/debounces.d.ts +54 -32
  62. package/dist/utils/encryption.d.ts +28 -24
  63. package/dist/utils/errors.d.ts +27 -8
  64. package/dist/utils/exports.d.ts +24 -19
  65. package/dist/utils/files.d.ts +33 -25
  66. package/dist/utils/index.d.ts +3 -0
  67. package/dist/utils/io.d.ts +70 -54
  68. package/dist/utils/objects.d.ts +78 -60
  69. package/dist/utils/retry.d.ts +8 -0
  70. package/dist/utils/ssr.d.ts +27 -0
  71. package/dist/utils/storage.d.ts +20 -14
  72. package/dist/utils/strings.d.ts +42 -31
  73. package/dist/utils/validations.d.ts +76 -57
  74. package/package.json +7 -16
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@arex95/vue-core",
3
- "version": "1.1.43",
3
+ "version": "3.0.1",
4
4
  "description": "Opinionated Vue Core",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,9 +20,8 @@
20
20
  "build": "rollup -c",
21
21
  "changelog": "conventional-changelog -p angular -o CHANGELOG.md -r 0",
22
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
- "test": "vitest",
24
- "test:watch": "vitest --watch",
25
- "test:ui": "vitest --ui"
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"
26
25
  },
27
26
  "repository": {
28
27
  "type": "git",
@@ -37,13 +36,12 @@
37
36
  "author": "Arturo Rafael Serrano Girón",
38
37
  "license": "MIT",
39
38
  "peerDependencies": {
40
- "@tanstack/vue-query": ">=5.0.0",
41
39
  "@vueuse/core": ">=12.8.2",
42
40
  "axios": ">=1.6.0",
43
41
  "jwt-decode": "^4.0.0",
42
+ "ofetch": ">=1.0.0",
44
43
  "uuid": ">=11.1.0",
45
- "vue": ">=3.0.0",
46
- "vue-router": ">=4.5.0"
44
+ "vue": ">=3.0.0"
47
45
  },
48
46
  "devDependencies": {
49
47
  "@eslint/js": "^9.23.0",
@@ -53,28 +51,21 @@
53
51
  "@rollup/plugin-typescript": "^12.1.2",
54
52
  "@types/crypto-js": "^4.2.2",
55
53
  "@types/node": "^22.13.10",
56
- "@vitest/spy": "^3.2.3",
57
- "@vitest/ui": "^3.2.3",
58
- "@vue/test-utils": "^2.4.6",
59
54
  "conventional-changelog-cli": "^5.0.0",
60
55
  "eslint": "^9.23.0",
61
56
  "eslint-plugin-vue": "^10.0.0",
62
57
  "globals": "^16.0.0",
63
- "jsdom": "^26.1.0",
64
58
  "rollup": "^4.35.0",
65
59
  "ts-node": "^10.9.2",
66
60
  "tslib": "^2.8.1",
67
61
  "typescript": "^5.8.2",
68
- "typescript-eslint": "^8.28.0",
69
- "vitest": "^3.2.3"
62
+ "typescript-eslint": "^8.28.0"
70
63
  },
71
64
  "dependencies": {
72
- "@tanstack/vue-query": ">=5.0.0",
73
65
  "@vueuse/core": ">=12.8.2",
74
66
  "axios": ">=1.6.0",
75
67
  "jwt-decode": "^4.0.0",
76
68
  "uuid": ">=11.1.0",
77
- "vue": ">=3.0.0",
78
- "vue-router": ">=4.5.0"
69
+ "vue": ">=3.0.0"
79
70
  }
80
71
  }