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.
- package/API.md +433 -126
- package/CHANGELOG.md +52 -0
- package/MIGRATION.md +7 -5
- package/README.md +53 -27
- package/dist/browser/hibp.module.js +2 -2
- package/dist/esm/api/base-fetch.d.ts +9 -5
- package/dist/esm/api/base-fetch.js +17 -10
- package/dist/esm/api/base-fetch.js.map +1 -1
- package/dist/esm/api/haveibeenpwned/fetch-from-api.d.ts +1 -1
- package/dist/esm/api/haveibeenpwned/fetch-from-api.js +62 -44
- package/dist/esm/api/haveibeenpwned/fetch-from-api.js.map +1 -1
- package/dist/esm/api/haveibeenpwned/package-info.d.ts +1 -1
- package/dist/esm/api/haveibeenpwned/package-info.js +1 -1
- package/dist/esm/api/haveibeenpwned/post-to-api.d.ts +1 -0
- package/dist/esm/api/haveibeenpwned/post-to-api.js +23 -0
- package/dist/esm/api/haveibeenpwned/post-to-api.js.map +1 -0
- package/dist/esm/api/haveibeenpwned/responses.d.ts +0 -10
- package/dist/esm/api/haveibeenpwned/responses.js +5 -36
- package/dist/esm/api/haveibeenpwned/responses.js.map +1 -1
- package/dist/esm/api/haveibeenpwned/types.d.ts +22 -2
- package/dist/esm/api/haveibeenpwned/types.js +0 -3
- package/dist/esm/api/haveibeenpwned/types.js.map +1 -1
- package/dist/esm/api/pwnedpasswords/fetch-from-api.js +5 -28
- package/dist/esm/api/pwnedpasswords/fetch-from-api.js.map +1 -1
- package/dist/esm/api/pwnedpasswords/responses.d.ts +0 -6
- package/dist/esm/api/pwnedpasswords/responses.js +1 -7
- package/dist/esm/api/pwnedpasswords/responses.js.map +1 -1
- package/dist/esm/breach.d.ts +12 -5
- package/dist/esm/breach.js +8 -1
- package/dist/esm/breach.js.map +1 -1
- package/dist/esm/breached-account-range.d.ts +73 -0
- package/dist/esm/breached-account-range.js +60 -0
- package/dist/esm/breached-account-range.js.map +1 -0
- package/dist/esm/breached-account.d.ts +56 -45
- package/dist/esm/breached-account.js +4 -76
- package/dist/esm/breached-account.js.map +1 -1
- package/dist/esm/breached-domain.d.ts +7 -8
- package/dist/esm/breached-domain.js +2 -3
- package/dist/esm/breached-domain.js.map +1 -1
- package/dist/esm/breaches.d.ts +14 -7
- package/dist/esm/breaches.js +10 -5
- package/dist/esm/breaches.js.map +1 -1
- package/dist/esm/data-class-descriptions.d.ts +55 -0
- package/dist/esm/data-class-descriptions.js +39 -0
- package/dist/esm/data-class-descriptions.js.map +1 -0
- package/dist/esm/data-classes.d.ts +4 -4
- package/dist/esm/data-classes.js +2 -2
- package/dist/esm/data-classes.js.map +1 -1
- package/dist/esm/generate-dns-token.d.ts +67 -0
- package/dist/esm/generate-dns-token.js +49 -0
- package/dist/esm/generate-dns-token.js.map +1 -0
- package/dist/esm/hibp.d.ts +28 -18
- package/dist/esm/hibp.js +22 -28
- package/dist/esm/hibp.js.map +1 -1
- package/dist/esm/latest-breach.d.ts +5 -5
- package/dist/esm/latest-breach.js +2 -2
- package/dist/esm/latest-breach.js.map +1 -1
- package/dist/esm/paste-account.d.ts +13 -13
- package/dist/esm/paste-account.js +8 -8
- package/dist/esm/paste-account.js.map +1 -1
- package/dist/esm/pwned-password-range.d.ts +6 -6
- package/dist/esm/pwned-password-range.js +4 -6
- package/dist/esm/pwned-password-range.js.map +1 -1
- package/dist/esm/pwned-password.d.ts +5 -5
- package/dist/esm/pwned-password.js +12 -7
- package/dist/esm/pwned-password.js.map +1 -1
- package/dist/esm/search.d.ts +57 -40
- package/dist/esm/search.js +5 -74
- package/dist/esm/search.js.map +1 -1
- package/dist/esm/send-email.d.ts +69 -0
- package/dist/esm/send-email.js +49 -0
- package/dist/esm/send-email.js.map +1 -0
- package/dist/esm/stealer-logs-by-email-domain.d.ts +13 -14
- package/dist/esm/stealer-logs-by-email-domain.js +8 -9
- package/dist/esm/stealer-logs-by-email-domain.js.map +1 -1
- package/dist/esm/stealer-logs-by-email.d.ts +9 -10
- package/dist/esm/stealer-logs-by-email.js +5 -6
- package/dist/esm/stealer-logs-by-email.js.map +1 -1
- package/dist/esm/stealer-logs-by-website-domain.d.ts +9 -10
- package/dist/esm/stealer-logs-by-website-domain.js +5 -6
- package/dist/esm/stealer-logs-by-website-domain.js.map +1 -1
- package/dist/esm/subscribed-domains.d.ts +7 -8
- package/dist/esm/subscribed-domains.js +4 -5
- package/dist/esm/subscribed-domains.js.map +1 -1
- package/dist/esm/subscription-status.d.ts +16 -11
- package/dist/esm/subscription-status.js +13 -8
- package/dist/esm/subscription-status.js.map +1 -1
- package/dist/esm/verify-dns-token.d.ts +60 -0
- package/dist/esm/verify-dns-token.js +41 -0
- package/dist/esm/verify-dns-token.js.map +1 -0
- package/package.json +55 -56
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { fetchFromApi } from
|
|
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
|
-
*
|
|
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 { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
|
|
|
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
|
-
*
|
|
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
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stealer-logs-by-email-domain.js","sourceRoot":"","sources":["../../src/stealer-logs-by-email-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;GAMG;AAEH
|
|
1
|
+
{"version":3,"file":"stealer-logs-by-email-domain.js","sourceRoot":"","sources":["../../src/stealer-logs-by-email-domain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,UAAU,wBAAwB,CACtC,WAAmB,EACnB,OAAO,GAuBH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,6BAA6B,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;IAEhF,OAAO,YAAY,CAAgC,QAAQ,EAAE;QAC3D,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* Returns an array of domains for which stealer logs contain entries for the
|
|
5
5
|
* supplied email address.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* a valid API key on your behalf).
|
|
7
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
8
|
+
* option here is not explicitly required, but direct requests made without it
|
|
9
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
10
|
+
* key on your behalf).
|
|
12
11
|
*
|
|
13
12
|
* @param {string} emailAddress the email address to query
|
|
14
13
|
* @param {object} [options] a configuration object
|
|
@@ -54,23 +53,23 @@ export declare function stealerLogsByEmail(emailAddress: string, options?: {
|
|
|
54
53
|
/**
|
|
55
54
|
* an API key from https://haveibeenpwned.com/API/Key (default: undefined)
|
|
56
55
|
*/
|
|
57
|
-
apiKey?: string;
|
|
56
|
+
apiKey?: string | undefined;
|
|
58
57
|
/**
|
|
59
58
|
* a custom base URL for the haveibeenpwned.com API endpoints (default:
|
|
60
59
|
* `https://haveibeenpwned.com/api/v3`)
|
|
61
60
|
*/
|
|
62
|
-
baseUrl?: string;
|
|
61
|
+
baseUrl?: string | undefined;
|
|
63
62
|
/**
|
|
64
63
|
* timeout for the request in milliseconds (default: none)
|
|
65
64
|
*/
|
|
66
|
-
timeoutMs?: number;
|
|
65
|
+
timeoutMs?: number | undefined;
|
|
67
66
|
/**
|
|
68
67
|
* an AbortSignal to cancel the request (default: none)
|
|
69
68
|
*/
|
|
70
|
-
signal?: AbortSignal;
|
|
69
|
+
signal?: AbortSignal | undefined;
|
|
71
70
|
/**
|
|
72
71
|
* a custom string to send as the User-Agent field in the request headers
|
|
73
72
|
* (default: `hibp <version>`)
|
|
74
73
|
*/
|
|
75
|
-
userAgent?: string;
|
|
74
|
+
userAgent?: string | undefined;
|
|
76
75
|
}): Promise<string[] | null>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { fetchFromApi } from
|
|
1
|
+
import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Fetches all stealer log domains for an email address.
|
|
4
4
|
*
|
|
5
5
|
* Returns an array of domains for which stealer logs contain entries for the
|
|
6
6
|
* supplied email address.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
11
|
-
*
|
|
12
|
-
* a valid API key on your behalf).
|
|
8
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
9
|
+
* option here is not explicitly required, but direct requests made without it
|
|
10
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
11
|
+
* key on your behalf).
|
|
13
12
|
*
|
|
14
13
|
* @param {string} emailAddress the email address to query
|
|
15
14
|
* @param {object} [options] a configuration object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stealer-logs-by-email.js","sourceRoot":"","sources":["../../src/stealer-logs-by-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"stealer-logs-by-email.js","sourceRoot":"","sources":["../../src/stealer-logs-by-email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,UAAU,kBAAkB,CAChC,YAAoB,EACpB,OAAO,GAuBH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,uBAAuB,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;IAE3E,OAAO,YAAY,CAAW,QAAQ,EAAE;QACtC,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -4,11 +4,10 @@
|
|
|
4
4
|
* The result is an array of strings representing email addresses found in
|
|
5
5
|
* stealer logs for the specified website domain (e.g., "example.com").
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* that inserts a valid API key on your behalf).
|
|
7
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
8
|
+
* option here is not explicitly required, but direct requests made without it
|
|
9
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
10
|
+
* key on your behalf).
|
|
12
11
|
*
|
|
13
12
|
* @param {string} websiteDomain the website domain to query (e.g., "example.com")
|
|
14
13
|
* @param {object} [options] a configuration object
|
|
@@ -54,23 +53,23 @@ export declare function stealerLogsByWebsiteDomain(websiteDomain: string, option
|
|
|
54
53
|
/**
|
|
55
54
|
* an API key from https://haveibeenpwned.com/API/Key (default: undefined)
|
|
56
55
|
*/
|
|
57
|
-
apiKey?: string;
|
|
56
|
+
apiKey?: string | undefined;
|
|
58
57
|
/**
|
|
59
58
|
* a custom base URL for the haveibeenpwned.com API endpoints (default:
|
|
60
59
|
* `https://haveibeenpwned.com/api/v3`)
|
|
61
60
|
*/
|
|
62
|
-
baseUrl?: string;
|
|
61
|
+
baseUrl?: string | undefined;
|
|
63
62
|
/**
|
|
64
63
|
* timeout for the request in milliseconds (default: none)
|
|
65
64
|
*/
|
|
66
|
-
timeoutMs?: number;
|
|
65
|
+
timeoutMs?: number | undefined;
|
|
67
66
|
/**
|
|
68
67
|
* an AbortSignal to cancel the request (default: none)
|
|
69
68
|
*/
|
|
70
|
-
signal?: AbortSignal;
|
|
69
|
+
signal?: AbortSignal | undefined;
|
|
71
70
|
/**
|
|
72
71
|
* a custom string to send as the User-Agent field in the request headers
|
|
73
72
|
* (default: `hibp <version>`)
|
|
74
73
|
*/
|
|
75
|
-
userAgent?: string;
|
|
74
|
+
userAgent?: string | undefined;
|
|
76
75
|
}): Promise<string[] | null>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { fetchFromApi } from
|
|
1
|
+
import { fetchFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Fetches all stealer log email addresses for a website domain.
|
|
4
4
|
*
|
|
5
5
|
* The result is an array of strings representing email addresses found in
|
|
6
6
|
* stealer logs for the specified website domain (e.g., "example.com").
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* that inserts a valid API key on your behalf).
|
|
8
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
9
|
+
* option here is not explicitly required, but direct requests made without it
|
|
10
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
11
|
+
* key on your behalf).
|
|
13
12
|
*
|
|
14
13
|
* @param {string} websiteDomain the website domain to query (e.g., "example.com")
|
|
15
14
|
* @param {object} [options] a configuration object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stealer-logs-by-website-domain.js","sourceRoot":"","sources":["../../src/stealer-logs-by-website-domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"stealer-logs-by-website-domain.js","sourceRoot":"","sources":["../../src/stealer-logs-by-website-domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,UAAU,0BAA0B,CACxC,aAAqB,EACrB,OAAO,GAuBH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,+BAA+B,kBAAkB,CAAC,aAAa,CAAC,EAAE,CAAC;IAEpF,OAAO,YAAY,CAAW,QAAQ,EAAE;QACtC,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SubscribedDomain } from
|
|
1
|
+
import type { SubscribedDomain } from "./api/haveibeenpwned/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* An object representing a subscribed domain.
|
|
4
4
|
*
|
|
@@ -16,8 +16,7 @@ import type { SubscribedDomain } from './api/haveibeenpwned/types.js';
|
|
|
16
16
|
* after verifying control. Each domain includes metadata about breach counts and
|
|
17
17
|
* the next renewal date, where available.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* https://haveibeenpwned.com/API/Key for the `subscribeddomains` endpoint. The
|
|
19
|
+
* Requires a Core or Pro API key from https://haveibeenpwned.com/API/Key. The
|
|
21
20
|
* `apiKey` option here is not explicitly required, but direct requests made
|
|
22
21
|
* without it will fail (unless you specify a `baseUrl` to a proxy that inserts
|
|
23
22
|
* a valid API key on your behalf).
|
|
@@ -56,23 +55,23 @@ export declare function subscribedDomains(options?: {
|
|
|
56
55
|
/**
|
|
57
56
|
* an API key from https://haveibeenpwned.com/API/Key (default: undefined)
|
|
58
57
|
*/
|
|
59
|
-
apiKey?: string;
|
|
58
|
+
apiKey?: string | undefined;
|
|
60
59
|
/**
|
|
61
60
|
* a custom base URL for the haveibeenpwned.com API endpoints (default:
|
|
62
61
|
* `https://haveibeenpwned.com/api/v3`)
|
|
63
62
|
*/
|
|
64
|
-
baseUrl?: string;
|
|
63
|
+
baseUrl?: string | undefined;
|
|
65
64
|
/**
|
|
66
65
|
* timeout for the request in milliseconds (default: none)
|
|
67
66
|
*/
|
|
68
|
-
timeoutMs?: number;
|
|
67
|
+
timeoutMs?: number | undefined;
|
|
69
68
|
/**
|
|
70
69
|
* an AbortSignal to cancel the request (default: none)
|
|
71
70
|
*/
|
|
72
|
-
signal?: AbortSignal;
|
|
71
|
+
signal?: AbortSignal | undefined;
|
|
73
72
|
/**
|
|
74
73
|
* a custom string to send as the User-Agent field in the request headers
|
|
75
74
|
* (default: `hibp <version>`)
|
|
76
75
|
*/
|
|
77
|
-
userAgent?: string;
|
|
76
|
+
userAgent?: string | undefined;
|
|
78
77
|
}): Promise<SubscribedDomain[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fetchRequiredFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
|
|
2
2
|
/**
|
|
3
3
|
* An object representing a subscribed domain.
|
|
4
4
|
*
|
|
@@ -16,8 +16,7 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
|
|
|
16
16
|
* after verifying control. Each domain includes metadata about breach counts and
|
|
17
17
|
* the next renewal date, where available.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
* https://haveibeenpwned.com/API/Key for the `subscribeddomains` endpoint. The
|
|
19
|
+
* Requires a Core or Pro API key from https://haveibeenpwned.com/API/Key. The
|
|
21
20
|
* `apiKey` option here is not explicitly required, but direct requests made
|
|
22
21
|
* without it will fail (unless you specify a `baseUrl` to a proxy that inserts
|
|
23
22
|
* a valid API key on your behalf).
|
|
@@ -54,8 +53,8 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
|
|
|
54
53
|
*/
|
|
55
54
|
export function subscribedDomains(options = {}) {
|
|
56
55
|
const { apiKey, baseUrl, timeoutMs, signal, userAgent } = options;
|
|
57
|
-
const endpoint =
|
|
58
|
-
return
|
|
56
|
+
const endpoint = "/subscribeddomains";
|
|
57
|
+
return fetchRequiredFromApi(endpoint, {
|
|
59
58
|
apiKey,
|
|
60
59
|
baseUrl,
|
|
61
60
|
timeoutMs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribed-domains.js","sourceRoot":"","sources":["../../src/subscribed-domains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"subscribed-domains.js","sourceRoot":"","sources":["../../src/subscribed-domains.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAO,GAuBH,EAAE;IAEN,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAClE,MAAM,QAAQ,GAAG,oBAAoB,CAAC;IAEtC,OAAO,oBAAoB,CAAqB,QAAQ,EAAE;QACxD,MAAM;QACN,OAAO;QACP,SAAS;QACT,MAAM;QACN,SAAS;KACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SubscriptionStatus } from
|
|
1
|
+
import type { SubscriptionStatus } from "./api/haveibeenpwned/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* An object representing the status of your HIBP subscription.
|
|
4
4
|
*
|
|
@@ -8,16 +8,21 @@ import type { SubscriptionStatus } from './api/haveibeenpwned/types.js';
|
|
|
8
8
|
* @property {string} SubscribedUntil
|
|
9
9
|
* @property {number} Rpm
|
|
10
10
|
* @property {number} DomainSearchMaxBreachedAccounts
|
|
11
|
+
* @property {number|null} MaxBreachedDomains maximum domains that can be added; null means no limit
|
|
11
12
|
* @property {boolean} IncludesStealerLogs
|
|
13
|
+
* @property {boolean} IncludesBulkDomainAdd access to APIs for adding domains in bulk
|
|
14
|
+
* @property {boolean} IncludesAutoSubdomainVerification automatic verification of subdomains of a verified apex domain
|
|
15
|
+
* @property {boolean} IncludesCustomerDomains permission to add customer domains
|
|
16
|
+
* @property {boolean} IncludesKAnon access to email address searches using k-anonymity
|
|
12
17
|
*/
|
|
13
18
|
/**
|
|
14
19
|
* Fetches the current status of your HIBP subscription (API key).
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
* https://haveibeenpwned.com/API/Key
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* Requires a Core, Pro, or High RPM API key from
|
|
22
|
+
* https://haveibeenpwned.com/API/Key. The `apiKey` option here is not
|
|
23
|
+
* explicitly required, but direct requests made without it will fail (unless
|
|
24
|
+
* you specify a `baseUrl` to a proxy that inserts a valid API key on your
|
|
25
|
+
* behalf).
|
|
21
26
|
*
|
|
22
27
|
* @param {object} [options] a configuration object
|
|
23
28
|
* @param {string} [options.apiKey] an API key from
|
|
@@ -53,23 +58,23 @@ export declare function subscriptionStatus(options?: {
|
|
|
53
58
|
/**
|
|
54
59
|
* an API key from https://haveibeenpwned.com/API/Key (default: undefined)
|
|
55
60
|
*/
|
|
56
|
-
apiKey?: string;
|
|
61
|
+
apiKey?: string | undefined;
|
|
57
62
|
/**
|
|
58
63
|
* a custom base URL for the haveibeenpwned.com API endpoints (default:
|
|
59
64
|
* `https://haveibeenpwned.com/api/v3`)
|
|
60
65
|
*/
|
|
61
|
-
baseUrl?: string;
|
|
66
|
+
baseUrl?: string | undefined;
|
|
62
67
|
/**
|
|
63
68
|
* timeout for the request in milliseconds (default: none)
|
|
64
69
|
*/
|
|
65
|
-
timeoutMs?: number;
|
|
70
|
+
timeoutMs?: number | undefined;
|
|
66
71
|
/**
|
|
67
72
|
* an AbortSignal to cancel the request (default: none)
|
|
68
73
|
*/
|
|
69
|
-
signal?: AbortSignal;
|
|
74
|
+
signal?: AbortSignal | undefined;
|
|
70
75
|
/**
|
|
71
76
|
* a custom string to send as the User-Agent field in the request headers
|
|
72
77
|
* (default: `hibp <version>`)
|
|
73
78
|
*/
|
|
74
|
-
userAgent?: string;
|
|
79
|
+
userAgent?: string | undefined;
|
|
75
80
|
}): Promise<SubscriptionStatus>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fetchRequiredFromApi } from "./api/haveibeenpwned/fetch-from-api.js";
|
|
2
2
|
/**
|
|
3
3
|
* An object representing the status of your HIBP subscription.
|
|
4
4
|
*
|
|
@@ -8,16 +8,21 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
|
|
|
8
8
|
* @property {string} SubscribedUntil
|
|
9
9
|
* @property {number} Rpm
|
|
10
10
|
* @property {number} DomainSearchMaxBreachedAccounts
|
|
11
|
+
* @property {number|null} MaxBreachedDomains maximum domains that can be added; null means no limit
|
|
11
12
|
* @property {boolean} IncludesStealerLogs
|
|
13
|
+
* @property {boolean} IncludesBulkDomainAdd access to APIs for adding domains in bulk
|
|
14
|
+
* @property {boolean} IncludesAutoSubdomainVerification automatic verification of subdomains of a verified apex domain
|
|
15
|
+
* @property {boolean} IncludesCustomerDomains permission to add customer domains
|
|
16
|
+
* @property {boolean} IncludesKAnon access to email address searches using k-anonymity
|
|
12
17
|
*/
|
|
13
18
|
/**
|
|
14
19
|
* Fetches the current status of your HIBP subscription (API key).
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
* https://haveibeenpwned.com/API/Key
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* Requires a Core, Pro, or High RPM API key from
|
|
22
|
+
* https://haveibeenpwned.com/API/Key. The `apiKey` option here is not
|
|
23
|
+
* explicitly required, but direct requests made without it will fail (unless
|
|
24
|
+
* you specify a `baseUrl` to a proxy that inserts a valid API key on your
|
|
25
|
+
* behalf).
|
|
21
26
|
*
|
|
22
27
|
* @param {object} [options] a configuration object
|
|
23
28
|
* @param {string} [options.apiKey] an API key from
|
|
@@ -50,7 +55,7 @@ import { fetchFromApi } from './api/haveibeenpwned/fetch-from-api.js';
|
|
|
50
55
|
* }
|
|
51
56
|
*/
|
|
52
57
|
export async function subscriptionStatus(options = {}) {
|
|
53
|
-
const endpoint =
|
|
54
|
-
return
|
|
58
|
+
const endpoint = "/subscription/status";
|
|
59
|
+
return fetchRequiredFromApi(endpoint, options);
|
|
55
60
|
}
|
|
56
61
|
//# sourceMappingURL=subscription-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-status.js","sourceRoot":"","sources":["../../src/subscription-status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"subscription-status.js","sourceRoot":"","sources":["../../src/subscription-status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAE9E;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAO,GAuBH,EAAE;IAEN,MAAM,QAAQ,GAAG,sBAAsB,CAAC;IAExC,OAAO,oBAAoB,CAAqB,QAAQ,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verifies a domain's published HIBP TXT record.
|
|
3
|
+
*
|
|
4
|
+
* Generate the value with `generateDnsToken`, publish it at your DNS provider,
|
|
5
|
+
* and allow time for DNS propagation first. The record can be removed after
|
|
6
|
+
* verification succeeds.
|
|
7
|
+
*
|
|
8
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
9
|
+
* option here is not explicitly required, but direct requests made without it
|
|
10
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
11
|
+
* key on your behalf).
|
|
12
|
+
*
|
|
13
|
+
* @see https://haveibeenpwned.com/API/v3#VerifyDomainViaDns
|
|
14
|
+
* @param {string} domain the domain to verify (e.g., "example.com")
|
|
15
|
+
* @param {object} [options] a configuration object
|
|
16
|
+
* @param {string} [options.apiKey] an API key from
|
|
17
|
+
* https://haveibeenpwned.com/API/Key (default: undefined)
|
|
18
|
+
* @param {string} [options.baseUrl] a custom base URL for the
|
|
19
|
+
* haveibeenpwned.com API endpoints (default:
|
|
20
|
+
* `https://haveibeenpwned.com/api/v3`)
|
|
21
|
+
* @param {number} [options.timeoutMs] timeout for the request in milliseconds
|
|
22
|
+
* (default: none)
|
|
23
|
+
* @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
|
|
24
|
+
* @param {string} [options.userAgent] a custom string to send as the User-Agent
|
|
25
|
+
* field in the request headers (default: `hibp <version>`)
|
|
26
|
+
* @returns {Promise<void>} a Promise which resolves without parsing the
|
|
27
|
+
* response body when verification succeeds, or rejects with an Error
|
|
28
|
+
* containing the upstream failure reason
|
|
29
|
+
* @example
|
|
30
|
+
* try {
|
|
31
|
+
* await verifyDnsToken("example.com", { apiKey: "my-api-key" });
|
|
32
|
+
* // ...
|
|
33
|
+
* } catch (err) {
|
|
34
|
+
* // ...
|
|
35
|
+
* }
|
|
36
|
+
*/
|
|
37
|
+
export declare function verifyDnsToken(domain: string, options?: {
|
|
38
|
+
/**
|
|
39
|
+
* an API key from https://haveibeenpwned.com/API/Key (default: undefined)
|
|
40
|
+
*/
|
|
41
|
+
apiKey?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* a custom base URL for the haveibeenpwned.com API endpoints (default:
|
|
44
|
+
* `https://haveibeenpwned.com/api/v3`)
|
|
45
|
+
*/
|
|
46
|
+
baseUrl?: string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* timeout for the request in milliseconds (default: none)
|
|
49
|
+
*/
|
|
50
|
+
timeoutMs?: number | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* an AbortSignal to cancel the request (default: none)
|
|
53
|
+
*/
|
|
54
|
+
signal?: AbortSignal | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* a custom string to send as the User-Agent field in the request headers
|
|
57
|
+
* (default: `hibp <version>`)
|
|
58
|
+
*/
|
|
59
|
+
userAgent?: string | undefined;
|
|
60
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { postToApi } from "./api/haveibeenpwned/post-to-api.js";
|
|
2
|
+
/**
|
|
3
|
+
* Verifies a domain's published HIBP TXT record.
|
|
4
|
+
*
|
|
5
|
+
* Generate the value with `generateDnsToken`, publish it at your DNS provider,
|
|
6
|
+
* and allow time for DNS propagation first. The record can be removed after
|
|
7
|
+
* verification succeeds.
|
|
8
|
+
*
|
|
9
|
+
* Requires a Pro API key from https://haveibeenpwned.com/API/Key. The `apiKey`
|
|
10
|
+
* option here is not explicitly required, but direct requests made without it
|
|
11
|
+
* will fail (unless you specify a `baseUrl` to a proxy that inserts a valid API
|
|
12
|
+
* key on your behalf).
|
|
13
|
+
*
|
|
14
|
+
* @see https://haveibeenpwned.com/API/v3#VerifyDomainViaDns
|
|
15
|
+
* @param {string} domain the domain to verify (e.g., "example.com")
|
|
16
|
+
* @param {object} [options] a configuration object
|
|
17
|
+
* @param {string} [options.apiKey] an API key from
|
|
18
|
+
* https://haveibeenpwned.com/API/Key (default: undefined)
|
|
19
|
+
* @param {string} [options.baseUrl] a custom base URL for the
|
|
20
|
+
* haveibeenpwned.com API endpoints (default:
|
|
21
|
+
* `https://haveibeenpwned.com/api/v3`)
|
|
22
|
+
* @param {number} [options.timeoutMs] timeout for the request in milliseconds
|
|
23
|
+
* (default: none)
|
|
24
|
+
* @param {AbortSignal} [options.signal] an AbortSignal to cancel the request (default: none)
|
|
25
|
+
* @param {string} [options.userAgent] a custom string to send as the User-Agent
|
|
26
|
+
* field in the request headers (default: `hibp <version>`)
|
|
27
|
+
* @returns {Promise<void>} a Promise which resolves without parsing the
|
|
28
|
+
* response body when verification succeeds, or rejects with an Error
|
|
29
|
+
* containing the upstream failure reason
|
|
30
|
+
* @example
|
|
31
|
+
* try {
|
|
32
|
+
* await verifyDnsToken("example.com", { apiKey: "my-api-key" });
|
|
33
|
+
* // ...
|
|
34
|
+
* } catch (err) {
|
|
35
|
+
* // ...
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
export async function verifyDnsToken(domain, options = {}) {
|
|
39
|
+
await postToApi("/domainVerification/verifyDnsToken", { DomainName: domain }, options);
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=verify-dns-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-dns-token.js","sourceRoot":"","sources":["../../src/verify-dns-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,OAAO,GAuBH,EAAE;IAEN,MAAM,SAAS,CACb,oCAAoC,EACpC,EAAE,UAAU,EAAE,MAAM,EAAE,EACtB,OAAO,CACR,CAAC;AACJ,CAAC"}
|