Skip to content

Commit 4390bd7

Browse files
committed
update the default values
1 parent 12c9ef5 commit 4390bd7

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/common/schema/flexMessage.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ const postbackActionSchema = z.object({
5858

5959
const messageActionSchema = z.object({
6060
type: z.literal("message").default("message"),
61-
label: z.string().default("Send").describe("Button label text"),
61+
label: z.string().default("label").describe("Button label text"),
6262
text: z.string().default("Hello").describe("Message text to send"), // Required, no maxLength limit
6363
});
6464

6565
const uriActionSchema = z.object({
6666
type: z.literal("uri").default("uri"),
67-
label: z.string().default("Open Link").describe("Button label text"),
67+
label: z.string().default("Open Camera").describe("Button label text"),
6868
uri: z
6969
.string()
7070
.url()
71-
.default("https://example.com")
71+
.default("https://line.me/R/nv/camera/")
7272
.describe("URL to open (max 2000 characters)"),
7373
altUri: z
7474
.object({
@@ -130,7 +130,10 @@ export const flexActionSchema = z.discriminatedUnion("type", [
130130

131131
// Basic style properties
132132
const flexStylePropsSchema = z.object({
133-
backgroundColor: z.string().optional(),
133+
backgroundColor: z
134+
.string()
135+
.optional()
136+
.describe("Background color in #RRGGBB format (rgba not supported)"),
134137
separator: z.boolean().optional(),
135138
separatorColor: z.string().optional(),
136139
});
@@ -182,7 +185,9 @@ const flexImageComponentSchema = z.object({
182185
.string()
183186
.url()
184187
.max(2000)
185-
.default("https://via.placeholder.com/300x200")
188+
.default(
189+
"https://developers-resource.landpress.line.me/fx/img/01_2_restaurant.png",
190+
)
186191
.describe("Image URL (max 2000 characters)"), // Required - Maximum 2000 characters
187192
flex: z.number().int().min(0).optional(), // format: int32
188193
margin: flexMarginEnum.optional(),
@@ -196,7 +201,10 @@ const flexImageComponentSchema = z.object({
196201
size: z.string().default("md").optional(), // Default is md
197202
aspectRatio: z.string().optional(), // {width}:{height} format, range 1-100000
198203
aspectMode: flexImageAspectModeEnum.optional(),
199-
backgroundColor: z.string().optional(),
204+
backgroundColor: z
205+
.string()
206+
.optional()
207+
.describe("Background color in #RRGGBB format (rgba not supported)"),
200208
action: flexActionSchema.optional(),
201209
animated: z.boolean().default(false).optional(), // Default is false
202210
scaling: z.boolean().optional(),
@@ -295,7 +303,10 @@ export const flexComponentSchema: z.ZodType<any> = z.lazy(() =>
295303
offsetBottom: z.string().optional(),
296304
offsetStart: z.string().optional(),
297305
offsetEnd: z.string().optional(),
298-
backgroundColor: z.string().optional(),
306+
backgroundColor: z
307+
.string()
308+
.optional()
309+
.describe("Background color in #RRGGBB format (rgba not supported)"),
299310
borderColor: z.string().optional(),
300311
borderWidth: z.string().optional(),
301312
cornerRadius: z.string().optional(),
@@ -338,7 +349,8 @@ const flexBubbleSchema = z.object({
338349
type: z.literal("bubble").default("bubble"),
339350
size: z
340351
.enum(["nano", "micro", "deca", "hecto", "kilo", "mega", "giga"])
341-
.optional(),
352+
.optional()
353+
.default("mega"),
342354
direction: z.enum(["ltr", "rtl"]).optional(),
343355
styles: flexBubbleStyleSchema.optional(),
344356
header: flexComponentSchema.optional(), // FlexBox

0 commit comments

Comments
 (0)