import type { DataSource } from 'typeorm'; import type { ApnsPort, ApnsResult } from '../apple/apns/port'; import type { RegistrationStore } from '../apple/webservice'; /** * Which device holds which pass, and what happened when we pushed to it. * * Every query here runs **unbound by tenant**, on purpose and only because the * three tables it touches carry no policy — see the migration for why. It is * the one service in this package that talks to a database, and the reason it * is here rather than in the product is that the answer is the same whatever a * pass means. */ export declare class WalletRegistrationsService implements RegistrationStore { private readonly dataSource; constructor(dataSource: DataSource); /** * Registers a device, or updates the push token of one already registered. * * The update matters more than it looks. A device that reinstalls the pass, or * whose APNs token is reissued by the operating system, calls this again with * the *same* identifiers and a **different** token — and an implementation * that treated the row as immutable would go on pushing to a token that has * been dead since the reinstall, and would record every one of them as * delivered. */ add(input: { deviceLibraryIdentifier: string; pushToken: string; passTypeIdentifier: string; serialNumber: string; tenantId?: string; }): Promise; remove(input: { deviceLibraryIdentifier: string; passTypeIdentifier: string; serialNumber: string; }): Promise; serialsFor(deviceLibraryIdentifier: string, passTypeIdentifier: string): Promise; devicesFor(passTypeIdentifier: string, serialNumber: string): Promise>; /** * Pushes to every device holding these passes, once per device. * * **Per device, not per pass**, which is Apple's design rather than an * optimisation: the push carries nothing — no serial, no payload — and the * device answers it by asking which of *its* passes changed. So a device * holding two cards that both changed needs one notification, and sending two * makes a phone buzz twice for one question it will ask once. * * A delivery is recorded per pass per device all the same, because the * question somebody asks later is "did this card's update reach anybody" and * not "how many HTTP requests did we make". Rows covering one push share its * status and its provider identifier, which is accurate: they succeeded or * failed together. * * `410 Unregistered` **removes the registration** rather than only being * logged. It is the single signal there is that a holder deleted their card * without the deregistration arriving, and a product that keeps pushing to it * is a product whose delivery numbers are quietly fiction. */ push(apns: ApnsPort, passes: ReadonlyArray<{ passTypeIdentifier: string; serialNumber: string; tenantId?: string; }>): Promise; /** Records a Google write, so one screen answers for both platforms. */ recordGoogleWrite(input: { passTypeIdentifier: string; serialNumber: string; status: number; reason?: string; providerId?: string; tenantId?: string; }): Promise; /** What a device said went wrong, in its own words. */ recordDeviceLog(messages: readonly string[]): Promise; } //# sourceMappingURL=registrations.service.d.ts.map