@basetime/a2w-api-ts
Version:
Client library that communicates with the addtowallet API.
47 lines (46 loc) • 1.43 kB
TypeScript
import { z } from 'zod';
/**
* Schema for the events a webhook can subscribe to.
*
* Backend events are open-ended, so the schema accepts any string while the common
* ones autocomplete via the TypeScript union below.
*/
export declare const WebhookEventSchema: z.ZodString;
/**
* The events a webhook can subscribe to.
*/
export type WebhookEvent = 'enrolled' | 'claimed' | 'installed' | 'redeemed' | 'updated' | 'scanned' | 'pushed' | 'deleted' | (string & {});
/**
* Schema for the body accepted by create/update on the webhooks sub-endpoint.
*/
export declare const WebhookInputSchema: z.ZodObject<{
displayName: z.ZodString;
url: z.ZodString;
event: z.ZodString;
password: z.ZodOptional<z.ZodString>;
}, z.core.$loose>;
/**
* Body accepted by create/update on the webhooks sub-endpoint.
*/
export type WebhookInput = z.infer<typeof WebhookInputSchema> & {
event: WebhookEvent;
};
/**
* Schema for a webhook configured on an organization.
*/
export declare const WebhookSchema: z.ZodObject<{
displayName: z.ZodString;
url: z.ZodString;
event: z.ZodString;
password: z.ZodOptional<z.ZodString>;
id: z.ZodString;
organization: z.ZodString;
isDeleted: z.ZodBoolean;
createdDate: z.ZodCoercedDate<unknown>;
}, z.core.$loose>;
/**
* A webhook configured on an organization.
*/
export type Webhook = z.infer<typeof WebhookSchema> & {
event: WebhookEvent;
};