mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-19 16:38:23 +00:00
* feat: add API documentation and CI checks - Add Rswag for automated API documentation generation - Add Swagger specs for all endpoints - Add CI step to enforce that swagger.yaml stays in sync with code - Add static test keys in seeds.rb for easier testing - Update AGENTS.md and README.md to support this * Merge branch 'main' of https://github.com/deployor/hackatime * Merge branch 'main' into main * Deprecations! Yay! :) * It was wan addicent i swear linter! Dont hurt me * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Copilot..... we love you! Also this project is open and so are api docs meant to be if another AI reads ts! * Merge branch 'main' of https://github.com/deployor/hackatime * Merge branch 'main' into main * Merge branch 'main' into main * Update app/controllers/api/admin/v1/admin_controller.rb If you say so Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update spec/requests/api/v1/my_spec.rb I guessss? Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Failed my own CI wow.... EMBARRASSINGGGG * Merge branch 'main' into main * Merge branch 'main' into main * clarify wording on internal/revoke * Merge branch 'main' into main * update swagger docs
54 lines
1.6 KiB
Ruby
54 lines
1.6 KiB
Ruby
require 'swagger_helper'
|
|
|
|
RSpec.describe 'Api::Admin::V1::AdminUsers', type: :request do
|
|
path '/api/admin/v1/user/info' do
|
|
get('Get user info (Admin)') do
|
|
tags 'Admin'
|
|
description 'Get detailed info about a user. Requires superadmin/admin privileges.'
|
|
security [ AdminToken: [] ]
|
|
produces 'application/json'
|
|
|
|
parameter name: :user_id, in: :query, type: :string, description: 'User ID'
|
|
|
|
response(200, 'successful') do
|
|
let(:Authorization) { "Bearer dev-admin-api-key-12345" }
|
|
let(:user_id) { '1' }
|
|
let(:date) { '2023-01-01' }
|
|
run_test!
|
|
end
|
|
end
|
|
end
|
|
|
|
path '/api/admin/v1/user/heartbeats' do
|
|
get('Get user heartbeats (Admin)') do
|
|
tags 'Admin'
|
|
description 'Get raw heartbeats for a user.'
|
|
security [ AdminToken: [] ]
|
|
produces 'application/json'
|
|
|
|
parameter name: :user_id, in: :query, type: :string, description: 'User ID'
|
|
parameter name: :date, in: :query, type: :string, format: :date, description: 'Date (YYYY-MM-DD)'
|
|
|
|
response(200, 'successful') do
|
|
let(:Authorization) { "Bearer dev-admin-api-key-12345" }
|
|
let(:user_id) { '1' }
|
|
let(:date) { '2023-01-01' }
|
|
run_test!
|
|
end
|
|
end
|
|
end
|
|
|
|
path '/api/admin/v1/check' do
|
|
get('Check status') do
|
|
tags 'Admin'
|
|
description 'Check if admin API is working.'
|
|
security [ AdminToken: [] ]
|
|
produces 'application/json'
|
|
|
|
response(200, 'successful') do
|
|
let(:Authorization) { "Bearer dev-admin-api-key-12345" }
|
|
run_test!
|
|
end
|
|
end
|
|
end
|
|
end
|