syntax = "proto3"; package chatto.api.v1; import "buf/validate/validate.proto"; // Fit mode used when generating transformed image URLs. enum ImageFitMode { // The fit mode was not specified. IMAGE_FIT_MODE_UNSPECIFIED = 0; // Preserve the whole source image within the requested bounds. IMAGE_FIT_MODE_CONTAIN = 1; // Fill the requested bounds, cropping when needed. IMAGE_FIT_MODE_COVER = 2; } // Policy governing thread creation and reply placement in a channel room. // Direct-message rooms do not support threads and use UNSPECIFIED. enum RoomThreadingMode { // No mode was supplied. CreateRoom treats this as ENABLED so older stored // rooms and omitted request fields preserve Chatto's default behavior. ROOM_THREADING_MODE_UNSPECIFIED = 0; // Every new root message establishes a thread, and replies to root messages // must be posted in that root's thread. ROOM_THREADING_MODE_REQUIRED = 1; // Clients should steer replies into threads, but the server accepts both // threaded and ordinary in-room replies. ROOM_THREADING_MODE_ENCOURAGED = 2; // Threads are available and clients may freely choose whether to use them. ROOM_THREADING_MODE_ENABLED = 3; // New threads, thread replies, and channel echoes are rejected. Existing // threads and echoes remain readable and ordinary in-room reply attribution // remains available. ROOM_THREADING_MODE_DISABLED = 4; } // Image transform parameters for generated image URLs. message ImageTransformOptions { // Target image width in pixels. int32 width = 1 [(buf.validate.field).int32 = { gte: 1 lte: 4096 }]; // Target image height in pixels. int32 height = 2 [(buf.validate.field).int32 = { gte: 1 lte: 4096 }]; // Image crop/fit behavior. ImageFitMode fit = 3 [(buf.validate.field).enum.defined_only = true]; } // Browser-supplied image upload payload. message ImageUpload { // Raw image bytes. bytes image = 1; // Original browser filename, for diagnostics and future compatibility. string filename = 2; // Browser-provided content type, for diagnostics and future compatibility. string content_type = 3; } // Public login/provider metadata shared by discovery and account-linking APIs. message ProviderMetadata { // Stable configured provider ID. string id = 1; // Provider type, such as "password", "oidc", "github", or "discord". string type = 2; // Human-readable provider label. string label = 3; // URL that starts login for this provider. string login_url = 4; // OIDC issuer URL. Absent for providers that do not use OpenID Connect. // Clients can compare this value with their own trusted issuer selection; // the server does not select the client's identity provider. optional string issuer_url = 5; // Whether an unlinked identity may create a new account through this provider. optional bool auto_provision = 6; }