dymo-api 1.2.5 → 1.2.7

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 (59) hide show
  1. package/dist/cjs/branches/private/functions/extractWithTextly/index.cjs +33 -0
  2. package/dist/cjs/branches/private/functions/getRandom/index.cjs +37 -0
  3. package/dist/cjs/branches/private/functions/isValidData/index.cjs +33 -0
  4. package/dist/cjs/branches/private/functions/isValidEmail/index.cjs +82 -0
  5. package/dist/cjs/branches/private/functions/protectReq/index.cjs +74 -0
  6. package/dist/cjs/branches/private/functions/protectReq/requestHandler.cjs +22 -0
  7. package/dist/cjs/branches/private/functions/sendEmail/index.cjs +88 -0
  8. package/dist/cjs/branches/private/index.cjs +22 -0
  9. package/dist/cjs/branches/public/functions/getPrayerTimes/index.cjs +31 -0
  10. package/dist/cjs/branches/public/functions/isValidPwd/index.cjs +65 -0
  11. package/dist/cjs/branches/public/functions/satinize/index.cjs +26 -0
  12. package/dist/cjs/branches/public/index.cjs +19 -0
  13. package/dist/cjs/config/index.cjs +0 -21
  14. package/dist/cjs/dymo-api.cjs +68 -16
  15. package/dist/cjs/lib/types/interfaces.cjs +2 -1
  16. package/dist/cjs/lib/types/well-known-bots.cjs +739 -0
  17. package/dist/cjs/utils/basics.cjs +18 -0
  18. package/dist/esm/branches/private/functions/extractWithTextly/index.js +29 -0
  19. package/dist/esm/branches/private/functions/getRandom/index.js +33 -0
  20. package/dist/esm/branches/private/functions/isValidData/index.js +29 -0
  21. package/dist/esm/branches/private/functions/isValidEmail/index.js +78 -0
  22. package/dist/esm/branches/private/functions/protectReq/index.js +37 -0
  23. package/dist/esm/branches/private/functions/protectReq/requestHandler.js +18 -0
  24. package/dist/esm/branches/private/functions/sendEmail/index.js +81 -0
  25. package/dist/esm/branches/private/index.js +6 -0
  26. package/dist/esm/branches/public/functions/getPrayerTimes/index.js +27 -0
  27. package/dist/esm/branches/{public.js → public/functions/isValidPwd/index.js} +28 -30
  28. package/dist/esm/branches/public/functions/satinize/index.js +22 -0
  29. package/dist/esm/branches/public/index.js +3 -0
  30. package/dist/esm/config/index.js +0 -15
  31. package/dist/esm/dymo-api.js +65 -16
  32. package/dist/esm/lib/types/interfaces.js +2 -1
  33. package/dist/esm/lib/types/well-known-bots.js +736 -0
  34. package/dist/esm/utils/basics.js +10 -0
  35. package/dist/types/branches/private/functions/extractWithTextly/index.d.ts +16 -0
  36. package/dist/types/branches/private/functions/getRandom/index.d.ts +16 -0
  37. package/dist/types/branches/private/functions/isValidData/index.d.ts +15 -0
  38. package/dist/types/branches/private/functions/isValidEmail/index.d.ts +20 -0
  39. package/dist/types/branches/private/functions/protectReq/index.d.ts +3 -0
  40. package/dist/types/branches/private/functions/protectReq/requestHandler.d.ts +22 -0
  41. package/dist/types/branches/private/functions/sendEmail/index.d.ts +18 -0
  42. package/dist/types/branches/private/index.d.ts +6 -0
  43. package/dist/types/branches/public/functions/getPrayerTimes/index.d.ts +17 -0
  44. package/dist/types/branches/public/functions/isValidPwd/index.d.ts +28 -0
  45. package/dist/types/branches/public/functions/satinize/index.d.ts +12 -0
  46. package/dist/types/branches/public/index.d.ts +3 -0
  47. package/dist/types/config/index.d.ts +0 -4
  48. package/dist/types/dymo-api.d.ts +38 -3
  49. package/dist/types/lib/types/interfaces.d.ts +2 -3
  50. package/dist/types/lib/types/primitives.d.ts +7 -0
  51. package/dist/types/lib/types/rules.d.ts +12 -0
  52. package/dist/types/lib/types/well-known-bots.d.ts +4 -0
  53. package/dist/types/utils/basics.d.ts +2 -0
  54. package/package.json +13 -5
  55. package/dist/cjs/branches/private.cjs +0 -284
  56. package/dist/cjs/branches/public.cjs +0 -102
  57. package/dist/esm/branches/private.js +0 -240
  58. package/dist/types/branches/private.d.ts +0 -76
  59. package/dist/types/branches/public.d.ts +0 -4
