dymo-api 1.1.0 → 1.1.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.
@@ -67,7 +67,7 @@ const convertTailwindToInlineCss = (htmlContent) => {
67
67
  const isValidData = async (token, data) => {
68
68
  if (token === null)
69
69
  throw customError(3000, "Invalid private token.");
70
- if (!Object.keys(data).some((key) => ["email", "phone", "domain", "creditCard", "ip", "wallet"].includes(key) && data.hasOwnProperty(key)))
70
+ if (!Object.keys(data).some((key) => ["url", "email", "phone", "domain", "creditCard", "ip", "wallet"].includes(key) && data.hasOwnProperty(key)))
71
71
  throw customError(1500, "You must provide at least one parameter.");
72
72
  try {
73
73
  const response = await config_1.axiosApiUrl.post("/private/secure/verify", data, { headers: { "Content-Type": "application/json", "Authorization": token } });
@@ -72,6 +72,7 @@ class DymoAPI {
72
72
  * If neither is set, it will throw an error.
73
73
  *
74
74
  * @param {Object} data - The data to be validated.
75
+ * @param {string} [data.url] - Optional URL to be validated.
75
76
  * @param {string} [data.email] - Optional email address to be validated.
76
77
  * @param {Interfaces.PhoneData} [data.phone] - Optional phone number data to be validated.
77
78
  * @param {string} [data.domain] - Optional domain name to be validated.
@@ -28,7 +28,7 @@ const convertTailwindToInlineCss = (htmlContent) => {
28
28
  export const isValidData = async (token, data) => {
29
29
  if (token === null)
30
30
  throw customError(3000, "Invalid private token.");
31
- if (!Object.keys(data).some((key) => ["email", "phone", "domain", "creditCard", "ip", "wallet"].includes(key) && data.hasOwnProperty(key)))
31
+ if (!Object.keys(data).some((key) => ["url", "email", "phone", "domain", "creditCard", "ip", "wallet"].includes(key) && data.hasOwnProperty(key)))
32
32
  throw customError(1500, "You must provide at least one parameter.");
33
33
  try {
34
34
  const response = await axiosApiUrl.post("/private/secure/verify", data, { headers: { "Content-Type": "application/json", "Authorization": token } });
@@ -37,6 +37,7 @@ class DymoAPI {
37
37
  * If neither is set, it will throw an error.
38
38
  *
39
39
  * @param {Object} data - The data to be validated.
40
+ * @param {string} [data.url] - Optional URL to be validated.
40
41
  * @param {string} [data.email] - Optional email address to be validated.
41
42
  * @param {Interfaces.PhoneData} [data.phone] - Optional phone number data to be validated.
42
43
  * @param {string} [data.domain] - Optional domain name to be validated.
@@ -34,6 +34,7 @@ declare class DymoAPI {
34
34
  * If neither is set, it will throw an error.
35
35
  *
36
36
  * @param {Object} data - The data to be validated.
37
+ * @param {string} [data.url] - Optional URL to be validated.
37
38
  * @param {string} [data.email] - Optional email address to be validated.
38
39
  * @param {Interfaces.PhoneData} [data.phone] - Optional phone number data to be validated.
39
40
  * @param {string} [data.domain] - Optional domain name to be validated.
@@ -11,6 +11,7 @@ export interface CreditCardData {
11
11
  }
12
12
  export type VerifyPlugins = "blocklist" | "compromiseDetector" | "nsfw" | "reputation" | "torNetwork" | "typosquatting" | "urlShortener";
13
13
  export interface Validator {
14
+ url?: string;
14
15
  email?: string;
15
16
  phone?: PhoneData;
16
17
  domain?: string;
@@ -164,6 +165,23 @@ export interface PasswordValidationResult {
164
165
  details: ValidationDetail[];
165
166
  }
166
167
  export interface DataValidationAnalysis {
168
+ url: {
169
+ valid: boolean;
170
+ fraud: boolean;
171
+ freeSubdomain: boolean;
172
+ customTLD: boolean;
173
+ url: string;
174
+ domain: string;
175
+ plugins: {
176
+ blocklist?: boolean;
177
+ compromiseDetector?: boolean;
178
+ nsfw?: boolean;
179
+ reputation?: "low" | "medium" | "high" | "very-high" | "education" | "governmental" | "unknown";
180
+ torNetwork?: boolean;
181
+ typosquatting?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
182
+ urlShortener?: boolean;
183
+ };
184
+ };
167
185
  email: {
168
186
  valid: boolean;
169
187
  fraud: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dymo-api",
3
- "version": "1.1.00",
3
+ "version": "1.1.01",
4
4
  "description": "Flow system for Dymo API.",
5
5
  "main": "dist/cjs/dymo-api.js",
6
6
  "module": "dist/esm/dymo-api.js",