bb-tournament-api
Advanced tools
Comparing version 3.0.1 to 4.0.0
{ | ||
"name": "bb-tournament-api", | ||
"version": "3.0.1", | ||
"version": "4.0.0", | ||
"description": "API schema for BridgeBuddy tournament server", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "Score", | ||
"title": "InterventionScore", | ||
"description": "A Score that overrides the actual Score", | ||
"type": "object", | ||
"properties": { | ||
"points": { | ||
"type": "number", | ||
"minimum": -3160, | ||
"maximum": 3160 | ||
}, | ||
"percent": { | ||
@@ -16,8 +11,5 @@ "type": "number", | ||
"maximum": 100 | ||
}, | ||
"reason": { | ||
"type": "string", | ||
"description": "A human-readable description of why the Score was changed" | ||
} | ||
} | ||
}, | ||
"required": ["percent"] | ||
} |
54
types.js
@@ -101,7 +101,7 @@ // To parse this data: | ||
function toInterventionScore(json) { | ||
return cast(JSON.parse(json), r("Tables")); | ||
return cast(JSON.parse(json), r("InterventionScore")); | ||
} | ||
function interventionScoreToJson(value) { | ||
return JSON.stringify(uncast(value, r("Tables")), null, 2); | ||
return JSON.stringify(uncast(value, r("InterventionScore")), null, 2); | ||
} | ||
@@ -462,5 +462,5 @@ | ||
{ json: "pair", js: "pair", typ: r("SuitClass") }, | ||
{ json: "score", js: "score", typ: r("Percent") }, | ||
{ json: "score", js: "score", typ: r("Level") }, | ||
], false), | ||
"Percent": o([ | ||
"Level": o([ | ||
{ json: "type", js: "type", typ: "" }, | ||
@@ -471,7 +471,4 @@ { json: "minimum", js: "minimum", typ: u(undefined, 0) }, | ||
"BoardsProperties": o([ | ||
{ json: "points", js: "points", typ: u(undefined, r("Percent")) }, | ||
{ json: "percent", js: "percent", typ: u(undefined, r("Percent")) }, | ||
{ json: "reason", js: "reason", typ: u(undefined, r("Reason")) }, | ||
{ json: "number", js: "number", typ: u(undefined, r("BoardNr")) }, | ||
{ json: "players", js: "players", typ: u(undefined, r("Players")) }, | ||
{ json: "number", js: "number", typ: r("BoardNr") }, | ||
{ json: "players", js: "players", typ: r("Players") }, | ||
], false), | ||
@@ -485,6 +482,2 @@ "Players": o([ | ||
], false), | ||
"Reason": o([ | ||
{ json: "type", js: "type", typ: "" }, | ||
{ json: "description", js: "description", typ: u(undefined, "") }, | ||
], false), | ||
"Card": o([ | ||
@@ -512,3 +505,3 @@ { json: "$schema", js: "$schema", typ: "" }, | ||
{ json: "declarer", js: "declarer", typ: r("Value") }, | ||
{ json: "level", js: "level", typ: r("Percent") }, | ||
{ json: "level", js: "level", typ: r("Level") }, | ||
{ json: "suit", js: "suit", typ: r("Suit") }, | ||
@@ -551,3 +544,3 @@ { json: "contra", js: "contra", typ: r("Value") }, | ||
"InterventionProperties": o([ | ||
{ json: "operationid", js: "operationid", typ: r("Reason") }, | ||
{ json: "operationid", js: "operationid", typ: r("Operationid") }, | ||
{ json: "datetime", js: "datetime", typ: r("Datetime") }, | ||
@@ -569,2 +562,6 @@ { json: "admin", js: "admin", typ: r("Admin") }, | ||
], false), | ||
"Operationid": o([ | ||
{ json: "type", js: "type", typ: "" }, | ||
{ json: "description", js: "description", typ: u(undefined, "") }, | ||
], false), | ||
"Request": o([ | ||
@@ -587,2 +584,13 @@ { json: "type", js: "type", typ: "" }, | ||
], false), | ||
"InterventionScore": o([ | ||
{ json: "$schema", js: "$schema", typ: "" }, | ||
{ json: "title", js: "title", typ: "" }, | ||
{ json: "description", js: "description", typ: "" }, | ||
{ json: "type", js: "type", typ: "" }, | ||
{ json: "properties", js: "properties", typ: r("InterventionScoreProperties") }, | ||
{ json: "required", js: "required", typ: a("") }, | ||
], false), | ||
"InterventionScoreProperties": o([ | ||
{ json: "percent", js: "percent", typ: r("Level") }, | ||
], false), | ||
"Player": o([ | ||
@@ -597,3 +605,3 @@ { json: "$schema", js: "$schema", typ: "" }, | ||
"PlayerProperties": o([ | ||
{ json: "dbvId", js: "dbvId", typ: r("Reason") }, | ||
{ json: "dbvId", js: "dbvId", typ: r("Operationid") }, | ||
{ json: "name", js: "name", typ: r("Danger") }, | ||
@@ -639,4 +647,4 @@ ], false), | ||
{ json: "tableNr", js: "tableNr", typ: r("Danger") }, | ||
{ json: "NS", js: "NS", typ: r("Reason") }, | ||
{ json: "EW", js: "EW", typ: r("Reason") }, | ||
{ json: "NS", js: "NS", typ: r("Operationid") }, | ||
{ json: "EW", js: "EW", typ: r("Operationid") }, | ||
{ json: "deals", js: "deals", typ: r("PurpleDeals") }, | ||
@@ -658,3 +666,3 @@ ], false), | ||
"TentacledProperties": o([ | ||
{ json: "collection", js: "collection", typ: r("Reason") }, | ||
{ json: "collection", js: "collection", typ: r("Operationid") }, | ||
{ json: "id", js: "id", typ: r("Danger") }, | ||
@@ -671,8 +679,8 @@ ], false), | ||
"ScoreProperties": o([ | ||
{ json: "points", js: "points", typ: r("Percent") }, | ||
{ json: "percent", js: "percent", typ: r("Percent") }, | ||
{ json: "points", js: "points", typ: r("Level") }, | ||
{ json: "percent", js: "percent", typ: r("Level") }, | ||
{ json: "override", js: "override", typ: r("Override") }, | ||
], false), | ||
"Override": o([ | ||
{ json: "oneOf", js: "oneOf", typ: a(r("Percent")) }, | ||
{ json: "oneOf", js: "oneOf", typ: a(r("Level")) }, | ||
], false), | ||
@@ -692,3 +700,3 @@ "TableMongodb": o([ | ||
"ClientToken": o([ | ||
{ json: "oneOf", js: "oneOf", typ: a(r("Reason")) }, | ||
{ json: "oneOf", js: "oneOf", typ: a(r("Operationid")) }, | ||
], false), | ||
@@ -695,0 +703,0 @@ "TableStatus": o([ |
Sorry, the diff of this file is not supported yet
114228