debian-mirror-gitlab/lib/api/project_events.rb

40 lines
1.3 KiB
Ruby
Raw Normal View History

2019-05-18 00:54:41 +05:30
# frozen_string_literal: true
module API
2021-01-03 14:25:43 +05:30
class ProjectEvents < ::API::Base
2019-05-18 00:54:41 +05:30
include PaginationParams
include APIGuard
helpers ::API::Helpers::EventsHelpers
2023-04-23 21:23:45 +05:30
feature_category :user_profile
2021-01-29 00:20:46 +05:30
2022-06-21 17:19:12 +05:30
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357839
urgency :low
2019-05-18 00:54:41 +05:30
params do
2023-01-13 00:05:48 +05:30
requires :id, types: [String, Integer], desc: 'The ID or URL-encoded path of the project'
optional :action, type: String, desc: 'Include only events of a particular action type'
optional :target_type, type: String, desc: 'Include only events of a particular target type'
optional :before, type: DateTime, desc: 'Include only events created before a particular date'
optional :after, type: DateTime, desc: 'Include only events created after a particular date'
optional :sort, type: String, desc: 'Sort events in asc or desc order by created_at. Default is desc'
2019-05-18 00:54:41 +05:30
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
2023-01-13 00:05:48 +05:30
desc "List a project's visible events" do
2019-05-18 00:54:41 +05:30
success Entities::Event
end
params do
use :pagination
use :event_filter_params
use :sort_params
end
get ":id/events" do
events = find_events(user_project)
present_events(events)
end
end
end
end