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,22 +1,22 @@
|
|
|
1
|
-
import type { Paste } from
|
|
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
|
-
*
|
|
16
|
-
* https://haveibeenpwned.com/API/Key
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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
|
|
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
|
-
*
|
|
16
|
-
* https://haveibeenpwned.com/API/Key
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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,
|
|
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?:
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
37
|
+
const count = range[suffix];
|
|
38
|
+
return count === undefined || Number.isNaN(count) ? 0 : count;
|
|
38
39
|
}
|
|
39
40
|
async function getPasswordHashParts(password) {
|
|
40
|
-
|
|
41
|
+
const subtle = webCryptoIfAvailable()?.subtle;
|
|
42
|
+
if (subtle) {
|
|
41
43
|
const msgUint8 = new TextEncoder().encode(password);
|
|
42
|
-
const hashBuffer = await
|
|
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,
|
|
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(
|
|
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,
|
|
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"}
|
package/dist/esm/search.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Breach, Paste } from
|
|
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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* `
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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 {};
|
package/dist/esm/search.js
CHANGED
|
@@ -1,76 +1,8 @@
|
|
|
1
|
-
import { breachedAccount } from
|
|
2
|
-
import { pasteAccount } from
|
|
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
|
-
|
|
85
|
-
/^.+@.+$/.test(account)
|
|
16
|
+
PASTE_API_EMAIL_PATTERN.test(account)
|
|
86
17
|
? pasteAccount(account, { apiKey, baseUrl, timeoutMs, signal, userAgent })
|
|
87
18
|
: null,
|
|
88
19
|
]);
|
package/dist/esm/search.js.map
CHANGED
|
@@ -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;
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
@@ -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>;
|