proxymail-qa 0.10.0 → 0.11.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.
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;
@@ -504,6 +525,15 @@ export declare class ProxyMailQA {
504
525
  offers(address: string): Promise<Offers>;
505
526
  checkDelivery(address: string): Promise<DeliveryStatus>;
506
527
  variants(address: string): Promise<Variants>;
528
+ nameVariants(options?: {
529
+ field?: NameField;
530
+ maxLength?: number;
531
+ }): Promise<NameVariants>;
532
+ passwordVariants(options?: {
533
+ minLength?: number;
534
+ maxLength?: number;
535
+ symbols?: boolean;
536
+ }): Promise<PasswordVariants>;
507
537
  setPassword(address: string, options: {
508
538
  password: string;
509
539
  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.10.0",
3
+ "version": "0.11.0",
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)",