From e9e707d0a3a86b8f4044a6048292b2f1a20c4cba Mon Sep 17 00:00:00 2001 From: Yassine Ennebati Date: Wed, 11 Feb 2026 11:02:57 +0400 Subject: [PATCH] update jsonschemas --- jsonschemas/chat/channel.schema.json | 4 +- jsonschemas/chat/channel_member.schema.json | 18 ++++++++- .../chat/future_channel_ban.schema.json | 14 +++++++ jsonschemas/chat/item.schema.json | 5 ++- jsonschemas/chat/message.schema.json | 4 +- jsonschemas/chat/user.schema.json | 38 +++++++++++++++++-- jsonschemas/feeds/follow.schema.json | 4 +- jsonschemas/feeds/user.schema.json | 1 - 8 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 jsonschemas/chat/future_channel_ban.schema.json diff --git a/jsonschemas/chat/channel.schema.json b/jsonschemas/chat/channel.schema.json index b5cb403c..f401c732 100644 --- a/jsonschemas/chat/channel.schema.json +++ b/jsonschemas/chat/channel.schema.json @@ -11,9 +11,9 @@ "team": { "type": "string" }, "disabled": { "type": "boolean" }, "frozen": { "type": "boolean" }, + "banned_users": { "type": "array", "items": { "type": "string" } }, "truncated_at": { "type": "string", "format": "date-time" }, - "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" } + "created_at": { "type": "string", "format": "date-time" } }, "anyOf": [ { "required": ["id"], "not": { "required": ["member_ids"] } }, diff --git a/jsonschemas/chat/channel_member.schema.json b/jsonschemas/chat/channel_member.schema.json index d1bd43be..7816691f 100644 --- a/jsonschemas/chat/channel_member.schema.json +++ b/jsonschemas/chat/channel_member.schema.json @@ -10,14 +10,28 @@ "channel_member_ids": { "type": "array", "items": { "type": "string" }, "minItems": 1 }, "channel_role": { "type": "string", "description": "Valid channel role; defaults to channel_member" }, "invited": { "type": "boolean" }, - "invite_accepted_at": { "type": "string", "format": "date-time" }, - "invite_rejected_at": { "type": "string", "format": "date-time" }, + "invite_accepted_at": { "type": ["string"], "format": "date-time" }, + "invite_rejected_at": { "type": ["string"], "format": "date-time" }, "hide_channel": { "type": "boolean" }, "hide_messages_before": { "type": "string", "format": "date-time" }, "last_read": { "type": "string", "format": "date-time" }, "archived_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" } }, + "allOf": [ + { + "if": { + "properties": { "invited": { "const": true } }, + "required": ["invited"] + }, + "else": { + "properties": { + "invite_accepted_at": { "type": "null" }, + "invite_rejected_at": { "type": "null" } + } + } + } + ], "anyOf": [ { "required": ["channel_id"], "not": { "required": ["channel_member_ids"] } }, { "required": ["channel_member_ids"], "not": { "required": ["channel_id"] } } diff --git a/jsonschemas/chat/future_channel_ban.schema.json b/jsonschemas/chat/future_channel_ban.schema.json new file mode 100644 index 00000000..9f66086f --- /dev/null +++ b/jsonschemas/chat/future_channel_ban.schema.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "future_channel_ban.schema.json", + "type": "object", + "additionalProperties": false, + "required": ["target_id", "created_by"], + "properties": { + "target_id": { "type": "string" }, + "created_by": { "type": "string" }, + "shadow": { "type": "boolean" }, + "created_at": { "type": "string", "format": "date-time" } + } +} + diff --git a/jsonschemas/chat/item.schema.json b/jsonschemas/chat/item.schema.json index 5ec1e5a1..c7d6b8ae 100644 --- a/jsonschemas/chat/item.schema.json +++ b/jsonschemas/chat/item.schema.json @@ -5,7 +5,7 @@ "additionalProperties": false, "required": ["type", "data"], "properties": { - "type": { "type": "string", "enum": ["user", "device", "channel", "channel_member", "message", "reaction"] }, + "type": { "type": "string", "enum": ["user", "device", "channel", "channel_member", "message", "reaction", "future_channel_ban"] }, "data": { "anyOf": [ { "$ref": "user.schema.json" }, @@ -13,7 +13,8 @@ { "$ref": "channel.schema.json" }, { "$ref": "channel_member.schema.json" }, { "$ref": "message.schema.json" }, - { "$ref": "reaction.schema.json" } + { "$ref": "reaction.schema.json" }, + { "$ref": "future_channel_ban.schema.json" } ] } } diff --git a/jsonschemas/chat/message.schema.json b/jsonschemas/chat/message.schema.json index 8d07d1d2..ea4f6b9a 100644 --- a/jsonschemas/chat/message.schema.json +++ b/jsonschemas/chat/message.schema.json @@ -16,7 +16,6 @@ "type": { "type": "string", "enum": ["", "regular", "deleted", "system", "reply"], "default": "regular" }, "show_in_channel": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, "deleted_at": { "type": "string", "format": "date-time" }, "mentioned_users_ids": { "type": "array", "items": { "type": "string" } }, "quoted_message_id": { "type": "string" }, @@ -34,6 +33,7 @@ { "if": { "properties": { "deleted_at": { "type": "string" } }, "required": ["deleted_at"] }, "then": { "properties": { "type": { "enum": ["deleted"] } } } }, { "if": { "properties": { "pinned_by_id": { "type": "string" } }, "required": ["pinned_by_id"] }, "then": { "required": ["pinned_at"] } }, { "if": { "properties": { "pinned_at": { "type": "string" } }, "required": ["pinned_at"] }, "then": { "required": ["pinned_by_id"] } }, - { "if": { "properties": { "pin_expires": { "type": "string" } }, "required": ["pin_expires"] }, "then": { "required": ["pinned_at", "pinned_by_id"] } } + { "if": { "properties": { "pin_expires": { "type": "string" } }, "required": ["pin_expires"] }, "then": { "required": ["pinned_at", "pinned_by_id"] } }, + { "if": { "properties": { "show_in_channel": { "type": "boolean" } }, "required": ["show_in_channel"] }, "then": { "required": ["parent_id"] } } ] } diff --git a/jsonschemas/chat/user.schema.json b/jsonschemas/chat/user.schema.json index b56732ec..31e8f938 100644 --- a/jsonschemas/chat/user.schema.json +++ b/jsonschemas/chat/user.schema.json @@ -13,13 +13,45 @@ }, "language": { "type": "string" }, "blocked_user_ids": { "type": "array", "items": { "type": "string" } }, - "blocked_by_user_ids": { "type": "array", "items": { "type": "string" } }, "invisible": { "type": "boolean" }, "deactivated_at": { "type": "string", "format": "date-time" }, "deleted_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, "channel_mutes": { "type": "array", "items": { "type": "string" } }, - "user_mutes": { "type": "array", "items": { "type": "string" } } + "user_mutes": { "type": "array", "items": { "type": "string" } }, + "push_preferences": { + "type": "object", + "description": "User push preferences", + "additionalProperties": false, + "properties": { + "chat_level": { "type": "string", "enum": ["all", "none", "mentions"] }, + "disabled_until": { "type": "string", "format": "date-time" } + } + }, + "privacy_settings": { + "type": "object", + "description": "User privacy settings", + "additionalProperties": false, + "properties": { + "typing_indicators": { + "type": "object", + "additionalProperties": false, + "required": ["enabled"], + "properties": { "enabled": { "type": "boolean" } } + }, + "read_receipts": { + "type": "object", + "additionalProperties": false, + "required": ["enabled"], + "properties": { "enabled": { "type": "boolean" } } + }, + "delivery_receipts": { + "type": "object", + "additionalProperties": false, + "required": ["enabled"], + "properties": { "enabled": { "type": "boolean" } } + } + } + } } } diff --git a/jsonschemas/feeds/follow.schema.json b/jsonschemas/feeds/follow.schema.json index c29dee4c..0d3e628d 100644 --- a/jsonschemas/feeds/follow.schema.json +++ b/jsonschemas/feeds/follow.schema.json @@ -3,8 +3,8 @@ "$id": "follow.schema.json", "type": "object", "properties": { - "source": { "type": "string" }, - "target": { "type": "string" }, + "source_fid": { "type": "string" }, + "target_fid": { "type": "string" }, "status": { "type": "string", "enum": ["accepted", "pending", "rejected"] diff --git a/jsonschemas/feeds/user.schema.json b/jsonschemas/feeds/user.schema.json index b56732ec..9d54f9d0 100644 --- a/jsonschemas/feeds/user.schema.json +++ b/jsonschemas/feeds/user.schema.json @@ -18,7 +18,6 @@ "deactivated_at": { "type": "string", "format": "date-time" }, "deleted_at": { "type": "string", "format": "date-time" }, "created_at": { "type": "string", "format": "date-time" }, - "updated_at": { "type": "string", "format": "date-time" }, "channel_mutes": { "type": "array", "items": { "type": "string" } }, "user_mutes": { "type": "array", "items": { "type": "string" } } }