APIB docs full width and add permission level info

pull/32/head
HardiReady 2018-04-02 10:28:20 +02:00
parent d2c5850a3d
commit c921afa3fe
12 changed files with 40 additions and 25 deletions

View File

@ -2,7 +2,7 @@
List all app users, ordered by username
*Permission: 4*
**Permission: 4**
+ Response 200 (application/json; charset=utf-8)
@ -13,7 +13,7 @@ List all app users, ordered by username
Update an app user, identified by its id
*Permission: 4*
**Permission: 4**
+ Parameters
+ id: `5abf5064861d950f157c4a09` (string, required) - unique id of app user
@ -29,7 +29,7 @@ Update an app user, identified by its id
### Delete App User [DELETE /account/{id}]
*Permission: 4*
**Permission: 4**
Delete an app user

View File

@ -2,7 +2,7 @@
Update an army members signature image
*Permission: 4*
**Permission: 4**
+ Parameters
+ userId: `5ab68d42f547ed304064e5f7` (string, required) - army members unique user id

View File

@ -28,7 +28,7 @@ List all awardings
Create a new awarding which is immediatly assigned to the user
*Permission: 2*
**Permission: 2**
+ Request (application/json)
@ -46,7 +46,7 @@ Create a new awarding which is immediatly assigned to the user
Create a new awarding proposal, that needs to be approved by higher permission level user to take effect
*Permission: 1*
**Permission: 1**
+ Request (application/json)

View File

@ -34,7 +34,7 @@ Retrieve single decoration data
Create a new decoration
*Permission: 2*
**Permission: 2**
+ Request (multipart/form-data; boundary=---BOUNDARY)
@ -75,7 +75,7 @@ Create a new decoration
Update decoration, identified by its id
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abeb420b987672bb1ede643` (string, required) - unique id of the decoration
@ -119,7 +119,7 @@ Update decoration, identified by its id
Delete a decoration
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abeb43cb987672bb1ede644` (string, required) - unique id of the decoration

View File

@ -27,7 +27,7 @@ List all promotion requests
Create a new proposal for a promotion, that needs to be approved by higher permission level user to take effect
*Permission: 1*
**Permission: 1**
+ Request (application/json)
@ -45,7 +45,7 @@ Create a new proposal for a promotion, that needs to be approved by higher permi
Update the promotion proposal
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abf50d9861d950f157c4a0a` (string, required) - unique id of the promotion

View File

@ -33,7 +33,7 @@ Retrieve single rank data
Create a new rank
*Permission: 2*
**Permission: 2**
+ Request (multipart/form-data; boundary=---BOUNDARY)
@ -69,7 +69,7 @@ Create a new rank
Update rank, identified by its id
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abeb23995cf43205225710b` (string, required) - unique id of the rank
@ -108,7 +108,7 @@ Update rank, identified by its id
Delete a rank
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abeb1b995cf43205225710a` (string, required) - unique id of the rank

View File

@ -32,7 +32,7 @@ Get single squad information
Create a new squad
*Permission: 2*
**Permission: 2**
+ Request (multipart/form-data; boundary=---BOUNDARY)
@ -63,7 +63,7 @@ Create a new squad
Update squad, identified by its id
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abe166f8b7488392a623f12` (string, required) - unique id of the squad
@ -102,7 +102,7 @@ Update squad, identified by its id
Delete a squad
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abe16f98b7488392a623f17` (string, required) - unique id of the squad

View File

@ -48,7 +48,7 @@ Get single army member information
Create a new army member
*Permission: 2*
**Permission: 2**
+ Request (application/json)
@ -63,7 +63,7 @@ Create a new army member
Update an army member, identified by its id
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member
@ -85,7 +85,7 @@ Update an army member, identified by its id
Delete an army member
*Permission: 2*
**Permission: 2**
+ Parameters
+ id: `5abd4780396bc0487068be0e` (string, required) - unique id of army-member

View File

@ -33,3 +33,18 @@ The following example illustrates how to provide the token when using `curl`
> curl -H "X-Access-Token: $CC_API_TOKEN" <API_RESOURCE_PATH_GOES_HERE>
```
## Permission Levels
The permission level is resolved by the API token you send, which resolves the specific app user information.
Endpoints that require a certain permission level to be accessed, mention the **minimum** required permission level in the description.
```
Permission Levels:
0 - User
1 - Squadlead
2 - High Command
3 - Maintainer
4 - Administrator
```

View File

@ -13,7 +13,7 @@ Get single campaign information
Create a new campaign
*Permission: 3*
**Permission: 3**
+ Request Create new army member (application/json)
@ -28,7 +28,7 @@ Create a new campaign
Delete a campaign
*Permission: 3*
**Permission: 3**
+ Parameters
+ id: `5abd58989e30a76bfef747e6` (string, required) - unique id of campaign

View File

@ -22,7 +22,7 @@ Retrieve single war data
Create a new war
*Permission: 3*
**Permission: 3**
*NOTE: First line of the log file sent should be NOT beginning of actual game logs! This might result in unparsable line.*
@ -80,7 +80,7 @@ Create a new war
Delete a war
*Permission: 3*
**Permission: 3**
+ Parameters
+ id: `5abf65d83fc5fa349ffd5cbb` (string, required) - unique id of the war

View File

@ -14,7 +14,7 @@
"start-test": "DEBUG='cc:*' NODE_ENV=unitTest node server.js",
"start-api-test": "rm -rf ./apib/dredd/data/tmp-resource && cp -r ./apib/dredd/data/resource ./apib/dredd/data/tmp-resource && DEBUG='cc:*' NODE_ENV=dreddTest node server.js",
"api:compile-docs": "$(npm bin)/hercule apib/dev-doc.apib -o apib/documentation.apib",
"api:publish-docs": "$(npm bin)/aglio --theme-variables slate -i ./apib/documentation.apib -o ../public/api-docs.html",
"api:publish-docs": "$(npm bin)/aglio --theme-variables slate --theme-full-width -i ./apib/documentation.apib -o ../public/api-docs.html",
"api:test-docs": "npm run api:docs && $(npm bin)/dredd",
"api:docs": "npm run api:compile-docs && npm run api:publish-docs"
},