logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

push_subscription.ex (2258B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.ApiSpec.Schemas.PushSubscription do
  5. alias OpenApiSpex.Schema
  6. require OpenApiSpex
  7. OpenApiSpex.schema(%{
  8. title: "PushSubscription",
  9. description: "Response schema for a push subscription",
  10. type: :object,
  11. properties: %{
  12. id: %Schema{
  13. anyOf: [%Schema{type: :string}, %Schema{type: :integer}],
  14. description: "The id of the push subscription in the database."
  15. },
  16. endpoint: %Schema{type: :string, description: "Where push alerts will be sent to."},
  17. server_key: %Schema{type: :string, description: "The streaming server's VAPID key."},
  18. alerts: %Schema{
  19. type: :object,
  20. description: "Which alerts should be delivered to the endpoint.",
  21. properties: %{
  22. follow: %Schema{
  23. type: :boolean,
  24. description: "Receive a push notification when someone has followed you?"
  25. },
  26. favourite: %Schema{
  27. type: :boolean,
  28. description:
  29. "Receive a push notification when a status you created has been favourited by someone else?"
  30. },
  31. reblog: %Schema{
  32. type: :boolean,
  33. description:
  34. "Receive a push notification when a status you created has been boosted by someone else?"
  35. },
  36. mention: %Schema{
  37. type: :boolean,
  38. description:
  39. "Receive a push notification when someone else has mentioned you in a status?"
  40. },
  41. poll: %Schema{
  42. type: :boolean,
  43. description:
  44. "Receive a push notification when a poll you voted in or created has ended? "
  45. }
  46. }
  47. }
  48. },
  49. example: %{
  50. "id" => "328_183",
  51. "endpoint" => "https://yourdomain.example/listener",
  52. "alerts" => %{
  53. "follow" => true,
  54. "favourite" => true,
  55. "reblog" => true,
  56. "mention" => true,
  57. "poll" => true
  58. },
  59. "server_key" =>
  60. "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M="
  61. }
  62. })
  63. end