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 +1 @@
1
- {"version":3,"file":"breached-account.js","sourceRoot":"","sources":["../../src/breached-account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,UAoCI,EAAE;IAEN,MAAM,EACJ,MAAM,EACN,MAAM,EACN,iBAAiB,GAAG,IAAI,EACxB,SAAS,EACT,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,OAAO,EACP,SAAS,GACV,GAAG,OAAO,CAAC;IACZ,MAAM,QAAQ,GAAG,oBAAoB,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC;IACpE,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;QACpD,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAA6B,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"breached-account.js","sourceRoot":"","sources":["../../src/breached-account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AA+HtE,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,OAAO,GAA2B,EAAE;IAEpC,MAAM,EACJ,MAAM,EACN,MAAM,EACN,iBAAiB,GAAG,IAAI,EACxB,SAAS,EACT,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,OAAO,EACP,SAAS,GACV,GAAG,OAAO,CAAC;IAEZ,MAAM,QAAQ,GAAG,oBAAoB,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC;IACpE,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CACjB,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAChC;QACE,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { BreachedDomainsByEmailAlias } from './api/haveibeenpwned/types.js';
1
+ import type { BreachedDomainsByEmailAlias } from "./api/haveibeenpwned/types.js";
2
2
  /**
3
3
  * An object mapping an email alias (local-part before the '@') to the list of
4
4
  * breach names that alias has appeared in for the specified domain.
@@ -13,8 +13,7 @@ import type { BreachedDomainsByEmailAlias } from './api/haveibeenpwned/types.js'
13
13
  * `{ "john": ["Adobe"], "jane": ["Adobe", "Gawker"] }`, corresponding to
14
14
  * `john@example.com` and `jane@example.com`.
15
15
  *
16
- * 🔑 `haveibeenpwned.com` requires an API key from
17
- * https://haveibeenpwned.com/API/Key for the `breacheddomain` endpoint. The
16
+ * Requires a Core or Pro API key from https://haveibeenpwned.com/API/Key. The
18
17
  * `apiKey` option here is not explicitly required, but direct requests made
19
18
  * without it will fail (unless you specify a `baseUrl` to a proxy that inserts
20
19
  * a valid API key on your behalf).
@@ -50,23 +49,23 @@ export declare function breachedDomain(domain: string, options?: {
50
49
  /**
51
50
  * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
52
51
  */
53
- apiKey?: string;
52
+ apiKey?: string | undefined;
54
53
  /**
55
54
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
56
55
  * `https://haveibeenpwned.com/api/v3`)
57
56
  */
58
- baseUrl?: string;
57
+ baseUrl?: string | undefined;
59
58
  /**
60
59
  * timeout for the request in milliseconds (default: none)
61
60
  */
62
- timeoutMs?: number;
61
+ timeoutMs?: number | undefined;
63
62
  /**
64
63
  * an AbortSignal to cancel the request (default: none)
65
64
  */
66
- signal?: AbortSignal;
65
+ signal?: AbortSignal | undefined;
67
66
  /**
68
67
  * a custom string to send as the User-Agent field in the request headers
69
68
  * (default: `hibp <version>`)
70
69
  */
71
- userAgent?: string;
70
+ userAgent?: string | undefined;
72
71
  }): Promise<BreachedDomainsByEmailAlias | null>;
@@ -1,4 +1,4 @@
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 mapping an email alias (local-part before the '@') to the list of
4
4
  * breach names that alias has appeared in for the specified domain.
@@ -13,8 +13,7 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
13
13
  * `{ "john": ["Adobe"], "jane": ["Adobe", "Gawker"] }`, corresponding to
14
14
  * `john@example.com` and `jane@example.com`.
15
15
  *
16
- * 🔑 `haveibeenpwned.com` requires an API key from
17
- * https://haveibeenpwned.com/API/Key for the `breacheddomain` endpoint. The
16
+ * Requires a Core or Pro API key from https://haveibeenpwned.com/API/Key. The
18
17
  * `apiKey` option here is not explicitly required, but direct requests made
