-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ec90ed
commit 62fea98
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
apps/api/src/app/workflows-v2/shared/schemas/push-control.schema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { z } from 'zod'; | ||
import { zodToJsonSchema } from 'zod-to-json-schema'; | ||
|
||
import { JSONSchemaDto, UiComponentEnum, UiSchema, UiSchemaGroupEnum } from '@novu/shared'; | ||
|
||
export const PushStepControlZodSchema = z | ||
.object({ | ||
subject: z.string(), | ||
body: z.string(), | ||
}) | ||
.strict(); | ||
|
||
export type PushStepControlType = z.infer<typeof PushStepControlZodSchema>; | ||
|
||
export const pushStepControlSchema = zodToJsonSchema(PushStepControlZodSchema) as JSONSchemaDto; | ||
export const pushStepUiSchema: UiSchema = { | ||
group: UiSchemaGroupEnum.PUSH, | ||
properties: { | ||
subject: { | ||
component: UiComponentEnum.PUSH_SUBJECT, | ||
}, | ||
body: { | ||
component: UiComponentEnum.PUSH_BODY, | ||
}, | ||
}, | ||
}; | ||
|
||
export const pushStepControl = { | ||
uiSchema: pushStepUiSchema, | ||
schema: pushStepControlSchema, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters