Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
web: Avoid deprecated Zod .merge().
Anders Kaseorg73bf77b97257
diff --git a/web/src/stream_types.ts b/web/src/stream_types.tsindex 0a83fb856eb..7916cbf8590 100644--- a/web/src/stream_types.ts+++ b/web/src/stream_types.ts@@ -91,12 +91,12 @@ export const stream_properties_schema = stream_specific_notification_settings_sc});// This is the raw data we get from the server for a subscription.-export const api_stream_subscription_schema = api_stream_schema- .merge(stream_properties_schema)- .extend({- subscribers: z.array(z.number()).optional(),- partial_subscribers: z.array(z.number()).optional(),- });+export const api_stream_subscription_schema = z.object({+ ...api_stream_schema.shape,+ ...stream_properties_schema.shape,+ subscribers: z.array(z.number()).optional(),+ partial_subscribers: z.array(z.number()).optional(),+});export const updatable_stream_properties_schema = api_stream_subscription_schema.extend({in_home_view: z.boolean(),diff --git a/web/src/user_settings.ts b/web/src/user_settings.tsindex d87878131ca..fcb51353bf7 100644--- a/web/src/user_settings.ts+++ b/web/src/user_settings.ts@@ -30,61 +30,61 @@ export type FollowedTopicNotificationSettings = z.infer<typeof followed_topic_notification_settings_schema>;-export const user_settings_schema = stream_notification_settings_schema- .merge(pm_notification_settings_schema)- .merge(followed_topic_notification_settings_schema)- .extend({- allow_private_data_export: z.boolean(),- automatically_follow_topics_policy: z.number(),- automatically_follow_topics_where_mentioned: z.boolean(),- automatically_unmute_topics_in_muted_streams_policy: z.number(),- available_notification_sounds: z.array(z.string()),- color_scheme: z.number(),- default_language: z.string(),- demote_inactive_streams: z.number(),- desktop_icon_count_display: z.number(),- display_emoji_reaction_users: z.boolean(),- email_address_visibility: z.number(),- email_notifications_batching_period_seconds: z.number(),- emojiset: z.string(),- emojiset_choices: z.array(z.object({key: z.string(), text: z.string()})),- enable_digest_emails: z.boolean(),- enable_drafts_synchronization: z.boolean(),- enable_login_emails: z.boolean(),- enable_marketing_emails: z.boolean(),- enable_online_push_notifications: z.boolean(),- enter_sends: z.boolean(),- fluid_layout_width: z.boolean(),- hide_ai_features: z.boolean(),- high_contrast_mode: z.boolean(),- left_side_userlist: z.boolean(),- message_content_in_email_notifications: z.boolean(),- notification_sound: z.string(),- pm_content_in_desktop_notifications: z.boolean(),- presence_enabled: z.boolean(),- realm_name_in_email_notifications_policy: z.number(),- receives_typing_notifications: z.boolean(),- resolved_topic_notice_auto_read_policy: z.enum(["always", "except_followed", "never"]),- send_private_typing_notifications: z.boolean(),- send_read_receipts: z.boolean(),- send_stream_typing_notifications: z.boolean(),- starred_message_counts: z.boolean(),- timezone: z.string(),- translate_emoticons: z.boolean(),- twenty_four_hour_time: z.boolean(),- user_list_style: z.number(),- web_animate_image_previews: z.enum(["always", "on_hover", "never"]),- web_channel_default_view: z.number(),- web_escape_navigates_to_home_view: z.boolean(),- web_font_size_px: z.number(),- web_home_view: z.enum(["inbox", "recent_topics", "all_messages"]),- web_left_sidebar_unreads_count_summary: z.boolean(),- web_line_height_percent: z.number(),- web_mark_read_on_scroll_policy: z.number(),- web_navigate_to_sent_message: z.boolean(),- web_stream_unreads_count_display_policy: z.number(),- web_suggest_update_timezone: z.boolean(),- });+export const user_settings_schema = z.object({+ ...stream_notification_settings_schema.shape,+ ...pm_notification_settings_schema.shape,+ ...followed_topic_notification_settings_schema.shape,+ allow_private_data_export: z.boolean(),+ automatically_follow_topics_policy: z.number(),+ automatically_follow_topics_where_mentioned: z.boolean(),+ automatically_unmute_topics_in_muted_streams_policy: z.number(),+ available_notification_sounds: z.array(z.string()),+ color_scheme: z.number(),+ default_language: z.string(),+ demote_inactive_streams: z.number(),+ desktop_icon_count_display: z.number(),+ display_emoji_reaction_users: z.boolean(),+ email_address_visibility: z.number(),+ email_notifications_batching_period_seconds: z.number(),+ emojiset: z.string(),+ emojiset_choices: z.array(z.object({key: z.string(), text: z.string()})),+ enable_digest_emails: z.boolean(),+ enable_drafts_synchronization: z.boolean(),+ enable_login_emails: z.boolean(),+ enable_marketing_emails: z.boolean(),+ enable_online_push_notifications: z.boolean(),+ enter_sends: z.boolean(),+ fluid_layout_width: z.boolean(),+ hide_ai_features: z.boolean(),+ high_contrast_mode: z.boolean(),+ left_side_userlist: z.boolean(),+ message_content_in_email_notifications: z.boolean(),+ notification_sound: z.string(),+ pm_content_in_desktop_notifications: z.boolean(),+ presence_enabled: z.boolean(),+ realm_name_in_email_notifications_policy: z.number(),+ receives_typing_notifications: z.boolean(),+ resolved_topic_notice_auto_read_policy: z.enum(["always", "except_followed", "never"]),+ send_private_typing_notifications: z.boolean(),+ send_read_receipts: z.boolean(),+ send_stream_typing_notifications: z.boolean(),+ starred_message_counts: z.boolean(),+ timezone: z.string(),+ translate_emoticons: z.boolean(),+ twenty_four_hour_time: z.boolean(),+ user_list_style: z.number(),+ web_animate_image_previews: z.enum(["always", "on_hover", "never"]),+ web_channel_default_view: z.number(),+ web_escape_navigates_to_home_view: z.boolean(),+ web_font_size_px: z.number(),+ web_home_view: z.enum(["inbox", "recent_topics", "all_messages"]),+ web_left_sidebar_unreads_count_summary: z.boolean(),+ web_line_height_percent: z.number(),+ web_mark_read_on_scroll_policy: z.number(),+ web_navigate_to_sent_message: z.boolean(),+ web_stream_unreads_count_display_policy: z.number(),+ web_suggest_update_timezone: z.boolean(),+});export type UserSettings = z.infer<typeof user_settings_schema>;export let user_settings: UserSettings;