@emailsherlock/node 0.2.1 → 0.3.0

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.
@@ -0,0 +1,574 @@
1
+ /**
2
+ *
3
+ * @export
4
+ * @interface AccountStatusResponse
5
+ */
6
+ export interface AccountStatusResponse {
7
+ /**
8
+ *
9
+ * @type {AccountStatusResponseCredits}
10
+ * @memberof AccountStatusResponse
11
+ */
12
+ credits: AccountStatusResponseCredits;
13
+ /**
14
+ *
15
+ * @type {AccountStatusResponseRateLimit}
16
+ * @memberof AccountStatusResponse
17
+ */
18
+ rate_limit: AccountStatusResponseRateLimit;
19
+ /**
20
+ * The plan behind the key.
21
+ * @type {string}
22
+ * @memberof AccountStatusResponse
23
+ */
24
+ plan?: string | null;
25
+ /**
26
+ * Whether the key is a sandbox key (es_test_).
27
+ * @type {boolean}
28
+ * @memberof AccountStatusResponse
29
+ */
30
+ sandbox: boolean;
31
+ }
32
+ /**
33
+ * Credit balance buckets.
34
+ * @export
35
+ * @interface AccountStatusResponseCredits
36
+ */
37
+ export interface AccountStatusResponseCredits {
38
+ /**
39
+ * Spendable credits across all buckets.
40
+ * @type {number}
41
+ * @memberof AccountStatusResponseCredits
42
+ */
43
+ total?: number;
44
+ /**
45
+ *
46
+ * @type {number}
47
+ * @memberof AccountStatusResponseCredits
48
+ */
49
+ purchased?: number;
50
+ /**
51
+ *
52
+ * @type {number}
53
+ * @memberof AccountStatusResponseCredits
54
+ */
55
+ gifted?: number;
56
+ }
57
+ /**
58
+ * The per-key sliding-window rate limit.
59
+ * @export
60
+ * @interface AccountStatusResponseRateLimit
61
+ */
62
+ export interface AccountStatusResponseRateLimit {
63
+ /**
64
+ * Requests per minute for this key.
65
+ * @type {number}
66
+ * @memberof AccountStatusResponseRateLimit
67
+ */
68
+ limit?: number;
69
+ /**
70
+ * Requests left in the current window. This call counted against it.
71
+ * @type {number}
72
+ * @memberof AccountStatusResponseRateLimit
73
+ */
74
+ remaining?: number;
75
+ /**
76
+ * Unix timestamp when the window frees up.
77
+ * @type {number}
78
+ * @memberof AccountStatusResponseRateLimit
79
+ */
80
+ reset?: number;
81
+ }
82
+ /**
83
+ *
84
+ * @export
85
+ * @interface ApiError
86
+ */
87
+ export interface ApiError {
88
+ /**
89
+ *
90
+ * @type {ApiErrorError}
91
+ * @memberof ApiError
92
+ */
93
+ error: ApiErrorError;
94
+ }
95
+ /**
96
+ *
97
+ * @export
98
+ * @interface ApiErrorError
99
+ */
100
+ export interface ApiErrorError {
101
+ /**
102
+ * A stable machine-readable error code.
103
+ * @type {string}
104
+ * @memberof ApiErrorError
105
+ */
106
+ code: string;
107
+ /**
108
+ * A human-readable explanation.
109
+ * @type {string}
110
+ * @memberof ApiErrorError
111
+ */
112
+ message: string;
113
+ }
114
+ /**
115
+ *
116
+ * @export
117
+ * @interface BatchItemError
118
+ */
119
+ export interface BatchItemError {
120
+ /**
121
+ * The address that failed, or null if the input was not a string.
122
+ * @type {string}
123
+ * @memberof BatchItemError
124
+ */
125
+ email?: string | null;
126
+ /**
127
+ * Why this address could not be processed.
128
+ * @type {BatchItemErrorErrorEnum}
129
+ * @memberof BatchItemError
130
+ */
131
+ error: BatchItemErrorErrorEnum;
132
+ }
133
+ /**
134
+ * @export
135
+ */
136
+ export declare const BatchItemErrorErrorEnum: {
137
+ readonly InvalidEmail: "invalid_email";
138
+ readonly InsufficientCredits: "insufficient_credits";
139
+ readonly VerifyUnavailable: "verify_unavailable";
140
+ };
141
+ export type BatchItemErrorErrorEnum = typeof BatchItemErrorErrorEnum[keyof typeof BatchItemErrorErrorEnum];
142
+ /**
143
+ *
144
+ * @export
145
+ * @interface GuardEventsRequest
146
+ */
147
+ export interface GuardEventsRequest {
148
+ /**
149
+ * Guard decision events to record. Non-empty, capped per the batch limit. Each item: {domain?, verdict, action, reasons[], degraded, source, integration?, lib_version?, spec_version?, property_key?}. The full email address is never sent, only the domain. property_key is the optional public site-key of a property (EM-998); when it matches one of your properties the event is attributed to it, otherwise the event still records at the account level.
150
+ * @type {Array<object>}
151
+ * @memberof GuardEventsRequest
152
+ */
153
+ events: Array<object>;
154
+ }
155
+ /**
156
+ *
157
+ * @export
158
+ * @interface VerifyBatchRequest
159
+ */
160
+ export interface VerifyBatchRequest {
161
+ /**
162
+ * The addresses to verify. Non-empty, capped per the batch limit.
163
+ * @type {Array<string>}
164
+ * @memberof VerifyBatchRequest
165
+ */
166
+ emails: Array<string>;
167
+ }
168
+ /**
169
+ *
170
+ * @export
171
+ * @interface VerifyBatchResponse
172
+ */
173
+ export interface VerifyBatchResponse {
174
+ /**
175
+ * One entry per submitted address, in order. Each entry is a verify result, or a per-item error for an address that could not be processed.
176
+ * @type {Array<VerifyBatchResponseResultsInner>}
177
+ * @memberof VerifyBatchResponse
178
+ */
179
+ results: Array<VerifyBatchResponseResultsInner>;
180
+ }
181
+ /**
182
+ * @type VerifyBatchResponseResultsInner
183
+ *
184
+ * @export
185
+ */
186
+ export type VerifyBatchResponseResultsInner = BatchItemError | VerifyResultResponse;
187
+ /**
188
+ *
189
+ * @export
190
+ * @interface VerifyDecisionResponse
191
+ */
192
+ export interface VerifyDecisionResponse {
193
+ /**
194
+ * Recommended action. Policy authority stays with the caller.
195
+ * @type {VerifyDecisionResponseRecommendationEnum}
196
+ * @memberof VerifyDecisionResponse
197
+ */
198
+ recommendation: VerifyDecisionResponseRecommendationEnum;
199
+ /**
200
+ * Signals that drove the recommendation. Values correspond to VerifyReason identifiers.
201
+ * @type {Array<string>}
202
+ * @memberof VerifyDecisionResponse
203
+ */
204
+ reasons: Array<string>;
205
+ }
206
+ /**
207
+ * @export
208
+ */
209
+ export declare const VerifyDecisionResponseRecommendationEnum: {
210
+ readonly Allow: "allow";
211
+ readonly Deny: "deny";
212
+ readonly Review: "review";
213
+ };
214
+ export type VerifyDecisionResponseRecommendationEnum = typeof VerifyDecisionResponseRecommendationEnum[keyof typeof VerifyDecisionResponseRecommendationEnum];
215
+ /**
216
+ *
217
+ * @export
218
+ * @interface VerifyDomainResponse
219
+ */
220
+ export interface VerifyDomainResponse {
221
+ /**
222
+ * The domain behind the address.
223
+ * @type {string}
224
+ * @memberof VerifyDomainResponse
225
+ */
226
+ name: string;
227
+ /**
228
+ * Host classification. A domain can carry more than one type.
229
+ * @type {Array<VerifyDomainResponseTypesEnum>}
230
+ * @memberof VerifyDomainResponse
231
+ */
232
+ types?: Array<VerifyDomainResponseTypesEnum> | null;
233
+ /**
234
+ * 0-100 domain reputation score, higher is better. Null when the domain has not been scored yet.
235
+ * @type {number}
236
+ * @memberof VerifyDomainResponse
237
+ */
238
+ score?: number | null;
239
+ /**
240
+ * An SPF record exists.
241
+ * @type {boolean}
242
+ * @memberof VerifyDomainResponse
243
+ */
244
+ spf?: boolean | null;
245
+ /**
246
+ * A DKIM record was found.
247
+ * @type {boolean}
248
+ * @memberof VerifyDomainResponse
249
+ */
250
+ dkim?: boolean | null;
251
+ /**
252
+ * A DMARC record exists.
253
+ * @type {boolean}
254
+ * @memberof VerifyDomainResponse
255
+ */
256
+ dmarc?: boolean | null;
257
+ /**
258
+ * The published DMARC policy.
259
+ * @type {VerifyDomainResponseDmarcPolicyEnum}
260
+ * @memberof VerifyDomainResponse
261
+ */
262
+ dmarc_policy?: VerifyDomainResponseDmarcPolicyEnum | null;
263
+ /**
264
+ * An MTA-STS policy is published.
265
+ * @type {boolean}
266
+ * @memberof VerifyDomainResponse
267
+ */
268
+ mta_sts?: boolean | null;
269
+ /**
270
+ * A TLS-RPT record exists.
271
+ * @type {boolean}
272
+ * @memberof VerifyDomainResponse
273
+ */
274
+ tls_rpt?: boolean | null;
275
+ /**
276
+ * A BIMI record exists.
277
+ * @type {boolean}
278
+ * @memberof VerifyDomainResponse
279
+ */
280
+ bimi?: boolean | null;
281
+ /**
282
+ * DANE/TLSA records exist for the MX hosts.
283
+ * @type {boolean}
284
+ * @memberof VerifyDomainResponse
285
+ */
286
+ dane?: boolean | null;
287
+ /**
288
+ * Number of public DNS blacklists currently listing this domain's mail infrastructure.
289
+ * @type {number}
290
+ * @memberof VerifyDomainResponse
291
+ */
292
+ blacklists?: number | null;
293
+ /**
294
+ * DNSSEC chain status.
295
+ * @type {VerifyDomainResponseDnssecEnum}
296
+ * @memberof VerifyDomainResponse
297
+ */
298
+ dnssec?: VerifyDomainResponseDnssecEnum | null;
299
+ /**
300
+ * A CAA record restricts which CAs may issue certificates.
301
+ * @type {boolean}
302
+ * @memberof VerifyDomainResponse
303
+ */
304
+ caa?: boolean | null;
305
+ }
306
+ /**
307
+ * @export
308
+ */
309
+ export declare const VerifyDomainResponseTypesEnum: {
310
+ readonly Freemail: "freemail";
311
+ readonly Disposable: "disposable";
312
+ readonly Custom: "custom";
313
+ readonly Company: "company";
314
+ readonly Government: "government";
315
+ readonly Education: "education";
316
+ readonly Public: "public";
317
+ readonly Isp: "isp";
318
+ };
319
+ export type VerifyDomainResponseTypesEnum = typeof VerifyDomainResponseTypesEnum[keyof typeof VerifyDomainResponseTypesEnum];
320
+ /**
321
+ * @export
322
+ */
323
+ export declare const VerifyDomainResponseDmarcPolicyEnum: {
324
+ readonly None: "none";
325
+ readonly Quarantine: "quarantine";
326
+ readonly Reject: "reject";
327
+ };
328
+ export type VerifyDomainResponseDmarcPolicyEnum = typeof VerifyDomainResponseDmarcPolicyEnum[keyof typeof VerifyDomainResponseDmarcPolicyEnum];
329
+ /**
330
+ * @export
331
+ */
332
+ export declare const VerifyDomainResponseDnssecEnum: {
333
+ readonly Secure: "secure";
334
+ readonly Insecure: "insecure";
335
+ readonly Bogus: "bogus";
336
+ };
337
+ export type VerifyDomainResponseDnssecEnum = typeof VerifyDomainResponseDnssecEnum[keyof typeof VerifyDomainResponseDnssecEnum];
338
+ /**
339
+ *
340
+ * @export
341
+ * @interface VerifyJobRequest
342
+ */
343
+ export interface VerifyJobRequest {
344
+ /**
345
+ * The addresses to verify. Non-empty, capped at the job limit (10000).
346
+ * @type {Array<string>}
347
+ * @memberof VerifyJobRequest
348
+ */
349
+ emails: Array<string>;
350
+ }
351
+ /**
352
+ *
353
+ * @export
354
+ * @interface VerifyJobResponse
355
+ */
356
+ export interface VerifyJobResponse {
357
+ /**
358
+ * The job id. Use it to poll GET /v1/verify/jobs/{id}.
359
+ * @type {string}
360
+ * @memberof VerifyJobResponse
361
+ */
362
+ id: string;
363
+ /**
364
+ * Job state.
365
+ * @type {VerifyJobResponseStatusEnum}
366
+ * @memberof VerifyJobResponse
367
+ */
368
+ status: VerifyJobResponseStatusEnum;
369
+ /**
370
+ * Number of submitted addresses.
371
+ * @type {number}
372
+ * @memberof VerifyJobResponse
373
+ */
374
+ total: number;
375
+ /**
376
+ *
377
+ * @type {VerifyJobResponseProgress}
378
+ * @memberof VerifyJobResponse
379
+ */
380
+ progress: VerifyJobResponseProgress;
381
+ /**
382
+ * When the job was submitted (ISO 8601).
383
+ * @type {string}
384
+ * @memberof VerifyJobResponse
385
+ */
386
+ created_at: string;
387
+ /**
388
+ * When the results are purged (ISO 8601, 7 days after submit).
389
+ * @type {string}
390
+ * @memberof VerifyJobResponse
391
+ */
392
+ expires_at: string;
393
+ /**
394
+ * One entry per submitted address, in order. Present only when status is completed. Entries are verify results, or per-item errors ({email, error}) for addresses that could not be processed.
395
+ * @type {Array<object>}
396
+ * @memberof VerifyJobResponse
397
+ */
398
+ results?: Array<object> | null;
399
+ }
400
+ /**
401
+ * @export
402
+ */
403
+ export declare const VerifyJobResponseStatusEnum: {
404
+ readonly Processing: "processing";
405
+ readonly Completed: "completed";
406
+ };
407
+ export type VerifyJobResponseStatusEnum = typeof VerifyJobResponseStatusEnum[keyof typeof VerifyJobResponseStatusEnum];
408
+ /**
409
+ * Processing progress.
410
+ * @export
411
+ * @interface VerifyJobResponseProgress
412
+ */
413
+ export interface VerifyJobResponseProgress {
414
+ /**
415
+ *
416
+ * @type {number}
417
+ * @memberof VerifyJobResponseProgress
418
+ */
419
+ total?: number;
420
+ /**
421
+ *
422
+ * @type {number}
423
+ * @memberof VerifyJobResponseProgress
424
+ */
425
+ done?: number;
426
+ }
427
+ /**
428
+ *
429
+ * @export
430
+ * @interface VerifyResultResponse
431
+ */
432
+ export interface VerifyResultResponse {
433
+ /**
434
+ * The address you sent.
435
+ * @type {string}
436
+ * @memberof VerifyResultResponse
437
+ */
438
+ email: string;
439
+ /**
440
+ * The verdict for this address.
441
+ * @type {VerifyResultResponseResultEnum}
442
+ * @memberof VerifyResultResponse
443
+ */
444
+ result: VerifyResultResponseResultEnum;
445
+ /**
446
+ * Proven deliverability: true only after the mailbox accepted RCPT TO, false only when the address provably fails (bad syntax, no MX, hard reject). Null means unproven, not bad: disposable, role and catch_all short-circuit before the SMTP probe.
447
+ * @type {boolean}
448
+ * @memberof VerifyResultResponse
449
+ */
450
+ deliverable?: boolean | null;
451
+ /**
452
+ * Why the pipeline decided. greylisted, smtp_timeout, smtp_unreachable and verification_pending are transient: retry the address later. Null on results cached before reasons existed.
453
+ * @type {VerifyResultResponseReasonEnum}
454
+ * @memberof VerifyResultResponse
455
+ */
456
+ reason?: VerifyResultResponseReasonEnum | null;
457
+ /**
458
+ * The domain has reachable MX records.
459
+ * @type {boolean}
460
+ * @memberof VerifyResultResponse
461
+ */
462
+ mx: boolean;
463
+ /**
464
+ * The primary MX host, when one was resolved during this check.
465
+ * @type {string}
466
+ * @memberof VerifyResultResponse
467
+ */
468
+ mx_record?: string | null;
469
+ /**
470
+ * Throwaway / temporary-mail provider.
471
+ * @type {boolean}
472
+ * @memberof VerifyResultResponse
473
+ */
474
+ disposable: boolean;
475
+ /**
476
+ * Role address such as info@ or sales@.
477
+ * @type {boolean}
478
+ * @memberof VerifyResultResponse
479
+ */
480
+ role: boolean;
481
+ /**
482
+ * Host accepts mail for any local part.
483
+ * @type {boolean}
484
+ * @memberof VerifyResultResponse
485
+ */
486
+ catch_all: boolean;
487
+ /**
488
+ * The domain is a freemail provider (gmail.com, web.de, ...). Null when the domain is not classified yet.
489
+ * @type {boolean}
490
+ * @memberof VerifyResultResponse
491
+ */
492
+ free_email?: boolean | null;
493
+ /**
494
+ * 0-1 confidence, higher is safer to send to.
495
+ * @type {number}
496
+ * @memberof VerifyResultResponse
497
+ */
498
+ score?: number | null;
499
+ /**
500
+ * How recent the underlying data is.
501
+ * @type {VerifyResultResponseFreshnessEnum}
502
+ * @memberof VerifyResultResponse
503
+ */
504
+ freshness: VerifyResultResponseFreshnessEnum;
505
+ /**
506
+ * When the underlying verification ran (ISO 8601). On cached results this is the original check, not the request time.
507
+ * @type {string}
508
+ * @memberof VerifyResultResponse
509
+ */
510
+ checked_at?: string | null;
511
+ /**
512
+ * Domain-level intelligence. Null when the domain has not been crawled yet.
513
+ * @type {VerifyDomainResponse}
514
+ * @memberof VerifyResultResponse
515
+ */
516
+ domain?: VerifyDomainResponse | null;
517
+ /**
518
+ *
519
+ * @type {VerifyDecisionResponse}
520
+ * @memberof VerifyResultResponse
521
+ */
522
+ decision: VerifyDecisionResponse;
523
+ }
524
+ /**
525
+ * @export
526
+ */
527
+ export declare const VerifyResultResponseResultEnum: {
528
+ readonly Valid: "valid";
529
+ readonly Invalid: "invalid";
530
+ readonly CatchAll: "catch_all";
531
+ readonly Disposable: "disposable";
532
+ readonly Role: "role";
533
+ readonly Unknown: "unknown";
534
+ };
535
+ export type VerifyResultResponseResultEnum = typeof VerifyResultResponseResultEnum[keyof typeof VerifyResultResponseResultEnum];
536
+ /**
537
+ * @export
538
+ */
539
+ export declare const VerifyResultResponseReasonEnum: {
540
+ readonly BadSyntax: "bad_syntax";
541
+ readonly NoMx: "no_mx";
542
+ readonly MailboxAccepts: "mailbox_accepts";
543
+ readonly MailboxNotFound: "mailbox_not_found";
544
+ readonly DisposableProvider: "disposable_provider";
545
+ readonly RoleAddress: "role_address";
546
+ readonly CatchAllDomain: "catch_all_domain";
547
+ readonly Greylisted: "greylisted";
548
+ readonly SmtpTimeout: "smtp_timeout";
549
+ readonly SmtpUnreachable: "smtp_unreachable";
550
+ readonly VerificationPending: "verification_pending";
551
+ };
552
+ export type VerifyResultResponseReasonEnum = typeof VerifyResultResponseReasonEnum[keyof typeof VerifyResultResponseReasonEnum];
553
+ /**
554
+ * @export
555
+ */
556
+ export declare const VerifyResultResponseFreshnessEnum: {
557
+ readonly Fresh: "fresh";
558
+ readonly CachedRecent: "cached_recent";
559
+ readonly CachedStaleRefreshed: "cached_stale_refreshed";
560
+ };
561
+ export type VerifyResultResponseFreshnessEnum = typeof VerifyResultResponseFreshnessEnum[keyof typeof VerifyResultResponseFreshnessEnum];
562
+ /**
563
+ *
564
+ * @export
565
+ * @interface VerifySingleRequest
566
+ */
567
+ export interface VerifySingleRequest {
568
+ /**
569
+ * The address to verify.
570
+ * @type {string}
571
+ * @memberof VerifySingleRequest
572
+ */
573
+ email: string;
574
+ }
@@ -0,0 +1,87 @@
1
+ /**
2
+ * @export
3
+ */
4
+ export const BatchItemErrorErrorEnum = {
5
+ InvalidEmail: 'invalid_email',
6
+ InsufficientCredits: 'insufficient_credits',
7
+ VerifyUnavailable: 'verify_unavailable'
8
+ };
9
+ /**
10
+ * @export
11
+ */
12
+ export const VerifyDecisionResponseRecommendationEnum = {
13
+ Allow: 'allow',
14
+ Deny: 'deny',
15
+ Review: 'review'
16
+ };
17
+ /**
18
+ * @export
19
+ */
20
+ export const VerifyDomainResponseTypesEnum = {
21
+ Freemail: 'freemail',
22
+ Disposable: 'disposable',
23
+ Custom: 'custom',
24
+ Company: 'company',
25
+ Government: 'government',
26
+ Education: 'education',
27
+ Public: 'public',
28
+ Isp: 'isp'
29
+ };
30
+ /**
31
+ * @export
32
+ */
33
+ export const VerifyDomainResponseDmarcPolicyEnum = {
34
+ None: 'none',
35
+ Quarantine: 'quarantine',
36
+ Reject: 'reject'
37
+ };
38
+ /**
39
+ * @export
40
+ */
41
+ export const VerifyDomainResponseDnssecEnum = {
42
+ Secure: 'secure',
43
+ Insecure: 'insecure',
44
+ Bogus: 'bogus'
45
+ };
46
+ /**
47
+ * @export
48
+ */
49
+ export const VerifyJobResponseStatusEnum = {
50
+ Processing: 'processing',
51
+ Completed: 'completed'
52
+ };
53
+ /**
54
+ * @export
55
+ */
56
+ export const VerifyResultResponseResultEnum = {
57
+ Valid: 'valid',
58
+ Invalid: 'invalid',
59
+ CatchAll: 'catch_all',
60
+ Disposable: 'disposable',
61
+ Role: 'role',
62
+ Unknown: 'unknown'
63
+ };
64
+ /**
65
+ * @export
66
+ */
67
+ export const VerifyResultResponseReasonEnum = {
68
+ BadSyntax: 'bad_syntax',
69
+ NoMx: 'no_mx',
70
+ MailboxAccepts: 'mailbox_accepts',
71
+ MailboxNotFound: 'mailbox_not_found',
72
+ DisposableProvider: 'disposable_provider',
73
+ RoleAddress: 'role_address',
74
+ CatchAllDomain: 'catch_all_domain',
75
+ Greylisted: 'greylisted',
76
+ SmtpTimeout: 'smtp_timeout',
77
+ SmtpUnreachable: 'smtp_unreachable',
78
+ VerificationPending: 'verification_pending'
79
+ };
80
+ /**
81
+ * @export
82
+ */
83
+ export const VerifyResultResponseFreshnessEnum = {
84
+ Fresh: 'fresh',
85
+ CachedRecent: 'cached_recent',
86
+ CachedStaleRefreshed: 'cached_stale_refreshed'
87
+ };