summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/users/stats.ts
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-06-10 07:25:20 +0200
committerGitHub <noreply@github.com>2022-06-10 14:25:20 +0900
commit78df3dc484f5dd1601ee35d5735d4074d5b298e6 (patch)
tree4dc4cd7bcc5750eee73908224598549a6a509a96 /packages/backend/src/server/api/endpoints/users/stats.ts
parentUpdate CHANGELOG.md (diff)
downloadsharkey-78df3dc484f5dd1601ee35d5735d4074d5b298e6.tar.gz
sharkey-78df3dc484f5dd1601ee35d5735d4074d5b298e6.tar.bz2
sharkey-78df3dc484f5dd1601ee35d5735d4074d5b298e6.zip
enhance: improve documentation for `/users/` endpoints (#8790)
* docs: category & description for reset password * docs: category & description for testing * docs: descriptions for groups endpoints * docs: descriptions for drive file endpoints * docs: descriptions for sw endpoints * docs: descriptions for user list endpoints * docs: descriptions & result type for gallery posts * docs: descriptions & result type for user endpoints * docs: add return type for stats
Diffstat (limited to 'packages/backend/src/server/api/endpoints/users/stats.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/users/stats.ts90
1 files changed, 90 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/endpoints/users/stats.ts b/packages/backend/src/server/api/endpoints/users/stats.ts
index 59283e4f2a..d17e8b64b5 100644
--- a/packages/backend/src/server/api/endpoints/users/stats.ts
+++ b/packages/backend/src/server/api/endpoints/users/stats.ts
@@ -8,6 +8,8 @@ export const meta = {
requireCredential: false,
+ description: 'Show statistics about a user.',
+
errors: {
noSuchUser: {
message: 'No such user.',
@@ -15,6 +17,94 @@ export const meta = {
id: '9e638e45-3b25-4ef7-8f95-07e8498f1819',
},
},
+
+ res: {
+ type: 'object',
+ optional: false, nullable: false,
+ properties: {
+ notesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ repliesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ renotesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ repliedCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ renotedCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ pollVotesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ pollVotedCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ localFollowingCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ remoteFollowingCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ localFollowersCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ remoteFollowersCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ followingCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ followersCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ sentReactionsCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ receivedReactionsCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ noteFavoritesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ pageLikesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ pageLikedCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ driveFilesCount: {
+ type: 'integer',
+ optional: false, nullable: false,
+ },
+ driveUsage: {
+ type: 'integer',
+ optional: false, nullable: false,
+ description: 'Drive usage in bytes',
+ },
+ },
+ },
} as const;
export const paramDef = {