-
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 82df6e0
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
apps/api/src/app/workflows-v2/shared/schemas/chat-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,27 @@ | ||
import { z } from 'zod'; | ||
import { zodToJsonSchema } from 'zod-to-json-schema'; | ||
|
||
import { JSONSchemaDto, UiComponentEnum, UiSchema, UiSchemaGroupEnum } from '@novu/shared'; | ||
|
||
export const ChatStepControlZodSchema = z | ||
.object({ | ||
body: z.string(), | ||
}) | ||
.strict(); | ||
|
||
export type ChatStepControlType = z.infer<typeof ChatStepControlZodSchema>; | ||
|
||
export const chatStepControlSchema = zodToJsonSchema(ChatStepControlZodSchema) as JSONSchemaDto; | ||
export const chatStepUiSchema: UiSchema = { | ||
group: UiSchemaGroupEnum.CHAT, | ||
properties: { | ||
body: { | ||
component: UiComponentEnum.CHAT_BODY, | ||
}, | ||
}, | ||
}; | ||
|
||
export const chatStepControl = { | ||
uiSchema: chatStepUiSchema, | ||
schema: chatStepControlSchema, | ||
}; |
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