12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- module.exports = {
- SUCCESS: 0,
- EPERM: 1,
- ENOENT: 2,
- EINVAL: 22,
- UNKNWON: -1,
- BAD_USER: -2,
- USER_EXISTS: -3,
- BAD_PROJECT: -4,
- PROJECT_EXISTS: -5,
- BAD_RES: -6,
- RES_EXISTS: -7,
- AUTH_FAILED: -8,
- messages :
- {
- '0' : ["Success", 200],
- '1': ["Opération interdite", 403],
- '2': ["Fichier introuvable", 404],
- '22': ["Mauvais argument(s)",400],
- '-1': ["Erreur inconnue", 400],
- '-2': ["Utilisateur inconnu", 400],
- '-3': ["Utilisateur déja existant", 400],
- '-4': ["Projet inconnu", 400],
- '-6': ["Ressource inconnue", 400],
- '-7': ["Ressource déjà existant", 400],
- '-5': ["Projet déjà existant", 400],
- '-8': ["Echec de l'authentification", 403]
- },
- check : function(x)
- {
- if(x==undefined || x==null || ( Number.isInteger(x) && x!=0) )
- return false;
- return true;
- }
- }
|