master
Mark Moffat 2019-12-30 13:18:45 +10:30
parent 78fc1285d2
commit 967ac66786
6 changed files with 122 additions and 49 deletions

152
package-lock.json generated
View File

@ -2351,6 +2351,12 @@
} }
} }
}, },
"console-assert": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/console-assert/-/console-assert-1.0.0.tgz",
"integrity": "sha1-cBZwKO8I7BZnoMaHIFqDYOsRc2c=",
"dev": true
},
"contains-path": { "contains-path": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
@ -3088,9 +3094,9 @@
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"eslint": { "eslint": {
"version": "6.6.0", "version": "6.8.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.6.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz",
"integrity": "sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==", "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==",
"dev": true, "dev": true,
"requires": { "requires": {
"@babel/code-frame": "^7.0.0", "@babel/code-frame": "^7.0.0",
@ -3108,7 +3114,7 @@
"file-entry-cache": "^5.0.1", "file-entry-cache": "^5.0.1",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"glob-parent": "^5.0.0", "glob-parent": "^5.0.0",
"globals": "^11.7.0", "globals": "^12.1.0",
"ignore": "^4.0.6", "ignore": "^4.0.6",
"import-fresh": "^3.0.0", "import-fresh": "^3.0.0",
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
@ -3121,7 +3127,7 @@
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"optionator": "^0.8.2", "optionator": "^0.8.3",
"progress": "^2.0.0", "progress": "^2.0.0",
"regexpp": "^2.0.1", "regexpp": "^2.0.1",
"semver": "^6.1.2", "semver": "^6.1.2",
@ -3168,6 +3174,15 @@
"ms": "^2.1.1" "ms": "^2.1.1"
} }
}, },
"globals": {
"version": "12.3.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz",
"integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==",
"dev": true,
"requires": {
"type-fest": "^0.8.1"
}
},
"ignore": { "ignore": {
"version": "4.0.6", "version": "4.0.6",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
@ -3200,6 +3215,12 @@
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
"integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
"dev": true "dev": true
},
"type-fest": {
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
"integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
"dev": true
} }
} }
}, },
@ -3299,6 +3320,44 @@
"regexpp": "^2.0.1" "regexpp": "^2.0.1"
} }
}, },
"eslint-plugin-extra-rules": {
"version": "0.0.0-development",
"resolved": "https://registry.npmjs.org/eslint-plugin-extra-rules/-/eslint-plugin-extra-rules-0.0.0-development.tgz",
"integrity": "sha1-w8Gu0whsOf2Dwbek+j35iEtKu0g=",
"dev": true,
"requires": {
"console-assert": "1.0.0",
"espree": "3.0.0-alpha-1",
"quote": "0.4.0"
},
"dependencies": {
"acorn": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz",
"integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=",
"dev": true
},
"acorn-jsx": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-2.0.1.tgz",
"integrity": "sha1-Dt+YeKWGa8piX1KVWh7Z59jFEX4=",
"dev": true,
"requires": {
"acorn": "^2.0.1"
}
},
"espree": {
"version": "3.0.0-alpha-1",
"resolved": "https://registry.npmjs.org/espree/-/espree-3.0.0-alpha-1.tgz",
"integrity": "sha1-yhOAvYHy+ulLJjiufMRJtx+R6qM=",
"dev": true,
"requires": {
"acorn": "^2.6.4",
"acorn-jsx": "^2.0.1"
}
}
}
},
"eslint-plugin-import": { "eslint-plugin-import": {
"version": "2.18.2", "version": "2.18.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz",
@ -5566,9 +5625,9 @@
"optional": true "optional": true
}, },
"import-fresh": { "import-fresh": {
"version": "3.1.0", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.1.0.tgz", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",
"integrity": "sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ==", "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"parent-module": "^1.0.0", "parent-module": "^1.0.0",
@ -5645,9 +5704,9 @@
"dev": true "dev": true
}, },
"inquirer": { "inquirer": {
"version": "7.0.0", "version": "7.0.1",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.0.tgz", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.1.tgz",
"integrity": "sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ==", "integrity": "sha512-V1FFQ3TIO15det8PijPLFR9M9baSlnRs9nL7zWu1MNVA2T9YVl9ZbrHJhYs7e9X8jeMZ3lr2JH/rdHFgNCBdYw==",
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-escapes": "^4.2.1", "ansi-escapes": "^4.2.1",
@ -5659,16 +5718,16 @@
"lodash": "^4.17.15", "lodash": "^4.17.15",
"mute-stream": "0.0.8", "mute-stream": "0.0.8",
"run-async": "^2.2.0", "run-async": "^2.2.0",
"rxjs": "^6.4.0", "rxjs": "^6.5.3",
"string-width": "^4.1.0", "string-width": "^4.1.0",
"strip-ansi": "^5.1.0", "strip-ansi": "^5.1.0",
"through": "^2.3.6" "through": "^2.3.6"
}, },
"dependencies": { "dependencies": {
"ansi-regex": { "ansi-regex": {
"version": "4.1.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
"dev": true "dev": true
}, },
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
@ -5678,14 +5737,25 @@
"dev": true "dev": true
}, },
"string-width": { "string-width": {
"version": "4.1.0", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
"integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
"dev": true, "dev": true,
"requires": { "requires": {
"emoji-regex": "^8.0.0", "emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0", "is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^5.2.0" "strip-ansi": "^6.0.0"
},
"dependencies": {
"strip-ansi": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
"integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
"dev": true,
"requires": {
"ansi-regex": "^5.0.0"
}
}
} }
}, },
"strip-ansi": { "strip-ansi": {
@ -5695,6 +5765,14 @@
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-regex": "^4.1.0" "ansi-regex": "^4.1.0"
},
"dependencies": {
"ansi-regex": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
"dev": true
}
} }
} }
} }
@ -7306,25 +7384,17 @@
} }
}, },
"optionator": { "optionator": {
"version": "0.8.2", "version": "0.8.3",
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
"integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
"dev": true, "dev": true,
"requires": { "requires": {
"deep-is": "~0.1.3", "deep-is": "~0.1.3",
"fast-levenshtein": "~2.0.4", "fast-levenshtein": "~2.0.6",
"levn": "~0.3.0", "levn": "~0.3.0",
"prelude-ls": "~1.1.2", "prelude-ls": "~1.1.2",
"type-check": "~0.3.2", "type-check": "~0.3.2",
"wordwrap": "~1.0.0" "word-wrap": "~1.2.3"
},
"dependencies": {
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
"dev": true
}
} }
}, },
"ora": { "ora": {
@ -8007,6 +8077,12 @@
"integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=",
"dev": true "dev": true
}, },
"quote": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/quote/-/quote-0.4.0.tgz",
"integrity": "sha1-EIOSF/bBNiuJGUBE0psjP9fzLwE=",
"dev": true
},
"rand-token": { "rand-token": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmjs.org/rand-token/-/rand-token-0.4.0.tgz", "resolved": "https://registry.npmjs.org/rand-token/-/rand-token-0.4.0.tgz",
@ -8536,9 +8612,9 @@
"dev": true "dev": true
}, },
"rxjs": { "rxjs": {
"version": "6.5.3", "version": "6.5.4",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"tslib": "^1.9.0" "tslib": "^1.9.0"
@ -10120,6 +10196,12 @@
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
"integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0="
}, },
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true
},
"wordwrap": { "wordwrap": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",

View File

@ -71,8 +71,9 @@
}, },
"devDependencies": { "devDependencies": {
"ava": "^2.4.0", "ava": "^2.4.0",
"eslint": "^6.6.0", "eslint": "^6.8.0",
"eslint-config-standard": "^13.0.1", "eslint-config-standard": "^13.0.1",
"eslint-plugin-extra-rules": "0.0.0-development",
"eslint-plugin-import": "^2.18.2", "eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^9.2.0", "eslint-plugin-node": "^9.2.0",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",

View File

@ -293,7 +293,7 @@ router.post('/admin/settings/page', restrict, checkAccess, async (req, res) => {
} }
}); });
// delete page // delete a page
router.post('/admin/settings/page/delete', restrict, checkAccess, async (req, res) => { router.post('/admin/settings/page/delete', restrict, checkAccess, async (req, res) => {
const db = req.app.db; const db = req.app.db;

View File

@ -282,7 +282,7 @@ router.post('/admin/product/update', restrict, checkAccess, async (req, res) =>
} }
}); });
// delete product // delete a product
router.post('/admin/product/delete', restrict, checkAccess, async (req, res) => { router.post('/admin/product/delete', restrict, checkAccess, async (req, res) => {
const db = req.app.db; const db = req.app.db;

View File

@ -85,7 +85,7 @@ router.get('/admin/user/new', restrict, (req, res) => {
}); });
}); });
// delete user // delete a user
router.post('/admin/user/delete', restrict, async (req, res) => { router.post('/admin/user/delete', restrict, async (req, res) => {
const db = req.app.db; const db = req.app.db;

View File

@ -36,13 +36,3 @@ test('[Success] Get orders by <Paid> status', async t => {
// Check the returned order length // Check the returned order length
t.deepEqual(1, res.body.orders.length); t.deepEqual(1, res.body.orders.length);
}); });
// test.skip('[Success] Filter orders', async t => {
// const res = await g.request
// .get('/admin/orders/filter/test@test.com')
// .set('apiKey', g.users[0].apiKey)
// .expect(200);
// // Check the returned order length
// t.deepEqual(2, res.body.orders.length);
// });