mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Refactor api description with @apiParam groups to make it more explicit (#8919)
* Refactor api description for auth.js with @apiParam groups * Refactor apiDoc toward better consistency * Fix missing groups for get requests * Fix missing groups for other request methods
This commit is contained in:
committed by
Sabe Jones
parent
b27319313d
commit
8614f11a31
@@ -29,7 +29,7 @@ let api = {};
|
||||
* @apiName GetMember
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} memberId The member's id
|
||||
* @apiParam (Path) {UUID} memberId The member's id
|
||||
*
|
||||
* @apiSuccess {Object} data The member object
|
||||
*
|
||||
@@ -281,11 +281,11 @@ function _getMembersForItem (type) {
|
||||
* @apiName GetMembersForGroup
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} groupId The group id
|
||||
* @apiParam {UUID} lastId Query parameter to specify the last member returned in a previous request to this route and get the next batch of results
|
||||
* @apiParam {boolean} includeAllPublicFields Query parameter available only when fetching a party. If === `true` then all public fields for members will be returned (like when making a request for a single member)
|
||||
* @apiParam (Path) {UUID} groupId The group id
|
||||
* @apiParam (Query) {UUID} lastId Query parameter to specify the last member returned in a previous request to this route and get the next batch of results
|
||||
* @apiParam (Query) {Boolean} includeAllPublicFields Query parameter available only when fetching a party. If === `true` then all public fields for members will be returned (like when making a request for a single member)
|
||||
*
|
||||
* @apiSuccess {array} data An array of members, sorted by _id
|
||||
* @apiSuccess {Array} data An array of members, sorted by _id
|
||||
* @apiUse ChallengeNotFound
|
||||
* @apiUse GroupNotFound
|
||||
*/
|
||||
@@ -302,8 +302,8 @@ api.getMembersForGroup = {
|
||||
* @apiName GetInvitesForGroup
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} groupId The group id
|
||||
* @apiParam {UUID} lastId Query parameter to specify the last invite returned in a previous request to this route and get the next batch of results
|
||||
* @apiParam (Path) {UUID} groupId The group id
|
||||
* @apiParam (Query) {UUID} lastId Query parameter to specify the last invite returned in a previous request to this route and get the next batch of results
|
||||
*
|
||||
* @apiSuccess {array} data An array of invites, sorted by _id
|
||||
*
|
||||
@@ -327,11 +327,11 @@ api.getInvitesForGroup = {
|
||||
* @apiName GetMembersForChallenge
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} challengeId The challenge id
|
||||
* @apiParam {UUID} lastId Query parameter to specify the last member returned in a previous request to this route and get the next batch of results
|
||||
* @apiParam {String} includeAllMembers BETA Query parameter - If 'true' all challenge members are returned
|
||||
* @apiParam (Path) {UUID} challengeId The challenge id
|
||||
* @apiParam (Query) {UUID} lastId Query parameter to specify the last member returned in a previous request to this route and get the next batch of results
|
||||
* @apiParam (Query) {String} includeAllMembers BETA Query parameter - If 'true' all challenge members are returned
|
||||
|
||||
* @apiSuccess {array} data An array of members, sorted by _id
|
||||
* @apiSuccess {Array} data An array of members, sorted by _id
|
||||
*
|
||||
* @apiUse ChallengeNotFound
|
||||
* @apiUse GroupNotFound
|
||||
@@ -348,8 +348,8 @@ api.getMembersForChallenge = {
|
||||
* @apiName GetChallengeMemberProgress
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} challengeId The challenge _id
|
||||
* @apiParam {UUID} member The member _id
|
||||
* @apiParam (Path) {UUID} challengeId The challenge _id
|
||||
* @apiParam (Path) {UUID} memberId The member _id
|
||||
*
|
||||
* @apiSuccess {Object} data Return an object with member _id, profile.name and a tasks object with the challenge tasks for the member
|
||||
*
|
||||
@@ -404,8 +404,8 @@ api.getChallengeMemberProgress = {
|
||||
* @apiName GetObjectionsToInteraction
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {UUID} toUserId The user to interact with
|
||||
* @apiParam {String="send-private-message","transfer-gems"} interaction Name of the interaction to query
|
||||
* @apiParam (Path) {UUID} toUserId The user to interact with
|
||||
* @apiParam (Path) {String="send-private-message","transfer-gems"} interaction Name of the interaction to query
|
||||
*
|
||||
* @apiSuccess {Array} data Return an array of objections, if the interaction would be blocked; otherwise an empty array
|
||||
*/
|
||||
@@ -432,12 +432,12 @@ api.getObjectionsToInteraction = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @api {posts} /api/v3/members/send-private-message Send a private message to a member
|
||||
* @api {post} /api/v3/members/send-private-message Send a private message to a member
|
||||
* @apiName SendPrivateMessage
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {String} message Body parameter - The message
|
||||
* @apiParam {UUID} toUserId Body parameter - The user to contact
|
||||
* @apiParam (Body) {String} message Body parameter - The message
|
||||
* @apiParam (Body) {UUID} toUserId Body parameter - The user to contact
|
||||
*
|
||||
* @apiSuccess {Object} data An empty Object
|
||||
*
|
||||
@@ -488,13 +488,13 @@ api.sendPrivateMessage = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @api {posts} /api/v3/members/transfer-gems Send a gem gift to a member
|
||||
* @api {post} /api/v3/members/transfer-gems Send a gem gift to a member
|
||||
* @apiName TransferGems
|
||||
* @apiGroup Member
|
||||
*
|
||||
* @apiParam {String} message Body parameter The message
|
||||
* @apiParam {UUID} toUserId Body parameter The toUser _id
|
||||
* @apiParam {Integer} gemAmount Body parameter The number of gems to send
|
||||
* @apiParam (Body) {String} message The message
|
||||
* @apiParam (Body) {UUID} toUserId The toUser _id
|
||||
* @apiParam (Body) {Integer} gemAmount The number of gems to send
|
||||
*
|
||||
* @apiSuccess {Object} data An empty Object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user