/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/models/components/notificationtrigger.ts
55 строк
2 KB
George Djabarov
feat(api-service): add multi subscription per topic and trigger condition parsing fixes NV-6810 (#9472)
25 ноя 2025, 14:55
Не верифицирован
25 ноя 2025, 14:55
a352a21
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { NotificationTriggerVariable, NotificationTriggerVariable$inboundSchema, } from "./notificationtriggervariable.js"; export const NotificationTriggerType = { Event: "event", } as const; export type NotificationTriggerType = ClosedEnum< typeof NotificationTriggerType >; export type NotificationTrigger = { type: NotificationTriggerType; identifier: string; variables: Array<NotificationTriggerVariable>; subscriberVariables?: Array<NotificationTriggerVariable> | undefined; }; /** @internal */ export const NotificationTriggerType$inboundSchema: z.ZodNativeEnum< typeof NotificationTriggerType > = z.nativeEnum(NotificationTriggerType); /** @internal */ export const NotificationTrigger$inboundSchema: z.ZodType< NotificationTrigger, z.ZodTypeDef, unknown > = z.object({ type: NotificationTriggerType$inboundSchema, identifier: z.string(), variables: z.array(NotificationTriggerVariable$inboundSchema), subscriberVariables: z.array(NotificationTriggerVariable$inboundSchema) .optional(), }); export function notificationTriggerFromJSON( jsonString: string, ): SafeParseResult<NotificationTrigger, SDKValidationError> { return safeParse( jsonString, (x) => NotificationTrigger$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotificationTrigger' from JSON`, ); }