generateur_v3/backend/api/api.json
Kilton937342 84b38cc12d ...
2022-09-18 22:43:04 +02:00

93 lines
2.8 KiB
JSON

{
"routes": {},
"events": {
"login": {
"input": { "token": null, "reconnect_code": null },
"output": {
"type": "loggedIn",
"member": { "username": "str", "reconnect_code": "str ou null" }
},
"broadcast": {
"all": {
"type": "connect",
"member": { "id": "int (member id!)" }
}
},
"errors": [
{
"type": "error",
"error": { "status": "401", "msg": "Membre introuvable" }
}
]
},
"join": {
"input": { "username": "str", "user": null },
"output": {
"public?": {
"type": "accepted",
"member": {
"username": "str",
"reconnect_code": "str ou null"
}
},
"private?": {
"type": "waiting",
"waiter": { "id_code": "str", "username": "str" }
}
},
"broadcast": {
"public?": {
"all": {
"type": "joined",
"member": {
"id": "int",
"username": "str",
"reconnect_code": "str uniquement pour l'admin"
}
}
},
"private?": {
"admin": {
"type": "waiter",
"waiter": { "id_code": "str", "username": "str" }
}
}
},
"errors": [
{
"status": "400",
"msg": "User input (trop long ou déjà pris, etc)"
}
]
},
"accept": {
"input": { "waiter_id": "str" },
"broadcast": {
"waiter": {
"type": "accepted",
"member": {
"username": "str",
"reconnect_code": "str ou null"
}
},
"all": {
"type": "joined",
"member": {
"id": "int",
"username": "str",
"reconnect_code": "str uniquement pour l'admin"
}
}
}
},
"reject": {
"input": { "waiter_id": "str" },
"output": {
"type": "successfullyRejected",
"waiter": { "id": "int" }
},
"broadcast": { "waiter": { "type": "rejected" } }
}
}
}