import { type PassSource, type ProtocolResult } from '../apple/webservice'; import { WalletRegistrationsService } from './registrations.service'; export declare const WALLET_PASS_SOURCE: unique symbol; export declare const WALLET_OPTIONS: unique symbol; export interface WalletModuleOptions { /** * The secret every pass authentication token is derived from. * * One value for the whole deployment. Changing it invalidates every * outstanding pass's ability to update — correct after a leak, catastrophic * by accident — so it belongs beside the signing certificate in configuration * and never in a repository. See `apple/token.ts`. */ tokenSecret: string; /** Told when a holder removes a pass, which is a withdrawal of consent. */ onDeregistered?: (input: { passTypeIdentifier: string; serialNumber: string; deviceLibraryIdentifier: string; }) => Promise; /** * Told when a holder adds a pass. * * **The only signal either platform gives that a pass was actually * installed.** Issuing one is a file leaving a server; a registration is a * wallet on a device asking to be told when it changes, and nothing else * distinguishes the two. A product measuring an enrolment funnel, or holding * a welcome bonus back until there is a phone to show it on, has this and * nothing else to go on. * * `created` is false when the device already had it: a retry, not an install. * Whether a *re-*installation counts is the product's question — somebody who * removes a pass and adds it again is one person installing twice — so that * decision is left where the answer is known. */ onRegistered?: (input: { passTypeIdentifier: string; serialNumber: string; deviceLibraryIdentifier: string; created: boolean; }) => Promise; } /** * Apple's update web service, wired but not mounted. * * The five handlers, with the token check and the registration store attached — * and **no HTTP decorators**, deliberately. Where these routes live, whether * they sit under an API prefix, which guard marks them public and what rate * limit they carry are all the product's decisions, and a controller in this * package would have to take a dependency on the product's authentication to * express any of them. The product writes seventy lines of controller and keeps * the choices. */ export declare class WalletWebService { private readonly registrations; private readonly options; private readonly protocol; constructor(source: PassSource, registrations: WalletRegistrationsService, options: WalletModuleOptions); register(request: { deviceLibraryIdentifier: string; passTypeIdentifier: string; serialNumber: string; pushToken: string; authorization: string | undefined; }): Promise; unregister(request: { deviceLibraryIdentifier: string; passTypeIdentifier: string; serialNumber: string; authorization: string | undefined; }): Promise; updatedSince(request: { deviceLibraryIdentifier: string; passTypeIdentifier: string; since: string | undefined; }): Promise; fetch(request: { passTypeIdentifier: string; serialNumber: string; authorization: string | undefined; ifModifiedSince: string | undefined; }): Promise; /** * What a device said went wrong. * * Always accepted, and written down. It is the only diagnostic Apple sends * anywhere, and a programme with no device of its own has more use for it * than one that can look at a phone. */ log(body: unknown): Promise; } //# sourceMappingURL=web-service.d.ts.map