26 lines
537 B
TypeScript
26 lines
537 B
TypeScript
/**
|
|
* PWA 事件上报请求
|
|
*
|
|
*/
|
|
import { z } from "zod";
|
|
|
|
import {
|
|
booleanOrFalse,
|
|
numberOrZero,
|
|
stringOrEmpty,
|
|
} from "../../nullable-defaults";
|
|
|
|
export const PwaEventSchema = z
|
|
.object({
|
|
deviceId: stringOrEmpty,
|
|
deviceType: stringOrEmpty,
|
|
timestamp: numberOrZero,
|
|
pwaInstalled: booleanOrFalse,
|
|
pwaSupported: booleanOrFalse,
|
|
})
|
|
.readonly();
|
|
|
|
export type PwaEventInput = z.input<typeof PwaEventSchema>;
|
|
export type PwaEventData = z.output<typeof PwaEventSchema>;
|
|
export type PwaEvent = PwaEventData;
|