hibp 15.2.1 → 16.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 (91) hide show
  1. package/API.md +433 -126
  2. package/CHANGELOG.md +52 -0
  3. package/MIGRATION.md +7 -5
  4. package/README.md +53 -27
  5. package/dist/browser/hibp.module.js +2 -2
  6. package/dist/esm/api/base-fetch.d.ts +9 -5
  7. package/dist/esm/api/base-fetch.js +17 -10
  8. package/dist/esm/api/base-fetch.js.map +1 -1
  9. package/dist/esm/api/haveibeenpwned/fetch-from-api.d.ts +1 -1
  10. package/dist/esm/api/haveibeenpwned/fetch-from-api.js +62 -44
  11. package/dist/esm/api/haveibeenpwned/fetch-from-api.js.map +1 -1
  12. package/dist/esm/api/haveibeenpwned/package-info.d.ts +1 -1
  13. package/dist/esm/api/haveibeenpwned/package-info.js +1 -1
  14. package/dist/esm/api/haveibeenpwned/post-to-api.d.ts +1 -0
  15. package/dist/esm/api/haveibeenpwned/post-to-api.js +23 -0
  16. package/dist/esm/api/haveibeenpwned/post-to-api.js.map +1 -0
  17. package/dist/esm/api/haveibeenpwned/responses.d.ts +0 -10
  18. package/dist/esm/api/haveibeenpwned/responses.js +5 -36
  19. package/dist/esm/api/haveibeenpwned/responses.js.map +1 -1
  20. package/dist/esm/api/haveibeenpwned/types.d.ts +22 -2
  21. package/dist/esm/api/haveibeenpwned/types.js +0 -3
  22. package/dist/esm/api/haveibeenpwned/types.js.map +1 -1
  23. package/dist/esm/api/pwnedpasswords/fetch-from-api.js +5 -28
  24. package/dist/esm/api/pwnedpasswords/fetch-from-api.js.map +1 -1
  25. package/dist/esm/api/pwnedpasswords/responses.d.ts +0 -6
  26. package/dist/esm/api/pwnedpasswords/responses.js +1 -7
  27. package/dist/esm/api/pwnedpasswords/responses.js.map +1 -1
  28. package/dist/esm/breach.d.ts +12 -5
  29. package/dist/esm/breach.js +8 -1
  30. package/dist/esm/breach.js.map +1 -1
  31. package/dist/esm/breached-account-range.d.ts +73 -0
  32. package/dist/esm/breached-account-range.js +60 -0
  33. package/dist/esm/breached-account-range.js.map +1 -0
  34. package/dist/esm/breached-account.d.ts +56 -45
  35. package/dist/esm/breached-account.js +4 -76
  36. package/dist/esm/breached-account.js.map +1 -1
  37. package/dist/esm/breached-domain.d.ts +7 -8
  38. package/dist/esm/breached-domain.js +2 -3
  39. package/dist/esm/breached-domain.js.map +1 -1
  40. package/dist/esm/breaches.d.ts +14 -7
  41. package/dist/esm/breaches.js +10 -5
  42. package/dist/esm/breaches.js.map +1 -1
  43. package/dist/esm/data-class-descriptions.d.ts +55 -0
  44. package/dist/esm/data-class-descriptions.js +39 -0
  45. package/dist/esm/data-class-descriptions.js.map +1 -0
  46. package/dist/esm/data-classes.d.ts +4 -4
  47. package/dist/esm/data-classes.js +2 -2
  48. package/dist/esm/data-classes.js.map +1 -1
  49. package/dist/esm/generate-dns-token.d.ts +67 -0
  50. package/dist/esm/generate-dns-token.js +49 -0
  51. package/dist/esm/generate-dns-token.js.map +1 -0
  52. package/dist/esm/hibp.d.ts +28 -18
  53. package/dist/esm/hibp.js +22 -28
  54. package/dist/esm/hibp.js.map +1 -1
  55. package/dist/esm/latest-breach.d.ts +5 -5
  56. package/dist/esm/latest-breach.js +2 -2
  57. package/dist/esm/latest-breach.js.map +1 -1
  58. package/dist/esm/paste-account.d.ts +13 -13
  59. package/dist/esm/paste-account.js +8 -8
  60. package/dist/esm/paste-account.js.map +1 -1
  61. package/dist/esm/pwned-password-range.d.ts +6 -6
  62. package/dist/esm/pwned-password-range.js +4 -6
  63. package/dist/esm/pwned-password-range.js.map +1 -1
  64. package/dist/esm/pwned-password.d.ts +5 -5
  65. package/dist/esm/pwned-password.js +12 -7
  66. package/dist/esm/pwned-password.js.map +1 -1
  67. package/dist/esm/search.d.ts +57 -40
  68. package/dist/esm/search.js +5 -74
  69. package/dist/esm/search.js.map +1 -1
  70. package/dist/esm/send-email.d.ts +69 -0
  71. package/dist/esm/send-email.js +49 -0
  72. package/dist/esm/send-email.js.map +1 -0
  73. package/dist/esm/stealer-logs-by-email-domain.d.ts +13 -14
  74. package/dist/esm/stealer-logs-by-email-domain.js +8 -9
  75. package/dist/esm/stealer-logs-by-email-domain.js.map +1 -1
  76. package/dist/esm/stealer-logs-by-email.d.ts +9 -10
  77. package/dist/esm/stealer-logs-by-email.js +5 -6
  78. package/dist/esm/stealer-logs-by-email.js.map +1 -1
  79. package/dist/esm/stealer-logs-by-website-domain.d.ts +9 -10
  80. package/dist/esm/stealer-logs-by-website-domain.js +5 -6
  81. package/dist/esm/stealer-logs-by-website-domain.js.map +1 -1
  82. package/dist/esm/subscribed-domains.d.ts +7 -8
  83. package/dist/esm/subscribed-domains.js +4 -5
  84. package/dist/esm/subscribed-domains.js.map +1 -1
  85. package/dist/esm/subscription-status.d.ts +16 -11
  86. package/dist/esm/subscription-status.js +13 -8
  87. package/dist/esm/subscription-status.js.map +1 -1
  88. package/dist/esm/verify-dns-token.d.ts +60 -0
  89. package/dist/esm/verify-dns-token.js +41 -0
  90. package/dist/esm/verify-dns-token.js.map +1 -0
  91. package/package.json +55 -56
