Craig Fletcher 4 éve
commit
dfeda966ae
4 módosított fájl, 93 hozzáadás és 0 törlés
  1. 43 0
      errors.js
  2. 28 0
      factions.js
  3. 10 0
      index.js
  4. 12 0
      package.json

+ 43 - 0
errors.js

@@ -0,0 +1,43 @@
+const errors = {
+  user: {
+    notfound: {
+      message: "User does not exist",
+      code: 11
+    },
+    badpassword: {
+      message: "Incorrect password",
+      code: 12
+    },
+    nouser: {
+      message: "No user specified",
+      code: 13
+    }
+  },
+  register: {
+    exists: {
+      message: "User already exists",
+      code: 21
+    }
+  },
+  vote: {
+    baduser: {
+      message: "User does not exist or incorrect password",
+      code: 31
+    },
+    novotes: {
+      message: "User does not exist or has not yet voted",
+      code: 32
+    }
+  },
+  votes: {
+    toosoon: {
+      message: "Too soon to show you that",
+      code: 41
+    },
+    novotes: {
+      message: "Nobody has voted yet",
+      code: 42
+    }
+  }
+};
+export default errors;

+ 28 - 0
factions.js

@@ -0,0 +1,28 @@
+const factions = [
+  { name: "Arborec", id: 1 },
+  { name: "Barony of Letnev", id: 2 },
+  { name: "Clan of Saar", id: 3 },
+  { name: "Embers of Muaat", id: 4 },
+  { name: "Emirates of Hacan", id: 5 },
+  { name: "Federation of Sol", id: 6 },
+  { name: "Ghosts of Creuss", id: 7 },
+  { name: "L1Z1X Mindnet", id: 8 },
+  { name: "Mentak Coalition", id: 9 },
+  { name: "Naalu Collective", id: 10 },
+  { name: "Nekro Virus", id: 11 },
+  { name: "Sardakk N’orr", id: 12 },
+  { name: "Universities of Jol-Nar", id: 13 },
+  { name: "Winnu", id: 14 },
+  { name: "Xxcha Kingdom", id: 15 },
+  { name: "Yin Brotherhood", id: 16 },
+  { name: "Yssaril Tribes", id: 17 },
+  { name: "Argent Flight", id: 18 },
+  { name: "Empyrean", id: 19 },
+  { name: "Mahact Gene-Sorcerers", id: 20 },
+  { name: "Naaz-Rokha Alliance", id: 21 },
+  { name: "Nomad", id: 22 },
+  { name: "Titans of Ul", id: 23 },
+  { name: "Vuil'Raith Cabal", id: 24 }
+];
+
+export default factions;

+ 10 - 0
index.js

@@ -0,0 +1,10 @@
+import errors from "./errors";
+import factions from "./factions";
+
+const common = {
+  errors,
+  factions
+};
+
+export { errors, factions };
+export default common;

+ 12 - 0
package.json

@@ -0,0 +1,12 @@
+{
+  "name": "common",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC"
+}