common.proto 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. syntax = "proto3";
  2. package chatto.api.v1;
  3. import "buf/validate/validate.proto";
  4. // Fit mode used when generating transformed image URLs.
  5. enum ImageFitMode {
  6. // The fit mode was not specified.
  7. IMAGE_FIT_MODE_UNSPECIFIED = 0;
  8. // Preserve the whole source image within the requested bounds.
  9. IMAGE_FIT_MODE_CONTAIN = 1;
  10. // Fill the requested bounds, cropping when needed.
  11. IMAGE_FIT_MODE_COVER = 2;
  12. }
  13. // Image transform parameters for generated image URLs.
  14. message ImageTransformOptions {
  15. // Target image width in pixels.
  16. int32 width = 1 [(buf.validate.field).int32 = {
  17. gte: 1
  18. lte: 4096
  19. }];
  20. // Target image height in pixels.
  21. int32 height = 2 [(buf.validate.field).int32 = {
  22. gte: 1
  23. lte: 4096
  24. }];
  25. // Image crop/fit behavior.
  26. ImageFitMode fit = 3 [(buf.validate.field).enum.defined_only = true];
  27. }
  28. // Browser-supplied image upload payload.
  29. message ImageUpload {
  30. // Raw image bytes.
  31. bytes image = 1;
  32. // Original browser filename, for diagnostics and future compatibility.
  33. string filename = 2;
  34. // Browser-provided content type, for diagnostics and future compatibility.
  35. string content_type = 3;
  36. }
  37. // Public login/provider metadata shared by discovery and account-linking APIs.
  38. message ProviderMetadata {
  39. // Stable configured provider ID.
  40. string id = 1;
  41. // Provider type, such as "password", "oidc", "github", or "discord".
  42. string type = 2;
  43. // Human-readable provider label.
  44. string label = 3;
  45. // URL that starts login for this provider.
  46. string login_url = 4;
  47. }