@@ -1,76 +0,0 @@
1
- import * as Interfaces from "../lib/types/interfaces";
2
- /**
3
- * Validates the provided data using a secure verification endpoint.
4
- *
5
- * @param token - A string or null representing the authentication token. Must not be null.
6
- * @param data - An object adhering to the Validator interface, containing at least one of the following fields:
7
- * url, email, phone, domain, creditCard, ip, wallet or user agent.
8
- *
9
- * @returns A promise that resolves to the response data from the verification endpoint.
10
- *
11
- * @throws Will throw an error if the token is null, if none of the required fields are present in the data,
12
- * or if an error occurs during the verification request.
13
- */
14
- export declare const isValidData: (token: string | null, data: Interfaces.Validator) => Promise<any>;
15
- /**
16
- * Validates an email using a secure verification endpoint.
17
- *
18
- * @param {string | null} token - Authentication token (required).
19
- * @param {Interfaces.EmailValidator} email - Email to validate.
20
- * @param {Interfaces.EmailValidatorRules} [rules] - Deny rules. Defaults to ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"].
21
- *
22
- * Deny rules (some are premium ⚠️):
23
- * - "FRAUD", "INVALID", "NO_MX_RECORDS" ⚠️, "PROXIED_EMAIL" ⚠️, "FREE_SUBDOMAIN" ⚠️,
24
- * "PERSONAL_EMAIL", "CORPORATE_EMAIL", "NO_REPLY_EMAIL", "ROLE_ACCOUNT", "NO_REACHABLE", "HIGH_RISK_SCORE" ⚠️
25
- *
26
- * @returns {Promise<boolean>} True if the email passes all deny rules, false otherwise.
27
- * @throws Error if token is null, rules are empty, or request fails.
28
- *
29
- * @example
30
- * const valid = await isValidEmail(apiToken, "user@example.com", { deny: ["FRAUD", "NO_MX_RECORDS"] });
31
- */
32
- export declare const isValidEmail: (token: string | null, email: Interfaces.EmailValidator, rules: Interfaces.EmailValidatorRules) => Promise<any>;
33
- /**
34
- * Sends an email using a secure sending endpoint.
35
- *
36
- * @param token - A string or null representing the authentication token. Must not be null.
37
- * @param data - An object adhering to the SendEmail interface, containing the following fields:
38
- * 'from', 'to', 'subject', 'html' or 'react', and optionally 'attachments', 'options', 'priority', 'waitToResponse', and 'composeTailwindClasses'.
39
- *
40
- * @returns A promise that resolves to the response data from the sending endpoint.
41
- *
42
- * @throws Will throw an error if the token is null, if any of the required fields are missing,
43
- * if the 'react' field is not a valid React element, if the 'attachments' field exceeds the maximum allowed size of 40 MB,
44
- * or if an error occurs during the sending request.
45
- */
46
- export declare const sendEmail: (token: string | null, data: Interfaces.SendEmail & {
47
- serverEmailConfig: Interfaces.ServerEmailConfig | undefined;
48
- }) => Promise<any>;
49
- /**
50
- * Retrieves a random number within a specified range using a secure endpoint.
51
- *
52
- * @param token - A string or null representing the authentication token. Must not be null.
53
- * @param data - An object adhering to the SRNG interface, containing 'min' and 'max' fields,
54
- * which define the inclusive range within which the random number should be generated.
55
- *
56
- * @returns A promise that resolves to the response data containing the random number.
57
- *
58
- * @throws Will throw an error if the token is null, if 'min' or 'max' are not defined,
59
- * if 'min' is not less than 'max', if 'min' or 'max' are out of the allowed range,
60
- * or if an error occurs during the request to the random number generator endpoint.
61
- */
62
- export declare const getRandom: (token: string | null, data: Interfaces.SRNG) => Promise<any>;
63
- /**
64
- * Extracts structured data from a given string using a secure endpoint.
65
- *
66
- * @param token - A string or null representing the authentication token. Must not be null.
67
- * @param data - An object adhering to the ExtractWithTextly interface, containing 'data' and 'format' fields.
68
- * The 'data' field is the string from which structured data should be extracted.
69
- * The 'format' field is an object defining the structure of the data to be extracted.
70
- *
71
- * @returns A promise that resolves to the response data containing the extracted structured data.
72
- *
73
- * @throws Will throw an error if the token is null, if 'data' or 'format' are not defined,
74
- * or if an error occurs during the request to the extraction endpoint.
75
- */
76
- export declare const extractWithTextly: (token: string | null, data: Interfaces.ExtractWithTextly) => Promise<any>;
@@ -1,4 +0,0 @@
1
- import * as Interfaces from "../lib/types/interfaces";
2
- export declare const getPrayerTimes: (data: Interfaces.PrayerTimesData) => Promise<any>;
3
- export declare const satinizer: (data: Interfaces.InputSatinizerData) => Promise<any>;
4
- export declare const isValidPwd: (data: Interfaces.IsValidPwdData) => Promise<any>;