@@ -1,22 +1,22 @@
1
- import type { Paste } from './api/haveibeenpwned/types.js';
1
+ import type { Paste } from "./api/haveibeenpwned/types.js";
2
2
  /**
3
3
  * An object representing a paste.
4
4
  *
5
5
  * @typedef {object} Paste
6
6
  * @property {string} Id
7
7
  * @property {string} Source
8
- * @property {string} Title
9
- * @property {string} Date
8
+ * @property {string} [Title] omitted when the source has no title
9
+ * @property {(string | null)} Date null when the source has no posting date
10
10
  * @property {number} EmailCount
11
11
  */
12
12
  /**
13
13
  * Fetches paste data for a specific account (email address).
14
14
  *
15
- * 🔑 `haveibeenpwned.com` requires an API key from
16
- * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The
17
- * `apiKey` option here is not explicitly required, but direct requests made
18
- * without it will fail (unless you specify a `baseUrl` to a proxy that inserts
19
- * a valid API key on your behalf).
15
+ * Requires a Core, Pro, or High RPM API key from
16
+ * https://haveibeenpwned.com/API/Key. The `apiKey` option here is not
17
+ * explicitly required, but direct requests made without it will fail (unless
18
+ * you specify a `baseUrl` to a proxy that inserts a valid API key on your
19
+ * behalf).
20
20
  *
21
21
  * @param {string} email the email address to query
22
22
  * @param {object} [options] a configuration object
@@ -62,23 +62,23 @@ export declare function pasteAccount(email: string, options?: {
62
62
  /**
63
63
  * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
64
64
  */
65
- apiKey?: string;
65
+ apiKey?: string | undefined;
66
66
  /**
67
67
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
68
68
  * `https://haveibeenpwned.com/api/v3`)
69
69
  */
70
- baseUrl?: string;
70
+ baseUrl?: string | undefined;
71
71
  /**
72
72
  * timeout for the request in milliseconds (default: none)
73
73
  */
74
- timeoutMs?: number;
74
+ timeoutMs?: number | undefined;
75
75
  /**
76
76
  * an AbortSignal to cancel the request (default: none)
77
77
  */
78
- signal?: AbortSignal;
78
+ signal?: AbortSignal | undefined;
79
79
  /**
80
80
  * a custom string to send as the User-Agent field in the request headers
81
81
  * (default: `hibp <version>`)
82
82
  */
83
- userAgent?: string;
83
+ userAgent?: string | undefined;
84
84
  }): Promise<Paste[] | null>;
@@ -1,22 +1,22 @@
1
- import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
1
+ import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
2
2
  /**
3
3
  * An object representing a paste.
4
4
  *
5
5
  * @typedef {object} Paste
6
6
  * @property {string} Id
7
7
  * @property {string} Source
8
- * @property {string} Title
9
- * @property {string} Date
8
+ * @property {string} [Title] omitted when the source has no title
9
+ * @property {(string | null)} Date null when the source has no posting date
10
10
  * @property {number} EmailCount
11
11
  */
