feat(chat): render commercial actions and persist greetings
Docker Image / Build and Push Docker Image (push) Successful in 1m56s
Docker Image / Build and Push Docker Image (push) Successful in 1m56s
This commit is contained in:
@@ -12,6 +12,19 @@ import {
|
||||
} from "../../nullable-defaults";
|
||||
import { ChatImageSchema, ChatLockDetailSchema } from "../chat_payloads";
|
||||
|
||||
export const CommercialActionSchema = z
|
||||
.object({
|
||||
actionId: z.string().min(1),
|
||||
type: z.enum(["giftOffer", "privateAlbumOffer"]),
|
||||
copy: z.string().min(1),
|
||||
ctaLabel: z.string().min(1),
|
||||
target: z.enum(["giftCatalog", "privateZone"]),
|
||||
ruleId: z.string().min(1),
|
||||
})
|
||||
.readonly();
|
||||
|
||||
export type CommercialAction = z.output<typeof CommercialActionSchema>;
|
||||
|
||||
export const ChatSendResponseSchema = z
|
||||
.object({
|
||||
reply: stringOrEmpty,
|
||||
@@ -27,6 +40,7 @@ export const ChatSendResponseSchema = z
|
||||
creditsCharged: numberOrZero,
|
||||
requiredCredits: numberOrZero,
|
||||
shortfallCredits: numberOrZero,
|
||||
commercialAction: CommercialActionSchema.nullish().default(null),
|
||||
})
|
||||
.readonly();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user