UNPKG

@basetime/a2w-api-ts

Version:

Client library that communicates with the addtowallet API.

39 lines (38 loc) 1.25 kB
import { z } from 'zod'; /** * Schema for the reason a wallet was pushed. * * Backend pushes are tagged with the reason they were created so consumers can filter the * log stream by intent. The set is expected to grow over time; new reasons are added on * the backend, so the schema accepts any string while the common ones autocomplete via * the TypeScript union below. */ export declare const WalletUpdateReasonSchema: z.ZodString; /** * Why the wallet was pushed. */ export type WalletUpdateReason = 'updatedPass' | 'updatedTemplate' | 'manualPush' | (string & {}); /** * Schema for a push notification sent to an installed wallet. * * Returned by `client.campaigns.wallets.getPushLogs(...)`. */ export declare const WalletUpdateSchema: z.ZodObject<{ id: z.ZodString; campaign: z.ZodString; pass: z.ZodString; type: z.ZodEnum<{ google: "google"; apple: "apple"; }>; reason: z.ZodString; acknowledged: z.ZodBoolean; error: z.ZodOptional<z.ZodNullable<z.ZodString>>; createdDate: z.ZodCoercedDate<unknown>; }, z.core.$loose>; /** * A push notification sent to an installed wallet. */ export type WalletUpdate = z.infer<typeof WalletUpdateSchema> & { reason: WalletUpdateReason; };