12
12
  /**
13
13
  * Fetches paste data for a specific account (email address).
14
14
  *
15
- * 🔑 `haveibeenpwned.com` requires an API key from
16
- * https://haveibeenpwned.com/API/Key for the `pasteaccount` endpoint. The
17
- * `apiKey` option here is not explicitly required, but direct requests made
18
- * without it will fail (unless you specify a `baseUrl` to a proxy that inserts
19
- * a valid API key on your behalf).
15
+ * Requires a Core, Pro, or High RPM API key from
16
+ * https://haveibeenpwned.com/API/Key. The `apiKey` option here is not
17
+ * explicitly required, but direct requests made without it will fail (unless
18
+ * you specify a `baseUrl` to a proxy that inserts a valid API key on your
19
+ * behalf).
20
20
  *
21
21
  * @param {string} email the email address to query
22
22
  * @param {object} [options] a configuration object
@@ -1 +1 @@
1
- {"version":3,"file":"paste-account.js","sourceRoot":"","sources":["../../src/paste-account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,UAuBI,EAAE;IAEN,OAAO,YAAY,CAAC,iBAAiB,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAExE,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"paste-account.js","sourceRoot":"","sources":["../../src/paste-account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAa,EACb,OAAO,GAuBH,EAAE;IAEN,OAAO,YAAY,CACjB,iBAAiB,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAC5C,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -61,27 +61,27 @@ export declare function pwnedPasswordRange(prefix: string, options?: {
61
61
  * ask the remote API to add padding to the response to obscure the password
62
62
  * prefix (default: `false`)
63
63
  */
64
- addPadding?: boolean;
64
+ addPadding?: boolean | undefined;
65
65
  /**
66
66
  * return SHA-1 or NTLM hashes (default: `sha1`)
67
67
  */
68
- mode?: 'sha1' | 'ntlm';
68
+ mode?: "sha1" | "ntlm" | undefined;
69
69
  /**
70
70
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
71
71
  * `https://haveibeenpwned.com/api/v3`)
72
72
  */
73
- baseUrl?: string;
73
+ baseUrl?: string | undefined;
74
74
  /**
75
75
  * timeout for the request in milliseconds (default: none)
76
76
  */
77
- timeoutMs?: number;
77
+ timeoutMs?: number | undefined;
78
78
  /**
79
79
  * an AbortSignal to cancel the request (default: none)
80
80
  */
81
- signal?: AbortSignal;
81
+ signal?: AbortSignal | undefined;
82
82
  /**
83
83
  * a custom string to send as the User-Agent field in the request headers
84
84
  * (default: `hibp <version>`)
85
85
  */
86
- userAgent?: string;
86
+ userAgent?: string | undefined;
87
87
  }): Promise<PwnedPasswordSuffixes>;
@@ -1,4 +1,4 @@
1
- import { fetchFromApi } from './api/pwnedpasswords/fetch-from-api.js';
1
+ import { fetchFromApi } from "./api/pwnedpasswords/fetch-from-api.js";
2
2
  /**
3
3
  * An object mapping an exposed password hash suffix (corresponding to a given
4
4
  * hash prefix) to how many times it occurred in the Pwned Passwords repository.
@@ -57,7 +57,7 @@ import { fetchFromApi } from './api/pwnedpasswords/fetch-from-api.js';
57
57
  * @see https://haveibeenpwned.com/api/v3#SearchingPwnedPasswordsByRange
58
58
  */
