fix: apply feedback

This commit is contained in:
abdou6666 2025-02-04 17:51:31 +01:00
parent 5150b2e3a6
commit 7332f77624
2 changed files with 5 additions and 5 deletions

View File

@ -165,7 +165,7 @@ export const stdPluginMessageSchema = z.object({
export type StdPluginMessage = z.infer<typeof stdPluginMessageSchema>;
export const BlockMessageSchema = z.union([
export const blockMessageSchema = z.union([
z.array(z.string()),
stdOutgoingTextMessageSchema,
stdOutgoingQuickRepliesMessageSchema,
@ -175,7 +175,7 @@ export const BlockMessageSchema = z.union([
stdPluginMessageSchema,
]);
export type BlockMessage = z.infer<typeof BlockMessageSchema>;
export type BlockMessage = z.infer<typeof blockMessageSchema>;
export const StdOutgoingMessageSchema = z.union([
stdOutgoingTextMessageSchema,
@ -393,7 +393,7 @@ const attachmentBlockMessageSchema = z.object({
});
// BlockMessage Schema
export const blockMessageSchema = z.union([
export const blockMessageObjectSchema = z.union([
pluginBlockMessageSchema,
textBlockMessageSchema,
buttonMessageSchema,

View File

@ -15,7 +15,7 @@ import {
import {
BlockMessage,
blockMessageSchema,
blockMessageObjectSchema,
messageRegexSchema,
textSchema,
} from '../schemas/types/message';
@ -36,7 +36,7 @@ export function isValidMessage(msg: any) {
}
return result.success;
} else if (typeof msg === 'object' && msg !== null) {
const result = blockMessageSchema.safeParse(msg);
const result = blockMessageObjectSchema.safeParse(msg);
if (!result.success) {
console.error('Block Model: Object validation failed!', result.error);
}