File size: 824 Bytes
fc93158 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { Type } from "@sinclair/typebox";
import { NonEmptyString } from "./primitives.js";
const ApnsEnvironmentSchema = Type.String({ enum: ["sandbox", "production"] });
export const PushTestParamsSchema = Type.Object(
{
nodeId: NonEmptyString,
title: Type.Optional(Type.String()),
body: Type.Optional(Type.String()),
environment: Type.Optional(ApnsEnvironmentSchema),
},
{ additionalProperties: false },
);
export const PushTestResultSchema = Type.Object(
{
ok: Type.Boolean(),
status: Type.Integer(),
apnsId: Type.Optional(Type.String()),
reason: Type.Optional(Type.String()),
tokenSuffix: Type.String(),
topic: Type.String(),
environment: ApnsEnvironmentSchema,
transport: Type.String({ enum: ["direct", "relay"] }),
},
{ additionalProperties: false },
);
|