X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fweb%2Fapi_spec%2Foperations%2Ftimeline_operation.ex;h=3eb6f700b7f959986d9f58c5a6a93b502d4cfd62;hb=4c3971aebd9cb950e300aee17598a7be6e94691c;hp=1b89035d47c05d64e46f2dd924c252d0144dc0e9;hpb=e4b12494d77e7a6920a408d62d5b8fe0f886a14d;p=akkoma
diff --git a/lib/pleroma/web/api_spec/operations/timeline_operation.ex b/lib/pleroma/web/api_spec/operations/timeline_operation.ex
index 1b89035d4..3eb6f700b 100644
--- a/lib/pleroma/web/api_spec/operations/timeline_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/timeline_operation.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ApiSpec.TimelineOperation do
@@ -25,10 +25,11 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
security: [%{"oAuth" => ["read:statuses"]}],
parameters: [
local_param(),
+ remote_param(),
+ only_media_param(),
with_muted_param(),
exclude_visibilities_param(),
- reply_visibility_param(),
- with_relationships_param() | pagination_params()
+ reply_visibility_param() | pagination_params()
],
operationId: "TimelineController.home",
responses: %{
@@ -42,9 +43,8 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
tags: ["Timelines"],
summary: "Direct timeline",
description:
- "View statuses with a âdirectâ privacy, from your account or in your notifications",
- deprecated: true,
- parameters: pagination_params(),
+ "View statuses with a âdirectâ scope addressed to the account. Using this endpoint is discouraged, please use [conversations](#tag/Conversations).",
+ parameters: [with_muted_param() | pagination_params()],
security: [%{"oAuth" => ["read:statuses"]}],
operationId: "TimelineController.direct",
responses: %{
@@ -60,11 +60,12 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
security: [%{"oAuth" => ["read:statuses"]}],
parameters: [
local_param(),
+ instance_param(),
only_media_param(),
+ remote_param(),
with_muted_param(),
exclude_visibilities_param(),
- reply_visibility_param(),
- with_relationships_param() | pagination_params()
+ reply_visibility_param() | pagination_params()
],
operationId: "TimelineController.public",
responses: %{
@@ -74,6 +75,26 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
}
end
+ def bubble_operation do
+ %Operation{
+ tags: ["Timelines"],
+ summary: "Bubble timeline",
+ security: [%{"oAuth" => ["read:statuses"]}],
+ parameters: [
+ only_media_param(),
+ remote_param(),
+ with_muted_param(),
+ exclude_visibilities_param(),
+ reply_visibility_param() | pagination_params()
+ ],
+ operationId: "TimelineController.bubble",
+ responses: %{
+ 200 => Operation.response("Array of Status", "application/json", array_of_statuses()),
+ 401 => Operation.response("Error", "application/json", ApiError)
+ }
+ }
+ end
+
def hashtag_operation do
%Operation{
tags: ["Timelines"],
@@ -108,13 +129,14 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
),
local_param(),
only_media_param(),
+ remote_param(),
with_muted_param(),
- exclude_visibilities_param(),
- with_relationships_param() | pagination_params()
+ exclude_visibilities_param() | pagination_params()
],
operationId: "TimelineController.hashtag",
responses: %{
- 200 => Operation.response("Array of Status", "application/json", array_of_statuses())
+ 200 => Operation.response("Array of Status", "application/json", array_of_statuses()),
+ 401 => Operation.response("Error", "application/json", ApiError)
}
}
end
@@ -134,8 +156,10 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
required: true
),
with_muted_param(),
- exclude_visibilities_param(),
- with_relationships_param() | pagination_params()
+ local_param(),
+ remote_param(),
+ only_media_param(),
+ exclude_visibilities_param() | pagination_params()
],
operationId: "TimelineController.list",
responses: %{
@@ -153,10 +177,6 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
}
end
- defp with_relationships_param do
- Operation.parameter(:with_relationships, :query, BooleanLike, "Include relationships")
- end
-
defp local_param do
Operation.parameter(
:local,
@@ -166,8 +186,17 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
)
end
+ defp instance_param do
+ Operation.parameter(
+ :instance,
+ :query,
+ %Schema{type: :string},
+ "Show only statuses from the given domain"
+ )
+ end
+
defp with_muted_param do
- Operation.parameter(:with_muted, :query, BooleanLike, "Includeactivities by muted users")
+ Operation.parameter(:with_muted, :query, BooleanLike, "Include activities by muted users")
end
defp exclude_visibilities_param do
@@ -196,4 +225,13 @@ defmodule Pleroma.Web.ApiSpec.TimelineOperation do
"Show only statuses with media attached?"
)
end
+
+ defp remote_param do
+ Operation.parameter(
+ :remote,
+ :query,
+ %Schema{allOf: [BooleanLike], default: false},
+ "Show only remote statuses?"
+ )
+ end
end