import type { EntityServices } from '../../../services/ports/services.js'; /** A customer as the store has it. */ export interface CustomerView { id: number; uuid: string; email: string; name: string; status: 0 | 1; groupId: number | null; metaData: Record>; } /** An address as the store has it. */ export interface AddressView { uuid: string; fields: Record; extra: Record | null; isDefault: boolean; } /** * The services and a way to look at what they wrote. The store has two groups * and two custom fields for customers: `custom.optin` (a boolean) and * `custom.years` (an integer from 0 to 50). */ export interface CustomerServicesHarness { services: EntityServices; groups: { first: number; second: number; }; customer(email: string): Promise; /** The password as stored when it is a hash (the double keeps a marker for the one nobody knows). */ storedHash(email: string): Promise; /** Whether this password logs the customer in. */ loginWorks(email: string, password: string): Promise; /** The addresses of the customer, in the order they were added. */ addresses(email: string): Promise; /** The events that send the welcome e-mail (`customer_registered`, `account_created`). */ welcomeEvents(): Promise; count(): Promise; } /** A real bcrypt hash of `Secret-1`, cheap to make (cost 4). */ export declare const KNOWN_HASH: any; /** * What the customer services must do (ยง 4.5, point 6; G3): create without the * welcome e-mail and with the password the caller says (plain, a hash as it is, * or one nobody knows), update without ever touching the password, save the * custom fields as a set that core checks, and leave nothing behind when a call * fails. It runs against `MemoryServices` and against core's own services on a * database. */ export declare function customerServicesContract(label: string, make: () => Promise): void;