59
59
  export async function pwnedPasswordRange(prefix, options = {}) {
60
- const { baseUrl, timeoutMs, signal, userAgent, addPadding = false, mode = 'sha1' } = options;
60
+ const { baseUrl, timeoutMs, signal, userAgent, addPadding = false, mode = "sha1", } = options;
61
61
  const data = await fetchFromApi(`/range/${encodeURIComponent(prefix)}`, {
62
62
  baseUrl,
63
63
  timeoutMs,
@@ -66,11 +66,9 @@ export async function pwnedPasswordRange(prefix, options = {}) {
66
66
  addPadding,
67
67
  mode,
68
68
  });
69
- // create array from lines of text in response body
70
- const results = data.split('\n').filter(Boolean);
71
- // convert into an object mapping suffix to count for each line
69
+ const results = data.split("\n").filter(Boolean);
72
70
  return results.reduce((acc, row) => {
73
- const [suffix, countString] = row.split(':');
71
+ const [suffix, countString] = row.split(":");
74
72
  acc[suffix] = Number.parseInt(countString, 10);
75
73
  return acc;
76
74
  }, {});
@@ -1 +1 @@
1
- {"version":3,"file":"pwned-password-range.js","sourceRoot":"","sources":["../../src/pwned-password-range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAItE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,UA4BI,EAAE;IAEN,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC;IAE7F,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QACtE,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;QACT,UAAU;QACV,IAAI;KACL,CAAC,CAAC;IAEH,mDAAmD;IACnD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjD,+DAA+D;IAC/D,OAAO,OAAO,CAAC,MAAM,CAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxD,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
1
+ {"version":3,"file":"pwned-password-range.js","sourceRoot":"","sources":["../../src/pwned-password-range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAItE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,OAAO,GA4BH,EAAE;IAEN,MAAM,EACJ,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,MAAM,GACd,GAAG,OAAO,CAAC;IAEZ,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE;QACtE,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;QACT,UAAU;QACV,IAAI;KACL,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEjD,OAAO,OAAO,CAAC,MAAM,CAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxD,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAE/C,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -35,23 +35,23 @@ export declare function pwnedPassword(password: string, options?: {
35
35
  * ask the remote API to add padding to the response to obscure the password
36
36
  * prefix (default: `false`)
37
37
  */
38
- addPadding?: boolean;
38
+ addPadding?: boolean | undefined;
39
39
  /**
40
40
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
41
41
  * `https://haveibeenpwned.com/api/v3`)
42
42
  */
43
- baseUrl?: string;
43
+ baseUrl?: string | undefined;
44
44
  /**
45
45
  * timeout for the request in milliseconds (default: none)
46
46
  */
47
- timeoutMs?: number;
47
+ timeoutMs?: number | undefined;
48
48
  /**
49
49
  * an AbortSignal to cancel the request (default: none)
50
50
  */
51
- signal?: AbortSignal;
51
+ signal?: AbortSignal | undefined;
52
52
  /**
53
53
  * a custom string to send as the User-Agent field in the request headers
54
54
  * (default: `hibp <version>`)
55
55
  */
56
- userAgent?: string;
56
+ userAgent?: string | undefined;
57
57
  }): Promise<number>;
@@ -1,4 +1,4 @@
1
- import { pwnedPasswordRange } from './pwned-password-range.js';
1
+ import { pwnedPasswordRange } from "./pwned-password-range.js";
2
2
  /**
3
3
  * Fetches the number of times the the given password has been exposed in a
4
4
  * breach (0 indicating no exposure). The password is given in plain text, but
@@ -34,19 +34,24 @@ import { pwnedPasswordRange } from './pwned-password-range.js';
34
34
  export async function pwnedPassword(password, options = {}) {
35
35
  const [prefix, suffix] = await getPasswordHashParts(password);
36
36
  const range = await pwnedPasswordRange(prefix, options);
37
- return range[suffix] || 0;
37
+ const count = range[suffix];
38
+ return count === undefined || Number.isNaN(count) ? 0 : count;
38
39
  }
39
40
  async function getPasswordHashParts(password) {
40
- if (typeof crypto === 'object' && crypto.subtle) {
41
+ const subtle = webCryptoIfAvailable()?.subtle;
42
+ if (subtle) {
41
43
  const msgUint8 = new TextEncoder().encode(password);
42
- const hashBuffer = await crypto.subtle.digest('SHA-1', msgUint8);
44
+ const hashBuffer = await subtle.digest("SHA-1", msgUint8);
43
45
  const hashArray = Array.from(new Uint8Array(hashBuffer));
44
46
  const hashHex = hashArray
45
- .map((byte) => byte.toString(16).padStart(2, '0'))
46
- .join('')
47
+ .map((byte) => byte.toString(16).padStart(2, "0"))
48
+ .join("")
47
49
  .toUpperCase();
48
50
  return [hashHex.slice(0, 5), hashHex.slice(5)];
49
51
  }
50
- throw new Error('The Web Crypto API is not available in this environment.');
52
+ throw new Error("The Web Crypto API is not available in this environment.");
53
+ }
54
+ function webCryptoIfAvailable() {
55
+ return globalThis.crypto;
51
56
  }
52
57
  //# sourceMappingURL=pwned-password.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pwned-password.js","sourceRoot":"","sources":["../../src/pwned-password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,UAwBI,EAAE;IAEN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IAClD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACjE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,SAAS;aACtB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aACjD,IAAI,CAAC,EAAE,CAAC;aACR,WAAW,EAAE,CAAC;QAEjB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAU,CAAC;IAC1D,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC"}
1
+ {"version":3,"file":"pwned-password.js","sourceRoot":"","sources":["../../src/pwned-password.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAgB,EAChB,OAAO,GAwBH,EAAE;IAEN,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5B,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,QAAgB;IAClD,MAAM,MAAM,GAAG,oBAAoB,EAAE,EAAE,MAAM,CAAC;IAE9C,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;QAEzD,MAAM,OAAO,GAAG,SAAS;aACtB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;aACjD,IAAI,CAAC,EAAE,CAAC;aACR,WAAW,EAAE,CAAC;QAEjB,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAU,CAAC;IAC1D,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,UAAU,CAAC,MAAM,CAAC;AAC3B,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { Breach, Paste } from './api/haveibeenpwned/types.js';
1
+ import type { Breach, Paste } from "./api/haveibeenpwned/types.js";
2
2
  export interface SearchResults {
3
- breaches: Breach[] | null;
3
+ breaches: Breach[] | Pick<Breach, "Name">[] | null;
4
4
  pastes: Paste[] | null;
5
5
  }
6
6
  /**
@@ -10,6 +10,39 @@ export interface SearchResults {
10
10
  * @property {(Breach[] | null)} breaches
11
11
  * @property {(Paste[] | null)} pastes
12
12
  */
13
+ interface SearchOptions {
14
+ /**
15
+ * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
16
+ */
17
+ apiKey?: string | undefined;
18
+ /**
19
+ * a domain by which to filter the results (default: all domains)
20
+ */
21
+ domain?: string | undefined;
22
+ /**
23
+ * truncate the results to only include the name of each breach (default:
24
+ * true)
25
+ */
26
+ truncate?: boolean | undefined;
27
+ /**
28
+ * a custom base URL for the haveibeenpwned.com API endpoints (default:
29
+ * `https://haveibeenpwned.com/api/v3`)
30
+ */
31
+ baseUrl?: string | undefined;
32
+ /**
33
+ * timeout for the request in milliseconds (default: none)
34
+ */
35
+ timeoutMs?: number | undefined;
36
+ /**
37
+ * an AbortSignal to cancel the request (default: none)
38
+ */
39
+ signal?: AbortSignal | undefined;
40
+ /**
41
+ * a custom string to send as the User-Agent field in the request headers
42
+ * (default: `hibp <version>`)
43
+ */
44
+ userAgent?: string | undefined;
45
+ }
13
46
  /**
14
47
  * Fetches all breaches and all pastes associated with the provided account
15
48
  * (email address or username). Note that the remote API does not support
@@ -19,11 +52,14 @@ export interface SearchResults {
19
52
  * exactly how searching via the current web interface behaves, which this
20
53
  * convenience method is designed to mimic.
21
54
  *
22
- * 🔑 `haveibeenpwned.com` requires an API key from
23
- * https://haveibeenpwned.com/API/Key for the `breachedaccount` and
24
- * `pasteaccount` endpoints. The `apiKey` option here is not explicitly
25
- * required, but direct requests made without it will fail (unless you specify a
26
- * `baseUrl` to a proxy that inserts a valid API key on your behalf).
55
+ * Breaches contain only `Name` by default; pass `truncate: false` for full
56
+ * breaches.
57
+ *
58
+ * Requires a Core, Pro, or High RPM API key from
59
+ * https://haveibeenpwned.com/API/Key. The `apiKey` option here is not
60
+ * explicitly required, but direct requests made without it will fail (unless
61
+ * you specify a `baseUrl` to a proxy that inserts a valid API key on your
62
+ * behalf).
27
63
  *
28
64
  * @param {string} account an email address or username
29
65
  * @param {object} [options] a configuration object
@@ -72,36 +108,17 @@ export interface SearchResults {
72
108
  * }
73
109
  * @see https://haveibeenpwned.com/
74
110
  */
75
- export declare function search(account: string, options?: {
76
- /**
77
- * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
78
- */
79
- apiKey?: string;
80
- /**
81
- * a domain by which to filter the results (default: all domains)
82
- */
83
- domain?: string;
84
- /**
85
- * truncate the results to only include the name of each breach (default:
86
- * true)
87
- */
88
- truncate?: boolean;
89
- /**
90
- * a custom base URL for the haveibeenpwned.com API endpoints (default:
91
- * `https://haveibeenpwned.com/api/v3`)
92
- */
93
- baseUrl?: string;
94
- /**
95
- * timeout for the request in milliseconds (default: none)
96
- */
97
- timeoutMs?: number;
98
- /**
99
- * an AbortSignal to cancel the request (default: none)
100
- */
101
- signal?: AbortSignal;
102
- /**
103
- * a custom string to send as the User-Agent field in the request headers
104
- * (default: `hibp <version>`)
105
- */
106
- userAgent?: string;
107
- }): Promise<SearchResults>;
111
+ export declare function search(account: string, options?: SearchOptions & {
112
+ truncate?: true | undefined;
113
+ }): Promise<{
114
+ breaches: Pick<Breach, "Name">[] | null;
115
+ pastes: Paste[] | null;
116
+ }>;
117
+ export declare function search(account: string, options: SearchOptions & {
118
+ truncate: false;
119
+ }): Promise<{
120
+ breaches: Breach[] | null;
121
+ pastes: Paste[] | null;
122
+ }>;
123
+ export declare function search(account: string, options?: SearchOptions): Promise<SearchResults>;
124
+ export {};
@@ -1,76 +1,8 @@
1
- import { breachedAccount } from './breached-account.js';
2
- import { pasteAccount } from './paste-account.js';
3
- /**
4
- * An object representing search results.
5
- *
6
- * @typedef {object} SearchResults
7
- * @property {(Breach[] | null)} breaches
8
- * @property {(Paste[] | null)} pastes
9
- */
10
- /**
11
- * Fetches all breaches and all pastes associated with the provided account
12
- * (email address or username). Note that the remote API does not support
13
- * querying pastes by username (only email addresses), so in the event the
14
- * provided account is not a valid email address, only breach data is queried
15
- * and the "pastes" field of the resulting object will always be null. This is
16
- * exactly how searching via the current web interface behaves, which this
17
- * convenience method is designed to mimic.
18
- *
19
- * 🔑 `haveibeenpwned.com` requires an API key from
20
- * https://haveibeenpwned.com/API/Key for the `breachedaccount` and
21
- * `pasteaccount` endpoints. The `apiKey` option here is not explicitly
22
- * required, but direct requests made without it will fail (unless you specify a
23
- * `baseUrl` to a proxy that inserts a valid API key on your behalf).
24
- *
25
- * @param {string} account an email address or username
26
- * @param {object} [options] a configuration object
27
- * @param {string} [options.apiKey] an API key from
28
- * https://haveibeenpwned.com/API/Key (default: undefined)
29
- * @param {string} [options.domain] a domain by which to filter the breach
30
- * results (default: all domains)
31
- * @param {boolean} [options.truncate] truncate the breach results to only
32
- * include the name of each breach (default: true)
33
- * @param {string} [options.baseUrl] a custom base URL for the
34
- * haveibeenpwned.com API endpoints (default:
35
- * `https://haveibeenpwned.com/api/v3`)
36
- * @param {number} [options.timeoutMs] timeout for the request in milliseconds
37
- * (default: none)
38
- * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
39
- * @param {string} [options.userAgent] a custom string to send as the
40
- * User-Agent field in the request headers (default: `hibp <version>`)
41
- * @returns {Promise<SearchResults>} a Promise which resolves to an object
42
- * containing a "breaches" key (which can be null or an array of breach objects)
43
- * and a "pastes" key (which can be null or an array of paste objects), or
44
- * rejects with an Error
45
- * @example
46
- * try {
47
- * const data = await search("foo", { apiKey: "my-api-key" });
48
- * if (data.breaches || data.pastes) {
49
- * // ...
50
- * } else {
51
- * // ...
52
- * }
53
- * } catch (err) {
54
- * // ...
55
- * }
56
- * @example
57
- * try {
58
- * const data = await search("nobody@nowhere.com", {
59
- * baseUrl: "https://my-hibp-proxy:8080",
60
- * truncate: false,
61
- * });
62
- * if (data.breaches || data.pastes) {
63
- * // ...
64
- * } else {
65
- * // ...
66
- * }
67
- * } catch (err) {
68
- * // ...
69
- * }
70
- * @see https://haveibeenpwned.com/
71
- */
1
+ import { breachedAccount } from "./breached-account.js";
2
+ import { pasteAccount } from "./paste-account.js";
3
+ const PASTE_API_EMAIL_PATTERN = /^.+@.+$/;
72
4
  export async function search(account, options = {}) {
73
- const { apiKey, domain, truncate = true, baseUrl, timeoutMs, signal, userAgent } = options;
5
+ const { apiKey, domain, truncate = true, baseUrl, timeoutMs, signal, userAgent, } = options;
74
6
  const [breaches, pastes] = await Promise.all([
75
7
  breachedAccount(account, {
76
8
  apiKey,
@@ -81,8 +13,7 @@ export async function search(account, options = {}) {
81
13
  signal,
82
14
  userAgent,
83
15
  }),
84
- // This email regex is garbage but it seems to be what the API uses:
85
- /^.+@.+$/.test(account)
16
+ PASTE_API_EMAIL_PATTERN.test(account)
86
17
  ? pasteAccount(account, { apiKey, baseUrl, timeoutMs, signal, userAgent })
87
18
  : null,
88
19
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOlD;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAe,EACf,UAgCI,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE3F,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC3C,eAAe,CAAC,OAAO,EAAE;YACvB,MAAM;YACN,MAAM;YACN,QAAQ;YACR,OAAO;YACP,SAAS;YACT,MAAM;YACN,SAAS;SACV,CAAC;QACF,oEAAoE;QACpE,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;YACrB,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAC1E,CAAC,CAAC,IAAI;KACT,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,uBAAuB,GAAG,SAAS,CAAC;AA8H1C,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAe,EACf,OAAO,GAAkB,EAAE;IAE3B,MAAM,EACJ,MAAM,EACN,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,OAAO,EACP,SAAS,EACT,MAAM,EACN,SAAS,GACV,GAAG,OAAO,CAAC;IAEZ,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC3C,eAAe,CAAC,OAAO,EAAE;YACvB,MAAM;YACN,MAAM;YACN,QAAQ;YACR,OAAO;YACP,SAAS;YACT,MAAM;YACN,SAAS;SACV,CAAC;QACF,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;YAC1E,CAAC,CAAC,IAAI;KACT,CAAC,CAAC;IAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,69 @@
1
+ import type { EmailAlias } from "./api/haveibeenpwned/types.js";
2
+ /**
3
+ * An administrative alias supported for domain verification emails.
4
+ *
5
+ * @typedef {("admin"|"hostmaster"|"info"|"security"|"webmaster")} EmailAlias
6
+ */
7
+ /**
8
+ * Requests a domain verification approval email.
9
+ *
10
+ * Follow the link sent to the chosen alias at the domain to complete
11
+ * verification.
12
+ *
13
+ * Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
14
+ * option here is not explicitly required, but direct requests made without it
15
+ * will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
16
+ * key on your behalf).
17
+ *
18
+ * @see https://haveibeenpwned.com/API/v3#VerifyDomainViaEmail
19
+ * @param {string} domain the domain to verify (e.g., "example.com")
20
+ * @param {EmailAlias} emailAlias the administrative alias to
21
+ * receive the email
22
+ * @param {object} [options] a configuration object
23
+ * @param {string} [options.apiKey] an API key from
24
+ * https://haveibeenpwned.com/API/Key (default: undefined)
25
+ * @param {string} [options.baseUrl] a custom base URL for the
26
+ * haveibeenpwned.com API endpoints (default:
27
+ * `https://haveibeenpwned.com/api/v3`)
28
+ * @param {number} [options.timeoutMs] timeout for the request in milliseconds
29
+ * (default: none)
30
+ * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
31
+ * @param {string} [options.userAgent] a custom string to send as the User-Agent
32
+ * field in the request headers (default: `hibp <version>`)
33
+ * @returns {Promise<void>} a Promise which resolves without parsing the
34
+ * response body when the approval email request succeeds, or rejects with an
35
+ * Error containing the upstream failure reason
36
+ * @example
37
+ * try {
38
+ * await sendEmail("example.com", "security", {
39
+ * apiKey: "my-api-key",
40
+ * });
41
+ * // Follow the link in the email sent to security@example.com.
42
+ * } catch (err) {
43
+ * // ...
44
+ * }
45
+ */
46
+ export declare function sendEmail(domain: string, emailAlias: EmailAlias, options?: {
47
+ /**
48
+ * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
49
+ */
50
+ apiKey?: string | undefined;
51
+ /**
52
+ * a custom base URL for the haveibeenpwned.com API endpoints (default:
53
+ * `https://haveibeenpwned.com/api/v3`)
54
+ */
55
+ baseUrl?: string | undefined;
56
+ /**
57
+ * timeout for the request in milliseconds (default: none)
58
+ */
59
+ timeoutMs?: number | undefined;
60
+ /**
61
+ * an AbortSignal to cancel the request (default: none)
62
+ */
63
+ signal?: AbortSignal | undefined;
64
+ /**
65
+ * a custom string to send as the User-Agent field in the request headers
66
+ * (default: `hibp <version>`)
67
+ */
68
+ userAgent?: string | undefined;
69
+ }): Promise<void>;
@@ -0,0 +1,49 @@
1
+ import { postToApi } from "./api/haveibeenpwned/post-to-api.js";
2
+ /**
3
+ * An administrative alias supported for domain verification emails.
4
+ *
5
+ * @typedef {("admin"|"hostmaster"|"info"|"security"|"webmaster")} EmailAlias
6
+ */
7
+ /**
8
+ * Requests a domain verification approval email.
9
+ *
10
+ * Follow the link sent to the chosen alias at the domain to complete
11
+ * verification.
12
+ *
13
+ * Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
14
+ * option here is not explicitly required, but direct requests made without it
15
+ * will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
16
+ * key on your behalf).
17
+ *
18
+ * @see https://haveibeenpwned.com/API/v3#VerifyDomainViaEmail
19
+ * @param {string} domain the domain to verify (e.g., "example.com")
20
+ * @param {EmailAlias} emailAlias the administrative alias to
21
+ * receive the email
22
+ * @param {object} [options] a configuration object
23
+ * @param {string} [options.apiKey] an API key from
24
+ * https://haveibeenpwned.com/API/Key (default: undefined)
25
+ * @param {string} [options.baseUrl] a custom base URL for the
26
+ * haveibeenpwned.com API endpoints (default:
27
+ * `https://haveibeenpwned.com/api/v3`)
28
+ * @param {number} [options.timeoutMs] timeout for the request in milliseconds
29
+ * (default: none)
30
+ * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
31
+ * @param {string} [options.userAgent] a custom string to send as the User-Agent
32
+ * field in the request headers (default: `hibp <version>`)
33
+ * @returns {Promise<void>} a Promise which resolves without parsing the
34
+ * response body when the approval email request succeeds, or rejects with an
35
+ * Error containing the upstream failure reason
36
+ * @example
37
+ * try {
38
+ * await sendEmail("example.com", "security", {
39
+ * apiKey: "my-api-key",
40
+ * });
41
+ * // Follow the link in the email sent to security@example.com.
42
+ * } catch (err) {
43
+ * // ...
44
+ * }
45
+ */
46
+ export async function sendEmail(domain, emailAlias, options = {}) {
47
+ await postToApi("/domainVerification/sendEmail", { DomainName: domain, EmailAlias: emailAlias }, options);
48
+ }
49
+ //# sourceMappingURL=send-email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"send-email.js","sourceRoot":"","sources":["../../src/send-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAGhE;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAc,EACd,UAAsB,EACtB,OAAO,GAuBH,EAAE;IAEN,MAAM,SAAS,CACb,+BAA+B,EAC/B,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,EAC9C,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -1,8 +1,8 @@
1
- import type { StealerLogDomainsByEmailAlias } from './api/haveibeenpwned/types.js';
1
+ import type { StealerLogDomainsByEmailAlias } from "./api/haveibeenpwned/types.js";
2
2
  /**
3
3
  * An object mapping an email alias (local-part before the '@') to the list of
4
- * email domains that alias has appeared in within stealer logs for the specified
5
- * email domain.
4
+ * website domains that alias has appeared against in stealer logs for the
5
+ * specified email domain.
6
6
  *
7
7
  * @typedef {Object.<string, string[]>} StealerLogDomainsByEmailAlias
8
8
  */
@@ -10,15 +10,14 @@ import type { StealerLogDomainsByEmailAlias } from './api/haveibeenpwned/types.j
10
10
  * Fetches all stealer log email aliases for an email domain.
11
11
  *
12
12
  * The result maps email aliases (the local-part before the '@') to an array of
13
- * email domains found in stealer logs. For example, querying `example.com`
13
+ * website domains found in stealer logs. For example, querying `example.com`
14
14
  * could return an object like `{ "andy": ["netflix.com"], "jane": ["netflix.com",
15
15
  * "spotify.com"] }`, corresponding to `andy@example.com` and `jane@example.com`.
16
16
  *
17
- * 🔑 `haveibeenpwned.com` requires an API key from
18
- * https://haveibeenpwned.com/API/Key for the `stealerlogsbyemaildomain` endpoint.
19
- * The `apiKey` option here is not explicitly required, but direct requests made
20
- * without it will fail (unless you specify a `baseUrl` to a proxy that inserts
21
- * a valid API key on your behalf).
17
+ * Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
18
+ * option here is not explicitly required, but direct requests made without it
19
+ * will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
20
+ * key on your behalf).
22
21
  *
23
22
  * @param {string} emailDomain the email domain to query (e.g., "example.com")
24
23
  * @param {object} [options] a configuration object
@@ -51,23 +50,23 @@ export declare function stealerLogsByEmailDomain(emailDomain: string, options?:
51
50
  /**
52
51
  * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
53
52
  */
54
- apiKey?: string;
53
+ apiKey?: string | undefined;
55
54
  /**
56
55
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
57
56
  * `https://haveibeenpwned.com/api/v3`)
58
57
  */
59
- baseUrl?: string;
58
+ baseUrl?: string | undefined;
60
59
  /**
61
60
  * timeout for the request in milliseconds (default: none)
62
61
  */
63
- timeoutMs?: number;
62
+ timeoutMs?: number | undefined;
64
63
  /**
65
64
  * an AbortSignal to cancel the request (default: none)
66
65
  */
67
- signal?: AbortSignal;
66
+ signal?: AbortSignal | undefined;
68
67
  /**
69
68
  * a custom string to send as the User-Agent field in the request headers
70
69
  * (default: `hibp <version>`)
71
70
  */
72
- userAgent?: string;
71
+ userAgent?: string | undefined;
73
72
  }): Promise<StealerLogDomainsByEmailAlias | null>;