19
18
  * without it will fail (unless you specify a `baseUrl` to a proxy that inserts
20
19
  * a valid API key on your behalf).
@@ -1 +1 @@
1
- {"version":3,"file":"breached-domain.js","sourceRoot":"","sources":["../../src/breached-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,UAuBI,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,mBAAmB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;IAEjE,OAAO,YAAY,CAAC,QAAQ,EAAE;QAC5B,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAgD,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"breached-domain.js","sourceRoot":"","sources":["../../src/breached-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAc,EACd,OAAO,GAuBH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,mBAAmB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;IAEjE,OAAO,YAAY,CAA8B,QAAQ,EAAE;QACzD,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +1,12 @@
1
- import type { Breach } from './api/haveibeenpwned/types.js';
1
+ import type { Breach } from "./api/haveibeenpwned/types.js";
2
2
  /**
3
3
  * Fetches all breach events in the system.
4
4
  *
5
5
  * @param {object} [options] a configuration object
6
6
  * @param {string} [options.domain] a domain by which to filter the results
7
7
  * (default: all domains)
8
+ * @param {boolean} [options.isSpamList] true for only spam-list breaches, false
9
+ * for only non-spam-list breaches (default: no spam-list filter)
8
10
  * @param {string} [options.baseUrl] a custom base URL for the
9
11
  * haveibeenpwned.com API endpoints (default:
10
12
  * `https://haveibeenpwned.com/api/v3`)
@@ -28,7 +30,7 @@ import type { Breach } from './api/haveibeenpwned/types.js';
28
30
  * }
29
31
  * @example
30
32
  * try {
31
- * const data = await breaches({ domain: "adobe.com" });
33
+ * const data = await breaches({ domain: "adobe.com", isSpamList: false });
32
34
  * if (data) {
33
35
  * // ...
34
36
  * } else {
@@ -42,23 +44,28 @@ export declare function breaches(options?: {
42
44
  /**
43
45
  * a domain by which to filter the results (default: all domains)
44
46
  */
45
- domain?: string;
47
+ domain?: string | undefined;
48
+ /**
49
+ * true for only spam-list breaches, false for only non-spam-list breaches
50
+ * (default: no spam-list filter)
51
+ */
52
+ isSpamList?: boolean | undefined;
46
53
  /**
47
54
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
48
55
  * `https://haveibeenpwned.com/api/v3`)
49
56
  */
50
- baseUrl?: string;
57
+ baseUrl?: string | undefined;
51
58
  /**
52
59
  * timeout for the request in milliseconds (default: none)
53
60
  */
54
- timeoutMs?: number;
61
+ timeoutMs?: number | undefined;
55
62
  /**
56
63
  * an AbortSignal to cancel the request (default: none)
57
64
  */
58
- signal?: AbortSignal;
65
+ signal?: AbortSignal | undefined;
59
66
  /**
60
67
  * a custom string to send as the User-Agent field in the request headers
61
68
  * (default: `hibp <version>`)
62
69
  */
63
- userAgent?: string;
70
+ userAgent?: string | undefined;
64
71
  }): Promise<Breach[]>;
