Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jsonschemas/chat/channel.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"] } },
Expand Down
18 changes: 16 additions & 2 deletions jsonschemas/chat/channel_member.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"] } }
Expand Down
14 changes: 14 additions & 0 deletions jsonschemas/chat/future_channel_ban.schema.json
Original file line number Diff line number Diff line change
@@ -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" }
}
}

5 changes: 3 additions & 2 deletions jsonschemas/chat/item.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"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" },
{ "$ref": "device.schema.json" },
{ "$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" }
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions jsonschemas/chat/message.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand All @@ -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"] } }
]
}
38 changes: 35 additions & 3 deletions jsonschemas/chat/user.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" } }
}
}
}
}
}
4 changes: 2 additions & 2 deletions jsonschemas/feeds/follow.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion jsonschemas/feeds/user.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" } }
}
Expand Down