@@ -15,12 +15,16 @@ module.exports = {
1515}
1616
1717
18- /*
19- * GET /:org/:repo/collaborators
18+ /**
19+ * @api {get } /:org/:repo/collaborators Get Collaborators
20+ * @apiUse ProjectReference
21+ * @apiDescription Gets a list of collaborators for a project
22+ * @apiName GetCollaborators
23+ * @apiGroup Collaborators
24+ * @apiVersion 1.0.0
2025 *
21- * Get the current list of collaborators for the Github repository.
22- *
23- * @param url Github html_url of the project.
26+ * @apiExample {curl} CURL Example:
27+ * curl -X GET http://localhost/api/strider/strider-cd/collaborators
2428 */
2529function get ( req , res ) {
2630 var project = req . params . org + '/' + req . params . repo ;
@@ -45,15 +49,23 @@ function get(req, res) {
4549 } ) ;
4650}
4751
48- /*
49- * POST /:org/:repo/collaborators/
52+ /**
53+ * @api {post } /:org/:repo/collaborators Add Collaborator
54+ * @apiUse ProjectReference
55+ * @apiPermission ProjectAdmin
56+ * @apiDescription Add a new collaborator to a repository/project.
57+ * @apiName AddCollaborator
58+ * @apiGroup Collaborators
59+ * @apiVersion 1.0.0
5060 *
51- * Add a new collaborator for a Github repository. You must have admin privileges on the corresponding RepoConfig
52- * to be able to use this endpoint.
61+ * @apiExample {curl} CURL Example:
62+ * curl -X GET http://localhost/api/strider/strider-cd/collaborators?email=new_guy@strider-cd.com&access_level=2
5363 *
54- * @param email Email address to add. If the user is not registered with Strider, we will send them an invite. If
55- * they are already registered, they will receive a notification of access.
56- * @param access_level Access level to grant. 0 = read-only, 2 = admin (default: 0)
64+ * @apiParam (RequestBody) {String} email Email address to add. If the user is
65+ * not registered with Strider, we will send them an invite. If they are already
66+ * registered, they will receive a notification of access.
67+ * @apiParam (RequestBody) {Number} access_level=0 Access level to grant to the
68+ * new collaborator. This can be `0`, for read only access, or `2` for admin access.
5769 */
5870function post ( req , res ) {
5971 var project = req . params . org + '/' + req . params . repo
@@ -67,12 +79,19 @@ function post(req, res) {
6779 } )
6880}
6981
70- /*
71- * DELETE /:org/:repo/collaborators/
82+ /**
83+ * @api {delete } /:org/:repo/collaborators Delete Collaborator
84+ * @apiUse ProjectReference
85+ * @apiPermission ProjectAdmin
86+ * @apiDescription Remove a collaborator from a repository/project.
87+ * @apiName DeleteCollaborator
88+ * @apiGroup Collaborators
89+ * @apiVersion 1.0.0
7290 *
73- * Delete the specified user from the list of collaborators for the Github repository.
91+ * @apiExample {curl} CURL Example:
92+ * curl -X DELETE -d email=old_guy@strider-cd.com http://localhost/api/strider/strider-cd/collaborators
7493 *
75- * @param email Email of the user .
94+ * @apiParam (RequestBody) {String} email Email address to remove from the repo/project .
7695 */
7796function del ( req , res ) {
7897 var project = req . params . org + '/' + req . params . repo
0 commit comments