proxymail-qa 0.10.0 → 0.11.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/README.md +5 -0
- package/dist/index.d.ts +55 -1
- package/dist/index.js +24 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -149,6 +149,11 @@ const [latest] = await qa.messages(address, { includeHtml: true, limit: 1 });
|
|
|
149
149
|
// Unusual but valid versions of the address, and invalid ones to reject.
|
|
150
150
|
const { delivered, invalid } = await qa.variants(address);
|
|
151
151
|
|
|
152
|
+
// Awkward names and passwords for the form's other fields, grouped by what
|
|
153
|
+
// the app should do with each: accept, reject, store_as_text, decide.
|
|
154
|
+
const names = await qa.nameVariants({ field: 'first_name', maxLength: 50 });
|
|
155
|
+
const passwords = await qa.passwordVariants({ minLength: 8, maxLength: 64 });
|
|
156
|
+
|
|
152
157
|
// After the app changes the test account's password, keep the saved one in step.
|
|
153
158
|
await qa.setPassword(address, { password: 'the-new-test-password' });
|
|
154
159
|
|
package/dist/index.d.ts
CHANGED
|
@@ -326,6 +326,27 @@ export interface Offers {
|
|
|
326
326
|
}>;
|
|
327
327
|
}>;
|
|
328
328
|
}
|
|
329
|
+
export interface FieldVariant {
|
|
330
|
+
tests: string;
|
|
331
|
+
value: string;
|
|
332
|
+
}
|
|
333
|
+
export type NameField = 'first_name' | 'last_name' | 'full_name' | 'display_name';
|
|
334
|
+
export interface NameVariants {
|
|
335
|
+
field: NameField;
|
|
336
|
+
max_length: number | null;
|
|
337
|
+
accept: FieldVariant[];
|
|
338
|
+
reject: FieldVariant[];
|
|
339
|
+
store_as_text: FieldVariant[];
|
|
340
|
+
decide: FieldVariant[];
|
|
341
|
+
}
|
|
342
|
+
export interface PasswordVariants {
|
|
343
|
+
min_length: number;
|
|
344
|
+
max_length: number;
|
|
345
|
+
symbols: boolean;
|
|
346
|
+
accept: FieldVariant[];
|
|
347
|
+
reject: FieldVariant[];
|
|
348
|
+
decide: FieldVariant[];
|
|
349
|
+
}
|
|
329
350
|
export interface AddressAllowance {
|
|
330
351
|
limited: boolean;
|
|
331
352
|
used: number;
|
|
@@ -348,6 +369,7 @@ export interface EmailChecks {
|
|
|
348
369
|
service_domain: string | null;
|
|
349
370
|
type: 'code' | 'link' | null;
|
|
350
371
|
subtype: string | null;
|
|
372
|
+
category?: 'auth' | 'transactional' | 'marketing' | null;
|
|
351
373
|
};
|
|
352
374
|
passed: boolean;
|
|
353
375
|
failed: CheckId[];
|
|
@@ -382,11 +404,16 @@ export interface RunInput {
|
|
|
382
404
|
}
|
|
383
405
|
export interface RunEvent {
|
|
384
406
|
at: string;
|
|
385
|
-
kind: 'address' | 'email' | 'missing' | 'none' | 'count' | 'checks' | 'note';
|
|
407
|
+
kind: 'address' | 'checkout' | 'email' | 'missing' | 'none' | 'count' | 'checks' | 'note' | 'test' | 'unsubscribe' | 'offers' | 'coupon';
|
|
386
408
|
address: string | null;
|
|
387
409
|
failed: boolean;
|
|
388
410
|
detail: Record<string, unknown>;
|
|
389
411
|
}
|
|
412
|
+
export type RunTextPart = string | {
|
|
413
|
+
code: string;
|
|
414
|
+
} | {
|
|
415
|
+
quote: string;
|
|
416
|
+
};
|
|
390
417
|
export interface Run {
|
|
391
418
|
id: string;
|
|
392
419
|
name: string;
|
|
@@ -396,7 +423,25 @@ export interface Run {
|
|
|
396
423
|
started_at: string;
|
|
397
424
|
finished_at: string | null;
|
|
398
425
|
url: string;
|
|
426
|
+
project?: {
|
|
427
|
+
id: string;
|
|
428
|
+
name: string;
|
|
429
|
+
};
|
|
399
430
|
events?: RunEvent[];
|
|
431
|
+
deliverability?: {
|
|
432
|
+
checked: number;
|
|
433
|
+
likely_spam: number;
|
|
434
|
+
may_spam: number;
|
|
435
|
+
harmful_attachments: number;
|
|
436
|
+
highest_spam_score: number | null;
|
|
437
|
+
};
|
|
438
|
+
comparison?: {
|
|
439
|
+
runs: number;
|
|
440
|
+
changes: Array<{
|
|
441
|
+
kind: string;
|
|
442
|
+
text: RunTextPart[];
|
|
443
|
+
}>;
|
|
444
|
+
} | null;
|
|
400
445
|
}
|
|
401
446
|
export declare class ProxyMailQAError extends Error {
|
|
402
447
|
readonly status: number;
|
|
@@ -504,6 +549,15 @@ export declare class ProxyMailQA {
|
|
|
504
549
|
offers(address: string): Promise<Offers>;
|
|
505
550
|
checkDelivery(address: string): Promise<DeliveryStatus>;
|
|
506
551
|
variants(address: string): Promise<Variants>;
|
|
552
|
+
nameVariants(options?: {
|
|
553
|
+
field?: NameField;
|
|
554
|
+
maxLength?: number;
|
|
555
|
+
}): Promise<NameVariants>;
|
|
556
|
+
passwordVariants(options?: {
|
|
557
|
+
minLength?: number;
|
|
558
|
+
maxLength?: number;
|
|
559
|
+
symbols?: boolean;
|
|
560
|
+
}): Promise<PasswordVariants>;
|
|
507
561
|
setPassword(address: string, options: {
|
|
508
562
|
password: string;
|
|
509
563
|
label?: string;
|
package/dist/index.js
CHANGED
|
@@ -534,6 +534,30 @@ export class ProxyMailQA {
|
|
|
534
534
|
variants(address) {
|
|
535
535
|
return this.request('GET', `/addresses/${encodeURIComponent(address)}/variants`);
|
|
536
536
|
}
|
|
537
|
+
// Awkward names for a name field: apostrophes, accents, other scripts,
|
|
538
|
+
// very long ones, and HTML or SQL the app must store as text.
|
|
539
|
+
nameVariants(options = {}) {
|
|
540
|
+
const query = new URLSearchParams();
|
|
541
|
+
if (options.field)
|
|
542
|
+
query.set('field', options.field);
|
|
543
|
+
if (options.maxLength !== undefined)
|
|
544
|
+
query.set('max_length', String(options.maxLength));
|
|
545
|
+
const suffix = query.size ? `?${query}` : '';
|
|
546
|
+
return this.request('GET', `/variants/names${suffix}`);
|
|
547
|
+
}
|
|
548
|
+
// Awkward passwords within a field's rules: the minimum and maximum, each
|
|
549
|
+
// symbol class, spaces and non-ASCII. Fresh each call.
|
|
550
|
+
passwordVariants(options = {}) {
|
|
551
|
+
const query = new URLSearchParams();
|
|
552
|
+
if (options.minLength !== undefined)
|
|
553
|
+
query.set('min_length', String(options.minLength));
|
|
554
|
+
if (options.maxLength !== undefined)
|
|
555
|
+
query.set('max_length', String(options.maxLength));
|
|
556
|
+
if (options.symbols !== undefined)
|
|
557
|
+
query.set('symbols', String(options.symbols));
|
|
558
|
+
const suffix = query.size ? `?${query}` : '';
|
|
559
|
+
return this.request('GET', `/variants/passwords${suffix}`);
|
|
560
|
+
}
|
|
537
561
|
setPassword(address, options = {}) {
|
|
538
562
|
return this.request('PUT', `/addresses/${encodeURIComponent(address)}/password`, { password: options.password, label: options.label });
|
|
539
563
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proxymail-qa",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Test every email your app sends from Playwright, Cypress, Jest, Vitest or any Node script: disposable inboxes, sign-up codes, links and coupons, email checks, unsubscribe tests and run reports.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Proxy Mail QA <hello@proxymail.qa> (https://proxymail.qa)",
|