dymo-api 1.1.1 → 1.1.2
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/dist/cjs/branches/private.cjs +2 -2
- package/dist/cjs/dymo-api.cjs +1 -0
- package/dist/esm/branches/private.js +2 -2
- package/dist/esm/dymo-api.js +1 -0
- package/dist/types/branches/private.d.ts +1 -1
- package/dist/types/dymo-api.d.ts +1 -0
- package/dist/types/lib/interfaces.d.ts +15 -0
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ const convertTailwindToInlineCss = (htmlContent) => {
|
|
|
57
57
|
*
|
|
58
58
|
* @param token - A string or null representing the authentication token. Must not be null.
|
|
59
59
|
* @param data - An object adhering to the Validator interface, containing at least one of the following fields:
|
|
60
|
-
* email, phone, domain, creditCard, ip, or
|
|
60
|
+
* url, email, phone, domain, creditCard, ip, wallet or user agent.
|
|
61
61
|
*
|
|
62
62
|
* @returns A promise that resolves to the response data from the verification endpoint.
|
|
63
63
|
*
|
|
@@ -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) => ["url", "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", "userAgent"].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 } });
|
package/dist/cjs/dymo-api.cjs
CHANGED
|
@@ -79,6 +79,7 @@ class DymoAPI {
|
|
|
79
79
|
* @param {string|Interfaces.CreditCardData} [data.creditCard] - Optional credit card number or data to be validated.
|
|
80
80
|
* @param {string} [data.ip] - Optional IP address to be validated.
|
|
81
81
|
* @param {string} [data.wallet] - Optional wallet address to be validated.
|
|
82
|
+
* @param {string} [data.userAgent] - Optional user agent string to be validated.
|
|
82
83
|
* @param {Interfaces.VerifyPlugins[]} [data.plugins] - Optional array of verification plugins to be used.
|
|
83
84
|
* @returns {Promise<Interfaces.DataValidationAnalysis>} A promise that resolves to the response from the server.
|
|
84
85
|
* @throws Will throw an error if there is an issue with the validation process.
|
|
@@ -18,7 +18,7 @@ const convertTailwindToInlineCss = (htmlContent) => {
|
|
|
18
18
|
*
|
|
19
19
|
* @param token - A string or null representing the authentication token. Must not be null.
|
|
20
20
|
* @param data - An object adhering to the Validator interface, containing at least one of the following fields:
|
|
21
|
-
* email, phone, domain, creditCard, ip, or
|
|
21
|
+
* url, email, phone, domain, creditCard, ip, wallet or user agent.
|
|
22
22
|
*
|
|
23
23
|
* @returns A promise that resolves to the response data from the verification endpoint.
|
|
24
24
|
*
|
|
@@ -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) => ["url", "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", "userAgent"].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 } });
|
package/dist/esm/dymo-api.js
CHANGED
|
@@ -44,6 +44,7 @@ class DymoAPI {
|
|
|
44
44
|
* @param {string|Interfaces.CreditCardData} [data.creditCard] - Optional credit card number or data to be validated.
|
|
45
45
|
* @param {string} [data.ip] - Optional IP address to be validated.
|
|
46
46
|
* @param {string} [data.wallet] - Optional wallet address to be validated.
|
|
47
|
+
* @param {string} [data.userAgent] - Optional user agent string to be validated.
|
|
47
48
|
* @param {Interfaces.VerifyPlugins[]} [data.plugins] - Optional array of verification plugins to be used.
|
|
48
49
|
* @returns {Promise<Interfaces.DataValidationAnalysis>} A promise that resolves to the response from the server.
|
|
49
50
|
* @throws Will throw an error if there is an issue with the validation process.
|
|
@@ -4,7 +4,7 @@ import * as Interfaces from "../lib/interfaces";
|
|
|
4
4
|
*
|
|
5
5
|
* @param token - A string or null representing the authentication token. Must not be null.
|
|
6
6
|
* @param data - An object adhering to the Validator interface, containing at least one of the following fields:
|
|
7
|
-
* email, phone, domain, creditCard, ip, or
|
|
7
|
+
* url, email, phone, domain, creditCard, ip, wallet or user agent.
|
|
8
8
|
*
|
|
9
9
|
* @returns A promise that resolves to the response data from the verification endpoint.
|
|
10
10
|
*
|
package/dist/types/dymo-api.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare class DymoAPI {
|
|
|
41
41
|
* @param {string|Interfaces.CreditCardData} [data.creditCard] - Optional credit card number or data to be validated.
|
|
42
42
|
* @param {string} [data.ip] - Optional IP address to be validated.
|
|
43
43
|
* @param {string} [data.wallet] - Optional wallet address to be validated.
|
|
44
|
+
* @param {string} [data.userAgent] - Optional user agent string to be validated.
|
|
44
45
|
* @param {Interfaces.VerifyPlugins[]} [data.plugins] - Optional array of verification plugins to be used.
|
|
45
46
|
* @returns {Promise<Interfaces.DataValidationAnalysis>} A promise that resolves to the response from the server.
|
|
46
47
|
* @throws Will throw an error if there is an issue with the validation process.
|
|
@@ -18,6 +18,7 @@ export interface Validator {
|
|
|
18
18
|
creditCard?: string | CreditCardData;
|
|
19
19
|
ip?: string;
|
|
20
20
|
wallet?: string;
|
|
21
|
+
userAgent?: string;
|
|
21
22
|
plugins?: VerifyPlugins[];
|
|
22
23
|
}
|
|
23
24
|
export interface SRNG {
|
|
@@ -291,6 +292,20 @@ export interface DataValidationAnalysis {
|
|
|
291
292
|
torNetwork?: boolean;
|
|
292
293
|
};
|
|
293
294
|
};
|
|
295
|
+
userAgent: {
|
|
296
|
+
valid: boolean;
|
|
297
|
+
type?: string;
|
|
298
|
+
clientSlug?: string | null;
|
|
299
|
+
clientName?: string;
|
|
300
|
+
version?: string | null;
|
|
301
|
+
userAgent?: string;
|
|
302
|
+
fraud?: boolean;
|
|
303
|
+
isRealUser?: boolean;
|
|
304
|
+
info?: string;
|
|
305
|
+
plugins?: {
|
|
306
|
+
blocklist?: boolean;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
294
309
|
}
|
|
295
310
|
export type SchemaType = "string" | "number" | "boolean" | "array" | "object";
|
|
296
311
|
export interface JsonSchemaProperty {
|