@@ -1,10 +1,12 @@
1
- import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
1
+ import { fetchRequiredFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
2
2
  /**
3
3
  * Fetches all breach events in the system.
4
4
  *
5
5
  * @param {object} [options] a configuration object
6
6
  * @param {string} [options.domain] a domain by which to filter the results
7
7
  * (default: all domains)
8
+ * @param {boolean} [options.isSpamList] true for only spam-list breaches, false
9
+ * for only non-spam-list breaches (default: no spam-list filter)
8
10
  * @param {string} [options.baseUrl] a custom base URL for the
9
11
  * haveibeenpwned.com API endpoints (default:
10
12
  * `https://haveibeenpwned.com/api/v3`)
@@ -28,7 +30,7 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
28
30
  * }
29
31
  * @example
30
32
  * try {
31
- * const data = await breaches({ domain: "adobe.com" });
33
+ * const data = await breaches({ domain: "adobe.com", isSpamList: false });
32
34
  * if (data) {
33
35
  * // ...
34
36
  * } else {
@@ -39,13 +41,16 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
39
41
  * }
40
42
  */
41
43
  export function breaches(options = {}) {
42
- const { domain, baseUrl, timeoutMs, signal, userAgent } = options;
43
- const endpoint = '/breaches?';
44
+ const { domain, isSpamList, baseUrl, timeoutMs, signal, userAgent } = options;
45
+ const endpoint = "/breaches?";
44
46
  const params = [];
45
47
  if (domain) {
46
48
  params.push(`domain=${encodeURIComponent(domain)}`);
47
49
  }
48
- return fetchFromApi(`${endpoint}${params.join('&')}`, {
50
+ if (isSpamList !== undefined) {
51
+ params.push(`isSpamList=${isSpamList}`);
52
+ }
53
+ return fetchRequiredFromApi(`${endpoint}${params.join("&")}`, {
49
54
  baseUrl,
50
55
  timeoutMs,
51
56
  signal,
@@ -1 +1 @@
1
- {"version":3,"file":"breaches.js","sourceRoot":"","sources":["../../src/breaches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,QAAQ,CACtB,UAuBI,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,YAAY,CAAC;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,YAAY,CAAC,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;QACpD,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAsB,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"breaches.js","sourceRoot":"","sources":["../../src/breaches.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,QAAQ,CACtB,OAAO,GA4BH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC9E,MAAM,QAAQ,GAAG,YAAY,CAAC;IAC9B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,cAAc,UAAU,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,oBAAoB,CAAW,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE;QACtE,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { DataClassDescription } from "./api/haveibeenpwned/types.js";
2
+ /**
3
+ * A data class name and its description.
4
+ *
5
+ * @typedef {object} DataClassDescription
6
+ * @property {string} name - the data class name
7
+ * @property {string} description - a description of the compromised data
8
+ */
9
+ /**
10
+ * Fetches all data class names and descriptions.
11
+ *
12
+ * @param {object} [options] a configuration object
13
+ * @param {string} [options.baseUrl] a custom base URL for the
14
+ * haveibeenpwned.com API endpoints (default:
15
+ * `https://haveibeenpwned.com/api/v3`)
16
+ * @param {number} [options.timeoutMs] timeout for the request in milliseconds
17
+ * (default: none)
18
+ * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
19
+ * @param {string} [options.userAgent] a custom string to send as the User-Agent
20
+ * field in the request headers (default: `hibp <version>`)
21
+ * @returns {(Promise<DataClassDescription[]> | Promise<null>)} a Promise which
22
+ * resolves to an array of data class objects (or null if no data classes were
23
+ * found), or rejects with an Error
24
+ * @example
25
+ * try {
26
+ * const data = await dataClassDescriptions();
27
+ * if (data) {
28
+ * // ...
29
+ * } else {
30
+ * // ...
31
+ * }
32
+ * } catch (err) {
33
+ * // ...
34
+ * }
35
+ */
36
+ export declare function dataClassDescriptions(options?: {
37
+ /**
38
+ * a custom base URL for the haveibeenpwned.com API endpoints (default:
39
+ * `https://haveibeenpwned.com/api/v3`)
40
+ */
41
+ baseUrl?: string | undefined;
42
+ /**
43
+ * timeout for the request in milliseconds (default: none)
44
+ */
45
+ timeoutMs?: number | undefined;
46
+ /**
47
+ * an AbortSignal to cancel the request (default: none)
48
+ */
49
+ signal?: AbortSignal | undefined;
50
+ /**
51
+ * a custom string to send as the User-Agent field in the request headers
52
+ * (default: `hibp <version>`)
53
+ */
54
+ userAgent?: string | undefined;
55
+ }): Promise<DataClassDescription[] | null>;
@@ -0,0 +1,39 @@
1
+ import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
2
+ /**
3
+ * A data class name and its description.
4
+ *
5
+ * @typedef {object} DataClassDescription
6
+ * @property {string} name - the data class name
7
+ * @property {string} description - a description of the compromised data
8
+ */
9
+ /**
10
+ * Fetches all data class names and descriptions.
11
+ *
12
+ * @param {object} [options] a configuration object
13
+ * @param {string} [options.baseUrl] a custom base URL for the
14
+ * haveibeenpwned.com API endpoints (default:
15
+ * `https://haveibeenpwned.com/api/v3`)
16
+ * @param {number} [options.timeoutMs] timeout for the request in milliseconds
17
+ * (default: none)
18
+ * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
19
+ * @param {string} [options.userAgent] a custom string to send as the User-Agent
20
+ * field in the request headers (default: `hibp <version>`)
21
+ * @returns {(Promise<DataClassDescription[]> | Promise<null>)} a Promise which
22
+ * resolves to an array of data class objects (or null if no data classes were
23
+ * found), or rejects with an Error
24
+ * @example
25
+ * try {
26
+ * const data = await dataClassDescriptions();
27
+ * if (data) {
28
+ * // ...
29
+ * } else {
30
+ * // ...
31
+ * }
32
+ * } catch (err) {
33
+ * // ...
34
+ * }
35
+ */
36
+ export function dataClassDescriptions(options = {}) {
37
+ return fetchFromApi("/dataclasses/descriptions", options);
38
+ }
39
+ //# sourceMappingURL=data-class-descriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-class-descriptions.js","sourceRoot":"","sources":["../../src/data-class-descriptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAO,GAmBH,EAAE;IAEN,OAAO,YAAY,CACjB,2BAA2B,EAC3B,OAAO,CACR,CAAC;AACJ,CAAC"}
@@ -30,18 +30,18 @@ export declare function dataClasses(options?: {
30
30
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
31
31
  * `https://haveibeenpwned.com/api/v3`)
32
32
  */
33
- baseUrl?: string;
33
+ baseUrl?: string | undefined;
34
34
  /**
35
35
  * timeout for the request in milliseconds (default: none)
36
36
  */
37
- timeoutMs?: number;
37
+ timeoutMs?: number | undefined;
38
38
  /**
39
39
  * an AbortSignal to cancel the request (default: none)
40
40
  */
41
- signal?: AbortSignal;
41
+ signal?: AbortSignal | undefined;
42
42
  /**
43
43
  * a custom string to send as the User-Agent field in the request headers
44
44
  * (default: `hibp <version>`)
45
45
  */
46
- userAgent?: string;
46
+ userAgent?: string | undefined;
47
47
  }): Promise<string[] | null>;
@@ -1,4 +1,4 @@
1
- import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
1
+ import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
2
2
  /**
3
3
  * Fetches all data classes in the system.
4
4
  *
@@ -27,6 +27,6 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
27
27
  * }
28
28
  */
29
29
  export function dataClasses(options = {}) {
30
- return fetchFromApi('/dataclasses', options);
30
+ return fetchFromApi("/dataclasses", options);
31
31
  }
32
32
  //# sourceMappingURL=data-classes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-classes.js","sourceRoot":"","sources":["../../src/data-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,WAAW,CACzB,UAmBI,EAAE;IAEN,OAAO,YAAY,CAAC,cAAc,EAAE,OAAO,CAA6B,CAAC;AAC3E,CAAC"}
1
+ {"version":3,"file":"data-classes.js","sourceRoot":"","sources":["../../src/data-classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,WAAW,CACzB,OAAO,GAmBH,EAAE;IAEN,OAAO,YAAY,CAAW,cAAc,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,67 @@
1
+ import type { DnsToken } from "./api/haveibeenpwned/types.js";
2
+ /**
3
+ * The TXT record value to publish at your DNS provider.
4
+ *
5
+ * @typedef {object} DnsToken
6
+ * @property {string} txtRecordValue - the complete TXT record value
7
+ */
8
+ /**
9
+ * Generates a domain-specific DNS verification token.
10
+ *
11
+ * Publish `txtRecordValue` as a TXT record on the domain, then call
12
+ * `verifyDnsToken` after DNS propagation.
13
+ *
14
+ * Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
15
+ * option here is not explicitly required, but direct requests made without it
16
+ * will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
17
+ * key on your behalf).
18
+ *
19
+ * @see https://haveibeenpwned.com/API/v3#VerifyDomainViaDns
20
+ * @param {string} domain the domain to verify (e.g., "example.com")
21
+ * @param {object} [options] a configuration object
22
+ * @param {string} [options.apiKey] an API key from
23
+ * https://haveibeenpwned.com/API/Key (default: undefined)
24
+ * @param {string} [options.baseUrl] a custom base URL for the
25
+ * haveibeenpwned.com API endpoints (default:
26
+ * `https://haveibeenpwned.com/api/v3`)
27
+ * @param {number} [options.timeoutMs] timeout for the request in milliseconds
28
+ * (default: none)
29
+ * @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
30
+ * @param {string} [options.userAgent] a custom string to send as the User-Agent
31
+ * field in the request headers (default: `hibp <version>`)
32
+ * @returns {Promise<DnsToken>} a Promise which resolves to the TXT record
33
+ * value, or rejects with an Error containing the upstream failure reason
34
+ * @example
35
+ * try {
36
+ * const { txtRecordValue } = await generateDnsToken("example.com", {
37
+ * apiKey: "my-api-key",
38
+ * });
39
+ * // Publish txtRecordValue as a TXT record on example.com.
40
+ * } catch (err) {
41
+ * // ...
42
+ * }
43
+ */
44
+ export declare function generateDnsToken(domain: string, options?: {
45
+ /**
46
+ * an API key from https://haveibeenpwned.com/API/Key (default: undefined)
47
+ */
48
+ apiKey?: string | undefined;
49
+ /**
50
+ * a custom base URL for the haveibeenpwned.com API endpoints (default:
51
+ * `https://haveibeenpwned.com/api/v3`)
52
+ */
53
+ baseUrl?: string | undefined;
54
+ /**
55
+ * timeout for the request in milliseconds (default: none)
56
+ */
57
+ timeoutMs?: number | undefined;
58
+ /**
59
+ * an AbortSignal to cancel the request (default: none)
60
+ */
61
+ signal?: AbortSignal | undefined;
62
+ /**
63
+ * a custom string to send as the User-Agent field in the request headers
64
+ * (default: `hibp <version>`)
65
+ */
66
+ userAgent?: string | undefined;
67
+ }): Promise<DnsToken>;
@@ -0,0 +1,49 @@
1
+ import { readJson } from "./api/haveibeenpwned/fetch-from-api.js";
2
+ import { postToApi } from "./api/haveibeenpwned/post-to-api.js";
3
+ /**
4
+ * The TXT record value to publish at your DNS provider.
5
+ *
6
+ * @typedef {object} DnsToken
7
+ * @property {string} txtRecordValue - the complete TXT record value
8
+ */
9
+ /**
10
+ * Generates a domain-specific DNS verification token.
11
+ *
12
+ * Publish `txtRecordValue` as a TXT record on the domain, then call
13
+ * `verifyDnsToken` after DNS propagation.
14
+ *
15
+ * Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
16
+ * option here is not explicitly required, but direct requests made without it
17
+ * will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
18
+ * key on your behalf).
19
+ *
20
+ * @see https://haveibeenpwned.com/API/v3#VerifyDomainViaDns
21
+ * @param {string} domain the domain to verify (e.g., "example.com")
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<DnsToken>} a Promise which resolves to the TXT record
34
+ * value, or rejects with an Error containing the upstream failure reason
35
+ * @example
36
+ * try {
37
+ * const { txtRecordValue } = await generateDnsToken("example.com", {
38
+ * apiKey: "my-api-key",
39
+ * });
40
+ * // Publish txtRecordValue as a TXT record on example.com.
41
+ * } catch (err) {
42
+ * // ...
43
+ * }
44
+ */
45
+ export async function generateDnsToken(domain, options = {}) {
46
+ const response = await postToApi("/domainVerification/generateDnsToken", { DomainName: domain }, options);
47
+ return readJson(response);
48
+ }
49
+ //# sourceMappingURL=generate-dns-token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-dns-token.js","sourceRoot":"","sources":["../../src/generate-dns-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAGhE;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,OAAO,GAuBH,EAAE;IAEN,MAAM,QAAQ,GAAG,MAAM,SAAS,CAC9B,sCAAsC,EACtC,EAAE,UAAU,EAAE,MAAM,EAAE,EACtB,OAAO,CACR,CAAC;IAEF,OAAO,QAAQ,CAAW,QAAQ,CAAC,CAAC;AACtC,CAAC"}
@@ -1,36 +1,46 @@
1
- import { RateLimitError } from './api/haveibeenpwned/fetch-from-api.js';
2
- import { breach } from './breach.js';
3
- import { breachedAccount } from './breached-account.js';
4
- import { breachedDomain } from './breached-domain.js';
5
- import { breaches } from './breaches.js';
6
- import { dataClasses } from './data-classes.js';
7
- import { latestBreach } from './latest-breach.js';
8
- import { pasteAccount } from './paste-account.js';
9
- import { pwnedPassword } from './pwned-password.js';
10
- import { pwnedPasswordRange } from './pwned-password-range.js';
11
- import { search } from './search.js';
12
- import { stealerLogsByEmail } from './stealer-logs-by-email.js';
13
- import { stealerLogsByEmailDomain } from './stealer-logs-by-email-domain.js';
14
- import { stealerLogsByWebsiteDomain } from './stealer-logs-by-website-domain.js';
15
- import { subscribedDomains } from './subscribed-domains.js';
16
- import { subscriptionStatus } from './subscription-status.js';
17
- export type * from './api/haveibeenpwned/types.js';
18
- export { breach, breachedAccount, breachedDomain, breaches, dataClasses, latestBreach, pasteAccount, pwnedPassword, pwnedPasswordRange, search, stealerLogsByEmail, stealerLogsByEmailDomain, stealerLogsByWebsiteDomain, subscribedDomains, subscriptionStatus, RateLimitError, };
1
+ import { RateLimitError } from "./api/haveibeenpwned/fetch-from-api.js";
2
+ import { breach } from "./breach.js";
3
+ import { breachedAccount } from "./breached-account.js";
4
+ import { breachedAccountRange } from "./breached-account-range.js";
5
+ import { breachedDomain } from "./breached-domain.js";
6
+ import { breaches } from "./breaches.js";
7
+ import { dataClasses } from "./data-classes.js";
8
+ import { dataClassDescriptions } from "./data-class-descriptions.js";
9
+ import { generateDnsToken } from "./generate-dns-token.js";
10
+ import { latestBreach } from "./latest-breach.js";
11
+ import { pasteAccount } from "./paste-account.js";
12
+ import { pwnedPassword } from "./pwned-password.js";
13
+ import { pwnedPasswordRange } from "./pwned-password-range.js";
14
+ import { search } from "./search.js";
15
+ import { sendEmail } from "./send-email.js";
16
+ import { stealerLogsByEmail } from "./stealer-logs-by-email.js";
17
+ import { stealerLogsByEmailDomain } from "./stealer-logs-by-email-domain.js";
18
+ import { stealerLogsByWebsiteDomain } from "./stealer-logs-by-website-domain.js";
19
+ import { subscribedDomains } from "./subscribed-domains.js";
20
+ import { subscriptionStatus } from "./subscription-status.js";
21
+ import { verifyDnsToken } from "./verify-dns-token.js";
22
+ export type * from "./api/haveibeenpwned/types.js";
23
+ export { breach, breachedAccount, breachedAccountRange, breachedDomain, breaches, dataClasses, dataClassDescriptions, generateDnsToken, latestBreach, pasteAccount, pwnedPassword, pwnedPasswordRange, search, sendEmail, stealerLogsByEmail, stealerLogsByEmailDomain, stealerLogsByWebsiteDomain, subscribedDomains, subscriptionStatus, verifyDnsToken, RateLimitError, };
19
24
  export interface HIBP {
20
25
  breach: typeof breach;
21
26
  breachedAccount: typeof breachedAccount;
27
+ breachedAccountRange: typeof breachedAccountRange;
22
28
  breachedDomain: typeof breachedDomain;
23
29
  breaches: typeof breaches;
24
30
  dataClasses: typeof dataClasses;
31
+ dataClassDescriptions: typeof dataClassDescriptions;
32
+ generateDnsToken: typeof generateDnsToken;
25
33
  latestBreach: typeof latestBreach;
26
34
  pasteAccount: typeof pasteAccount;
27
35
  pwnedPassword: typeof pwnedPassword;
28
36
  pwnedPasswordRange: typeof pwnedPasswordRange;
29
37
  search: typeof search;
38
+ sendEmail: typeof sendEmail;
30
39
  stealerLogsByEmail: typeof stealerLogsByEmail;
31
40
  stealerLogsByEmailDomain: typeof stealerLogsByEmailDomain;
32
41
  stealerLogsByWebsiteDomain: typeof stealerLogsByWebsiteDomain;
33
42
  subscribedDomains: typeof subscribedDomains;
34
43
  subscriptionStatus: typeof subscriptionStatus;
44
+ verifyDnsToken: typeof verifyDnsToken;
35
45
  RateLimitError: typeof RateLimitError;
36
46
  }
package/dist/esm/hibp.js CHANGED
@@ -1,29 +1,23 @@
1
- import { RateLimitError } from './api/haveibeenpwned/fetch-from-api.js';
2
- import { breach } from './breach.js';
3
- import { breachedAccount } from './breached-account.js';
4
- import { breachedDomain } from './breached-domain.js';
5
- import { breaches } from './breaches.js';
6
- import { dataClasses } from './data-classes.js';
7
- import { latestBreach } from './latest-breach.js';
8
- import { pasteAccount } from './paste-account.js';
9
- import { pwnedPassword } from './pwned-password.js';
10
- import { pwnedPasswordRange } from './pwned-password-range.js';
11
- import { search } from './search.js';
12
- import { stealerLogsByEmail } from './stealer-logs-by-email.js';
13
- import { stealerLogsByEmailDomain } from './stealer-logs-by-email-domain.js';
14
- import { stealerLogsByWebsiteDomain } from './stealer-logs-by-website-domain.js';
15
- import { subscribedDomains } from './subscribed-domains.js';
16
- import { subscriptionStatus } from './subscription-status.js';
17
- /*
18
- * Export individual named functions to allow the following:
19
- *
20
- * import * as hibp from 'hibp'; // ESM (with tree-shaking)
21
- * import { search } from 'hibp'; // ESM (with tree-shaking)
22
- * const { search } = require('hibp'); // CommonJS
23
- * const hibp = require('hibp'); // CommonJS
24
- */
25
- export { breach, breachedAccount, breachedDomain, breaches, dataClasses, latestBreach, pasteAccount, pwnedPassword, pwnedPasswordRange, search, stealerLogsByEmail, stealerLogsByEmailDomain, stealerLogsByWebsiteDomain, subscribedDomains, subscriptionStatus, RateLimitError, };
26
- // https://github.com/jsdoc2md/jsdoc-to-markdown/wiki/How-to-document-TypeScript#jsdoc-comments-disappear
27
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
- const JSDOC2MARKDOWN_STUB = undefined;
1
+ import { RateLimitError } from "./api/haveibeenpwned/fetch-from-api.js";
2
+ import { breach } from "./breach.js";
3
+ import { breachedAccount } from "./breached-account.js";
4
+ import { breachedAccountRange } from "./breached-account-range.js";
5
+ import { breachedDomain } from "./breached-domain.js";
6
+ import { breaches } from "./breaches.js";
7
+ import { dataClasses } from "./data-classes.js";
8
+ import { dataClassDescriptions } from "./data-class-descriptions.js";
9
+ import { generateDnsToken } from "./generate-dns-token.js";
10
+ import { latestBreach } from "./latest-breach.js";
11
+ import { pasteAccount } from "./paste-account.js";
12
+ import { pwnedPassword } from "./pwned-password.js";
13
+ import { pwnedPasswordRange } from "./pwned-password-range.js";
14
+ import { search } from "./search.js";
15
+ import { sendEmail } from "./send-email.js";
16
+ import { stealerLogsByEmail } from "./stealer-logs-by-email.js";
17
+ import { stealerLogsByEmailDomain } from "./stealer-logs-by-email-domain.js";
18
+ import { stealerLogsByWebsiteDomain } from "./stealer-logs-by-website-domain.js";
19
+ import { subscribedDomains } from "./subscribed-domains.js";
20
+ import { subscriptionStatus } from "./subscription-status.js";
21
+ import { verifyDnsToken } from "./verify-dns-token.js";
22
+ export { breach, breachedAccount, breachedAccountRange, breachedDomain, breaches, dataClasses, dataClassDescriptions, generateDnsToken, latestBreach, pasteAccount, pwnedPassword, pwnedPasswordRange, search, sendEmail, stealerLogsByEmail, stealerLogsByEmailDomain, stealerLogsByWebsiteDomain, subscribedDomains, subscriptionStatus, verifyDnsToken, RateLimitError, };
29
23
  //# sourceMappingURL=hibp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hibp.js","sourceRoot":"","sources":["../../src/hibp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAI9D;;;;;;;GAOG;AAEH,OAAO,EACL,MAAM,EACN,eAAe,EACf,cAAc,EACd,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,CAAC;AAsBF,yGAAyG;AACzG,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"hibp.js","sourceRoot":"","sources":["../../src/hibp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,OAAO,EACL,MAAM,EACN,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,GACf,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Breach } from './api/haveibeenpwned/types.js';
1
+ import type { Breach } from "./api/haveibeenpwned/types.js";
2
2
  /**
3
3
  * Fetches the most recently added breach.
4
4
  *
@@ -31,18 +31,18 @@ export declare function latestBreach(options?: {
31
31
  * a custom base URL for the haveibeenpwned.com API endpoints (default:
32
32
  * `https://haveibeenpwned.com/api/v3`)
33
33
  */
34
- baseUrl?: string;
34
+ baseUrl?: string | undefined;
35
35
  /**
36
36
  * timeout for the request in milliseconds (default: none)
37
37
  */
38
- timeoutMs?: number;
38
+ timeoutMs?: number | undefined;
39
39
  /**
40
40
  * an AbortSignal to cancel the request (default: none)
41
41
  */
42
- signal?: AbortSignal;
42
+ signal?: AbortSignal | undefined;
43
43
  /**
44
44
  * a custom string to send as the User-Agent field in the request headers
45
45
  * (default: `hibp <version>`)
46
46
  */
47
- userAgent?: string;
47
+ userAgent?: string | undefined;
48
48
  }): Promise<Breach | null>;
@@ -1,4 +1,4 @@
1
- import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
1
+ import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
2
2
  /**
3
3
  * Fetches the most recently added breach.
4
4
  *
@@ -27,6 +27,6 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
27
27
  * }
28
28
  */
29
29
  export function latestBreach(options = {}) {
30
- return fetchFromApi('/latestbreach', options);
30
+ return fetchFromApi("/latestbreach", options);
31
31
  }
32
32
  //# sourceMappingURL=latest-breach.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"latest-breach.js","sourceRoot":"","sources":["../../src/latest-breach.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAC1B,UAmBI,EAAE;IAEN,OAAO,YAAY,CAAC,eAAe,EAAE,OAAO,CAA2B,CAAC;AAC1E,CAAC"}
1
+ {"version":3,"file":"latest-breach.js","sourceRoot":"","sources":["../../src/latest-breach.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAO,GAmBH,EAAE;IAEN,OAAO,YAAY,CAAS,eAAe,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}