Fix tests by adding json analysis
parent
74b1b587a6
commit
01b2378d6d
|
@ -0,0 +1,79 @@
|
|||
# Log (object)
|
||||
## Properties
|
||||
+ _id: `` (string, required) - log entry id
|
||||
+ war: `` (string, required) - warId
|
||||
+ time: `` (string, required) - logging timestamp
|
||||
+ __v: 0 (number, required) - object version number
|
||||
|
||||
# LogPoints (Log)
|
||||
## Properties
|
||||
+ ptBlufor: 2 (number, required) -
|
||||
+ ptOpfor: 4 (number, required) -
|
||||
+ fraction: `OPFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
+ `NONE`
|
||||
|
||||
#LogBudget (Log)
|
||||
## Properties
|
||||
+ oldBudget: 400000 (number, required)
|
||||
+ newBudget: 380000 (number, required)
|
||||
+ fraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
|
||||
#LogFlag (Log)
|
||||
## Properties
|
||||
+ player: `HardiReady` (string, required)
|
||||
+ capture: true (boolean, required)
|
||||
+ flagFraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
|
||||
#LogKill (Log)
|
||||
## Properties
|
||||
+ shooter: `HardiReady` (string, required)
|
||||
+ target: `KalleK` (string, required)
|
||||
+ friendlyFire: true (boolean, required)
|
||||
+ fraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
+ `NONE`
|
||||
|
||||
#LogRespawn (Log)
|
||||
## Properties
|
||||
+ player: `radical1976` (string, required)
|
||||
|
||||
#LogRevive (Log)
|
||||
## Properties
|
||||
+ medic: `radical1976` (string, required)
|
||||
+ patient: `radical1976` (string, required)
|
||||
+ stabilized: false (boolean, required)
|
||||
+ flagFraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
|
||||
#LogTransport (Log)
|
||||
## Properties
|
||||
+ driver: `radical1976` (string, required)
|
||||
+ passenger: `radical1976` (string, required)
|
||||
+ distance: 2435 (number, required)
|
||||
+ flagFraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
|
||||
#LogVehicle (Log)
|
||||
## Properties
|
||||
+ shooter: `HardiReady` (string, required)
|
||||
+ target: `Murda]X[` (string, required)
|
||||
+ fraction: `BLUFOR` (enum, required)
|
||||
+ Members
|
||||
+ `BLUFOR`
|
||||
+ `OPFOR`
|
||||
+ `NONE`
|
|
@ -14,7 +14,7 @@ Basic player statistic information object
|
|||
+ revive: 0 (number, required) - sum of revives
|
||||
|
||||
|
||||
# CampaignPlayer (BasicPlayer)
|
||||
# WarPlayer (BasicPlayer)
|
||||
A player campaign statistics object
|
||||
|
||||
## Properties
|
||||
|
|
|
@ -14,7 +14,8 @@ A war as used in statistics
|
|||
+ budgetBlufor: 3900000 (number, required) - start budget of fraction Blufor
|
||||
+ budgetOpfor: 4100000 (number, required) - start budget of fraction Opfor
|
||||
+ endBudgetBlufor: 924000 (number, required) - end budget of fraction Blufor
|
||||
+ endBudgetOpfor: -12400 (number, required) - end budget of fraction Opfor
|
||||
+ endBudgetOpfor: 12400 (number, required) - end budget of fraction Opfor
|
||||
+ players (array[WarPlayer], required) - collection of all participating players with their statistics
|
||||
+ timestamp: `2018-02-24T01:01:25.825Z` (string, required) - creation date
|
||||
+ updatedAt: `2018-02-24T01:01:25.825Z` (string, required) - the version timestamp
|
||||
+ __v: 0 (number, required) - the version number of the object
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
|
||||
:[Gists](_decoration.apib)
|
||||
|
||||
:[Gists](_log.apib)
|
||||
|
||||
:[Gists](_player.apib)
|
||||
|
||||
:[Gists](_promotion.apib)
|
||||
|
|
|
@ -40,6 +40,8 @@ FORMAT: 1A
|
|||
|
||||
# Group Logs
|
||||
|
||||
:[Gists](statistics/logs.apib)
|
||||
|
||||
# Group Players
|
||||
|
||||
:[Gists](statistics/players.apib)
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
### Get War Logs [GET /logs/{warId}]
|
||||
|
||||
Ge the combined log object, containing all events in collections, for a single war
|
||||
|
||||
+ Parameters
|
||||
+ warId: `5abf65ae3fc5fa349ffd5ca3` (string, required) - unique id of the war
|
||||
|
||||
+ Response 200 (application/json; charset=utf-8)
|
||||
|
||||
+ Attributes
|
||||
+ points (array[LogPoints], required)
|
||||
+ budget (array[LogBudget], required)
|
||||
+ respawn (array[LogRespawn], required)
|
||||
+ revive (array[LogRevive], required)
|
||||
+ kill (array[LogKill], required)
|
||||
+ vehicle (array[LogVehicle], required)
|
||||
+ transport (array[LogTransport], required)
|
||||
+ flag (array[LogFlag], required)
|
|
@ -1,4 +1,4 @@
|
|||
### Get Player Highscore [GET /ranking/{campaignId}]
|
||||
### Get Player Highscore [GET /players/ranking/{campaignId}]
|
||||
|
||||
List highscores for player statistics over all wars of a certain campaign.
|
||||
Every highscore player object contains a field *sum*, representing its order number in the collection
|
||||
|
@ -6,7 +6,7 @@ Every highscore player object contains a field *sum*, representing its order num
|
|||
+ Parameters
|
||||
+ campaignId: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of the campaign
|
||||
|
||||
+ Response 200
|
||||
+ Response 200 (application/json; charset=utf-8)
|
||||
|
||||
+ Attributes
|
||||
+ kill (array[HighscorePlayer],required) - player highscore for kill
|
||||
|
@ -18,17 +18,17 @@ Every highscore player object contains a field *sum*, representing its order num
|
|||
+ flagTouch (array[HighscorePlayer],required) - player highscore for flag captures
|
||||
|
||||
|
||||
### Get Player Campaign Statistics [GET /single/{campaignId}/{playerId}]
|
||||
### Get Player Campaign Statistics [GET /players/single/{campaignId}/{playerSteamId}]
|
||||
|
||||
Get statistics for a single player for all wars of a campaign he took part at
|
||||
|
||||
+ Parameters
|
||||
+ campaignId: `5abd55ea9e30a76bfef747d6` (string, required) - unique id of the campaign
|
||||
+ playerId: `5abf65ae3fc5fa349ffd5ca4` (string, required) - unique id of the player
|
||||
+ playerSteamId: `76561198050321490` (string, required) - STEAM application unique user id of player
|
||||
|
||||
+ Response 200
|
||||
+ Response 200 (application/json; charset=utf-8)
|
||||
|
||||
+ Attributes
|
||||
+ name: `Pumarang` (string, required) - latest used playername
|
||||
+ campaign (Campaign,required) - campaign reflected from request is
|
||||
+ players (array[CampaignPlayer],required) - collection of player instances in the campaign
|
||||
+ players (array[WarPlayer],required) - collection of player instances in the campaign
|
||||
|
|
|
@ -13,7 +13,7 @@ Retrieve single war data
|
|||
+ Parameters
|
||||
+ id: `5abf65ae3fc5fa349ffd5ca3` (string, required) - unique id of the war to fetch
|
||||
|
||||
+ Response 200
|
||||
+ Response 200 (application/json; charset=utf-8)
|
||||
|
||||
+ Attributes (War, fixed-type)
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@
|
|||
"aglio": "^2.3.0",
|
||||
"chai": "^3.5.0",
|
||||
"chai-http": "^3.0.0",
|
||||
"dredd": "^5.1.4",
|
||||
"dredd": "^5.1.5",
|
||||
"eslint": "^4.18.2",
|
||||
"eslint-config-google": "^0.9.1",
|
||||
"hercule": "^4.1.1",
|
||||
|
|
|
@ -58,11 +58,10 @@ logsRouter.route('/:warId')
|
|||
|
||||
async.parallel(resources, (error, results) => {
|
||||
if (error) {
|
||||
res.status(500).send(error);
|
||||
return;
|
||||
res.status(500);
|
||||
}
|
||||
res.locals.items = results;
|
||||
next();
|
||||
next(error);
|
||||
});
|
||||
})
|
||||
.all(
|
||||
|
|
Loading…
Reference in New Issue