dymo-api 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/public-api.cjs +9 -1
- package/package.json +2 -2
package/lib/public-api.cjs
CHANGED
|
@@ -25,7 +25,7 @@ exports.inputSatinizer = async (data) => {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
exports.isValidPwd = async (data) => {
|
|
28
|
-
|
|
28
|
+
var { email, password, bannedWords, min, max } = data;
|
|
29
29
|
if (!password) throw customError(1000, "You must specify at least the password.");
|
|
30
30
|
const params = {
|
|
31
31
|
password: encodeURIComponent(password),
|
|
@@ -34,6 +34,14 @@ exports.isValidPwd = async (data) => {
|
|
|
34
34
|
if (!/^[a-zA-Z0-9._\-+]+@?[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(email)) throw customError(1500, "If you provide an email address it must be valid.");
|
|
35
35
|
params.email = encodeURIComponent(email);
|
|
36
36
|
}
|
|
37
|
+
if (bannedWords && typeof bannedWords === 'string') bannedWords = bannedWords.slice(1, -1).trim().split(',').map(item => item.trim());
|
|
38
|
+
if (bannedWords && (!Array.isArray(bannedWords) || bannedWords.length > 10)) throw customError(1500, "If you provide a list of banned words; the list may not exceed 10 words and must be of array type.");
|
|
39
|
+
if (bannedWords && (!bannedWords.every(word => typeof word === 'string') || new Set(bannedWords).size !== bannedWords.length)) throw customError(1500, "If you provide a list of banned words; all elements must be non-repeated strings.");
|
|
40
|
+
if (bannedWords) params.bannedWords = bannedWords;
|
|
41
|
+
if (min && (!Number.isInteger(min) && min < 8 && min > 32)) throw customError(1500, "If you provide a minimum it must be valid.");
|
|
42
|
+
if (max && (!Number.isInteger(max) && max < 32 && max > 100)) throw customError(1500, "If you provide a maximum it must be valid.");
|
|
43
|
+
if (min) params.min = min;
|
|
44
|
+
if (max) params.max = max;
|
|
37
45
|
try {
|
|
38
46
|
const response = await axios.get(`https://api.tpeoficial.com/public/validPwd`, { params });
|
|
39
47
|
return response.data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dymo-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Flow system for Dymo API.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"axios": "^1.6.8"
|
|
27
27
|
},
|
|
28
28
|
"contributors": [
|
|
29
|
-
"
|
|
29
|
+
"TPEOficial (https://github.com/TPEOficial)",
|
|
30
30
|
"FJRG2007 (https://github.com/FJRG2007)"
|
|
31
31
|
]
|
|
32
32
|
}
|