Compare commits
4 commits
master
...
Feature/Ad
Author | SHA1 | Date | |
---|---|---|---|
8931f4bd86 | |||
d883640955 | |||
a73ec272a8 | |||
3bfa60db28 |
19 changed files with 8263 additions and 724 deletions
33
TODO
Normal file
33
TODO
Normal file
|
@ -0,0 +1,33 @@
|
|||
- Testing
|
||||
- create tests infrastracture
|
||||
- Tests
|
||||
- create user
|
||||
- delete user
|
||||
- create&delete user with children
|
||||
- create&delete user with connections
|
||||
|
||||
- Admin view
|
||||
- Bugs
|
||||
- delete children and links
|
||||
- delete user
|
||||
V delete self
|
||||
V delete child
|
||||
V delete self
|
||||
V delete links
|
||||
V delete links vvv
|
||||
- delete books and pages
|
||||
- delete user in 2 different windows (check if global 'currentUser' is affected)
|
||||
|
||||
- Edit user
|
||||
- edit users fields
|
||||
|
||||
- Grapsh
|
||||
- general
|
||||
- change period option (year,month,week,day)
|
||||
- sections (Users, calls, books? children?)
|
||||
- users
|
||||
- Last created
|
||||
- Last logged in
|
||||
- calls
|
||||
- avarage duration (need to add duration to table)
|
||||
- active calls?
|
|
@ -5,36 +5,47 @@ const Link = use('App/Models/Link');
|
|||
const IceServer = use('App/Models/IceServer');
|
||||
|
||||
const EmailUtils = use('App/Utils/EmailUtils');
|
||||
const UserUtils = use('App/Utils/UserUtils');
|
||||
class AdminApiController {
|
||||
async getUsers({response}) {
|
||||
const users = await User.all();
|
||||
// console.log(typeof users);
|
||||
// return users.rows.map(u => {
|
||||
// return u.publicJSON();
|
||||
// });
|
||||
return users;
|
||||
}
|
||||
async addStunServer({request, response}) {}
|
||||
async addTurnServer({request, response}) {}
|
||||
|
||||
async testEmailSettings({auth, response}) {
|
||||
try {
|
||||
if (EmailUtils.sendTestEmail(auth.user)) {
|
||||
return {
|
||||
code: 0, data: {}
|
||||
}
|
||||
}
|
||||
return {
|
||||
code: 500, message: 'Something went wrong'
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
response.code(500);
|
||||
return {
|
||||
code: 500, message: e.message
|
||||
}
|
||||
async getUsers({ response }) {
|
||||
const users = await User.all();
|
||||
// console.log(typeof users);
|
||||
// return users.rows.map(u => {
|
||||
// return u.publicJSON();
|
||||
// });
|
||||
return users;
|
||||
}
|
||||
|
||||
async deleteUser({ request, response }) {
|
||||
const { id } = request.params
|
||||
|
||||
return UserUtils.deleteUser(id)
|
||||
}
|
||||
|
||||
async addStunServer({ request, response }) {}
|
||||
async addTurnServer({ request, response }) {}
|
||||
|
||||
async testEmailSettings({ auth, response }) {
|
||||
try {
|
||||
if (EmailUtils.sendTestEmail(auth.user)) {
|
||||
return {
|
||||
code: 0,
|
||||
data: {}
|
||||
}
|
||||
}
|
||||
return {
|
||||
code: 500,
|
||||
message: 'Something went wrong'
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
response.code(500);
|
||||
return {
|
||||
code: 500,
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = AdminApiController
|
|
@ -7,54 +7,54 @@ const Hash = use('Hash')
|
|||
const Model = use('Model')
|
||||
|
||||
class User extends Model {
|
||||
static boot() {
|
||||
super
|
||||
.boot()
|
||||
static boot() {
|
||||
super
|
||||
.boot()
|
||||
|
||||
/**
|
||||
* A hook to hash the user password before saving
|
||||
* it to the database.
|
||||
*/
|
||||
this.addHook('beforeSave', async (userInstance) => {
|
||||
if (userInstance.dirty.password) {
|
||||
userInstance.password = await Hash.make(userInstance.password)
|
||||
}
|
||||
this.addHook('beforeSave', async(userInstance) => {
|
||||
if (userInstance.dirty.password) {
|
||||
userInstance.password = await Hash.make(userInstance.password)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
publicJSON() {
|
||||
const u = this.toJSON();
|
||||
return {
|
||||
avatar: `https://api.adorable.io/avatars/285/${u.email}.png`, id: u.id,
|
||||
name: u.name, isAdmin: u.is_admin
|
||||
}
|
||||
}
|
||||
|
||||
static get hidden() {
|
||||
return ['password']
|
||||
}
|
||||
// publicJSON() {
|
||||
// const u = this.toJSON();
|
||||
// return {
|
||||
// avatar: `https://api.adorable.io/avatars/285/${u.email}.png`, id: u.id,
|
||||
// name: u.name, isAdmin: u.is_admin
|
||||
// }
|
||||
// }
|
||||
|
||||
static get dates() {
|
||||
return super.dates.concat(['last_logged_in'])
|
||||
}
|
||||
static get hidden() {
|
||||
return ['password']
|
||||
}
|
||||
|
||||
/**
|
||||
* A relationship on tokens is required for auth to
|
||||
* work. Since features like `refreshTokens` or
|
||||
* `rememberToken` will be saved inside the
|
||||
* tokens table.
|
||||
*
|
||||
* @method tokens
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
tokens() {
|
||||
return this.hasMany('App/Models/Token')
|
||||
}
|
||||
static get dates() {
|
||||
return super.dates.concat(['last_logged_in'])
|
||||
}
|
||||
|
||||
links() {
|
||||
return this.hasMany('App/Models/Link')
|
||||
}
|
||||
/**
|
||||
* A relationship on tokens is required for auth to
|
||||
* work. Since features like `refreshTokens` or
|
||||
* `rememberToken` will be saved inside the
|
||||
* tokens table.
|
||||
*
|
||||
* @method tokens
|
||||
*
|
||||
* @return {Object}
|
||||
*/
|
||||
tokens() {
|
||||
return this.hasMany('App/Models/Token')
|
||||
}
|
||||
|
||||
links() {
|
||||
return this.hasMany('App/Models/Link')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = User
|
|
@ -1,69 +1,78 @@
|
|||
|
||||
|
||||
const Link = use('App/Models/Link');
|
||||
const Child = use('App/Models/Child');
|
||||
class UserChildUtils {
|
||||
static async isUserConnectedToChild(user_id, child_id) {
|
||||
const links = await Link.query().where({user_id, child_id}).fetch();
|
||||
return !!links.rows.length;
|
||||
}
|
||||
|
||||
static async isParentOf(user_id, child_id) {
|
||||
const links =
|
||||
await Link.query().where({user_id, child_id, is_parent: true}).fetch();
|
||||
return !!links.rows.length;
|
||||
}
|
||||
|
||||
static async getChildParents(child_id) {
|
||||
const links = await Link.query().where({child_id, is_parent: true}).fetch();
|
||||
const parents = await Promise.all(links.rows.map(async l => {
|
||||
return l.user().fetch();
|
||||
}));
|
||||
return parents;
|
||||
}
|
||||
|
||||
static async getUserConnections(user_id) {
|
||||
const links = await Link.query().where({user_id}).fetch();
|
||||
const connections = await links.rows.reduce(async (_prev, link) => {
|
||||
const prev = await _prev;
|
||||
const is_parent = link.is_parent;
|
||||
const child = await link.child().fetch();
|
||||
if (is_parent) {
|
||||
const parents = await UserChildUtils.getChildParents(child.id);
|
||||
const nonSameUserParents = parents.filter(p => p.id != user_id);
|
||||
prev.children.push({
|
||||
...child.toJSON(),
|
||||
connections: [
|
||||
...await UserChildUtils.getChildConnections(child.id),
|
||||
...nonSameUserParents
|
||||
]
|
||||
})
|
||||
} else {
|
||||
prev.connections.push({
|
||||
...child.toJSON(),
|
||||
connections: [...await UserChildUtils.getChildParents(child.id)]
|
||||
})
|
||||
}
|
||||
return prev;
|
||||
}, Promise.resolve({children: [], connections: []}));
|
||||
return connections;
|
||||
}
|
||||
|
||||
static async getChildConnections(child_id) {
|
||||
const links =
|
||||
await Link.query().where({child_id, is_parent: false}).fetch();
|
||||
const connections = await Promise.all(links.rows.map(async l => {
|
||||
return l.user().fetch();
|
||||
}));
|
||||
return connections;
|
||||
}
|
||||
static async addConnection(child_id, user_id, is_parent = false) {
|
||||
const link = await Link.create({child_id, user_id, is_parent});
|
||||
const user = await link.user().fetch();
|
||||
const child = await link.child().fetch();
|
||||
return {
|
||||
user, child, is_parent
|
||||
static async isUserConnectedToChild(user_id, child_id) {
|
||||
const links = await Link.query().where({ user_id, child_id }).fetch();
|
||||
return !!links.rows.length;
|
||||
}
|
||||
|
||||
static async isParentOf(user_id, child_id) {
|
||||
const links =
|
||||
await Link.query().where({ user_id, child_id, is_parent: true }).fetch();
|
||||
return !!links.rows.length;
|
||||
}
|
||||
|
||||
static async getChildParents(child_id) {
|
||||
const links = await Link.query().where({ child_id, is_parent: true }).fetch();
|
||||
const parents = await Promise.all(links.rows.map(async l => {
|
||||
return l.user().fetch();
|
||||
}));
|
||||
return parents;
|
||||
}
|
||||
|
||||
static async getUserConnections(user_id) {
|
||||
const links = await Link.query().where({ user_id }).fetch();
|
||||
const connections = await links.rows.reduce(async(_prev, link) => {
|
||||
const prev = await _prev;
|
||||
const is_parent = link.is_parent;
|
||||
const child = await link.child().fetch();
|
||||
if (is_parent) {
|
||||
const parents = await UserChildUtils.getChildParents(child.id);
|
||||
const nonSameUserParents = parents.filter(p => p.id != user_id);
|
||||
prev.children.push({
|
||||
...child.toJSON(),
|
||||
connections: [
|
||||
...await UserChildUtils.getChildConnections(child.id),
|
||||
...nonSameUserParents
|
||||
]
|
||||
})
|
||||
} else {
|
||||
prev.connections.push({
|
||||
...child.toJSON(),
|
||||
connections: [...await UserChildUtils.getChildParents(child.id)]
|
||||
})
|
||||
}
|
||||
return prev;
|
||||
}, Promise.resolve({ children: [], connections: [] }));
|
||||
return connections;
|
||||
}
|
||||
|
||||
static async getChildConnections(child_id) {
|
||||
const links =
|
||||
await Link.query().where({ child_id, is_parent: false }).fetch();
|
||||
const connections = await Promise.all(links.rows.map(async l => {
|
||||
return l.user().fetch();
|
||||
}));
|
||||
return connections;
|
||||
}
|
||||
static async addConnection(child_id, user_id, is_parent = false) {
|
||||
const link = await Link.create({ child_id, user_id, is_parent });
|
||||
const user = await link.user().fetch();
|
||||
const child = await link.child().fetch();
|
||||
return {
|
||||
user,
|
||||
child,
|
||||
is_parent
|
||||
}
|
||||
}
|
||||
|
||||
static async deleteChild(child_id) {
|
||||
const child = await Child.find(child_id)
|
||||
const childLinks = await child.links().fetch();
|
||||
|
||||
const promises = [...childLinks.rows.map(l => (l.delete())), child.delete()];
|
||||
return await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UserChildUtils;
|
25
app/Utils/UserUtils.js
Normal file
25
app/Utils/UserUtils.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
const User = use('App/Models/User');
|
||||
const UserChildUtils = use('App/Utils/UserChildUtils');
|
||||
|
||||
class UserUtils {
|
||||
|
||||
static async deleteUser(user_id) {
|
||||
const user = await User.find(user_id)
|
||||
let userLinks = await user.links().fetch();
|
||||
|
||||
//my links
|
||||
const links = userLinks.rows;
|
||||
|
||||
//children and children links
|
||||
const childrenLinks = links.filter(l => l.is_parent)
|
||||
|
||||
for (const link of childrenLinks) {
|
||||
await UserChildUtils.deleteChild(link.child_id)
|
||||
}
|
||||
|
||||
const promises = [...links.map(l => (l.delete())), user.delete()];
|
||||
return await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = UserUtils;
|
238
config/shield.js
238
config/shield.js
|
@ -1,140 +1,140 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Content Security Policy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Content security policy filters out the origins not allowed to execute
|
||||
| and load resources like scripts, styles and fonts. There are wide
|
||||
| variety of options to choose from.
|
||||
*/
|
||||
csp: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Directives
|
||||
| Content Security Policy
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All directives are defined in camelCase and here is the list of
|
||||
| available directives and their possible values.
|
||||
|
|
||||
| https://content-security-policy.com
|
||||
|
|
||||
| @example
|
||||
| directives: {
|
||||
| defaultSrc: ['self', '@nonce', 'cdnjs.cloudflare.com']
|
||||
| }
|
||||
|
|
||||
| Content security policy filters out the origins not allowed to execute
|
||||
| and load resources like scripts, styles and fonts. There are wide
|
||||
| variety of options to choose from.
|
||||
*/
|
||||
directives: {},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Report only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting `reportOnly=true` will not block the scripts from running and
|
||||
| instead report them to a URL.
|
||||
|
|
||||
*/
|
||||
reportOnly: false,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Set all headers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Headers staring with `X` have been depreciated, since all major browsers
|
||||
| supports the standard CSP header. So its better to disable deperciated
|
||||
| headers, unless you want them to be set.
|
||||
|
|
||||
*/
|
||||
setAllHeaders: false,
|
||||
csp: {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Directives
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All directives are defined in camelCase and here is the list of
|
||||
| available directives and their possible values.
|
||||
|
|
||||
| https://content-security-policy.com
|
||||
|
|
||||
| @example
|
||||
| directives: {
|
||||
| defaultSrc: ['self', '@nonce', 'cdnjs.cloudflare.com']
|
||||
| }
|
||||
|
|
||||
*/
|
||||
directives: {},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Report only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting `reportOnly=true` will not block the scripts from running and
|
||||
| instead report them to a URL.
|
||||
|
|
||||
*/
|
||||
reportOnly: false,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Set all headers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Headers staring with `X` have been depreciated, since all major browsers
|
||||
| supports the standard CSP header. So its better to disable deperciated
|
||||
| headers, unless you want them to be set.
|
||||
|
|
||||
*/
|
||||
setAllHeaders: false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Disable on android
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Certain versions of android are buggy with CSP policy. So you can set
|
||||
| this value to true, to disable it for Android versions with buggy
|
||||
| behavior.
|
||||
|
|
||||
| Here is an issue reported on a different package, but helpful to read
|
||||
| if you want to know the behavior.
|
||||
https://github.com/helmetjs/helmet/pull/82
|
||||
|
|
||||
*/
|
||||
disableAndroid: true
|
||||
},
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Disable on android
|
||||
| X-XSS-Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Certain versions of android are buggy with CSP policy. So you can set
|
||||
| this value to true, to disable it for Android versions with buggy
|
||||
| behavior.
|
||||
| X-XSS Protection saves applications from XSS attacks. It is adopted
|
||||
| by IE and later followed by some other browsers.
|
||||
|
|
||||
| Here is an issue reported on a different package, but helpful to read
|
||||
| if you want to know the behavior.
|
||||
https://github.com/helmetjs/helmet/pull/82
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
|
||||
|
|
||||
*/
|
||||
disableAndroid: true
|
||||
},
|
||||
xss: { enabled: true, enableOnOldIE: false },
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| X-XSS-Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| X-XSS Protection saves applications from XSS attacks. It is adopted
|
||||
| by IE and later followed by some other browsers.
|
||||
|
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
|
||||
|
|
||||
*/
|
||||
xss: {enabled: true, enableOnOldIE: false},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Iframe Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| xframe defines whether or not your website can be embedded inside an
|
||||
| iframe. Choose from one of the following options.
|
||||
| @available options
|
||||
| DENY, SAMEORIGIN, ALLOW-FROM http://example.com
|
||||
|
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
*/
|
||||
xframe: 'DENY',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Iframe Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| xframe defines whether or not your website can be embedded inside an
|
||||
| iframe. Choose from one of the following options.
|
||||
| @available options
|
||||
| DENY, SAMEORIGIN, ALLOW-FROM http://example.com
|
||||
|
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
*/
|
||||
xframe: 'DENY',
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Sniff
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Browsers have a habit of sniffing content-type of a response. Which means
|
||||
| files with .txt extension containing Javascript code will be executed as
|
||||
| Javascript. You can disable this behavior by setting nosniff to false.
|
||||
|
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
|
|
||||
*/
|
||||
nosniff: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Sniff
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Browsers have a habit of sniffing content-type of a response. Which means
|
||||
| files with .txt extension containing Javascript code will be executed as
|
||||
| Javascript. You can disable this behavior by setting nosniff to false.
|
||||
|
|
||||
| Learn more at
|
||||
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
|
|
||||
*/
|
||||
nosniff: true,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Open
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| IE users can execute webpages in the context of your website, which is
|
||||
| a serious security risk. Below option will manage this for you.
|
||||
|
|
||||
*/
|
||||
noopen: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| No Open
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| IE users can execute webpages in the context of your website, which is
|
||||
| a serious security risk. Below option will manage this for you.
|
||||
|
|
||||
*/
|
||||
noopen: true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSRF Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| CSRF Protection adds another layer of security by making sure, actionable
|
||||
| routes does have a valid token to execute an action.
|
||||
|
|
||||
*/
|
||||
csrf: {
|
||||
enable: true,
|
||||
methods: ['POST', 'PUT', 'DELETE'],
|
||||
filterUris: [/api\/v1\/client\/\w+/], // All Client API routes
|
||||
cookieOptions: {httpOnly: false, sameSite: true, path: '/', maxAge: 7200}
|
||||
}
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| CSRF Protection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| CSRF Protection adds another layer of security by making sure, actionable
|
||||
| routes does have a valid token to execute an action.
|
||||
|
|
||||
*/
|
||||
csrf: {
|
||||
enable: true,
|
||||
methods: ['POST', 'PUT', 'DELETE'],
|
||||
filterUris: [/api\/v1\/client\/\w+/, /api\/v1\/admin\/\w+/], // All Client API routes
|
||||
cookieOptions: { httpOnly: false, sameSite: true, path: '/', maxAge: 7200 }
|
||||
}
|
||||
}
|
314
package-lock.json
generated
314
package-lock.json
generated
|
@ -433,6 +433,32 @@
|
|||
"lodash": "^4.17.11"
|
||||
}
|
||||
},
|
||||
"@adonisjs/vow": {
|
||||
"version": "1.0.17",
|
||||
"resolved": "https://registry.npmjs.org/@adonisjs/vow/-/vow-1.0.17.tgz",
|
||||
"integrity": "sha512-fj5LO0w8VuQeKTdUPQ1+F0Z+GLwJ8qFwEN8GIxER0bg8Q0d8qOBsFulwozAyYMVf8xklKvzJgFeXFkexNJYaOA==",
|
||||
"requires": {
|
||||
"chai-subset": "^1.6.0",
|
||||
"debug": "^4.0.1",
|
||||
"globby": "^8.0.1",
|
||||
"japa": "1.0.6",
|
||||
"lodash": "^4.17.11",
|
||||
"macroable": "^1.0.0",
|
||||
"node-cookie": "^2.1.1",
|
||||
"p-series": "^1.1.0",
|
||||
"superagent": "^4.0.0-beta.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@adonisjs/websocket": {
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@adonisjs/websocket/-/websocket-1.0.12.tgz",
|
||||
|
@ -764,6 +790,20 @@
|
|||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@mrmlnc/readdir-enhanced": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
|
||||
"integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==",
|
||||
"requires": {
|
||||
"call-me-maybe": "^1.0.1",
|
||||
"glob-to-regexp": "^0.3.0"
|
||||
}
|
||||
},
|
||||
"@nodelib/fs.stat": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz",
|
||||
"integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw=="
|
||||
},
|
||||
"@sindresorhus/is": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
|
||||
|
@ -1450,6 +1490,14 @@
|
|||
"resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
|
||||
"integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w=="
|
||||
},
|
||||
"array-union": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
|
||||
"integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
|
||||
"requires": {
|
||||
"array-uniq": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"array-uniq": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz",
|
||||
|
@ -1460,6 +1508,11 @@
|
|||
"resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
|
||||
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="
|
||||
},
|
||||
"arrify": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
|
||||
"integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0="
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.4",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
|
||||
|
@ -1521,6 +1574,11 @@
|
|||
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
|
||||
"dev": true
|
||||
},
|
||||
"assertion-error": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
||||
"integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw=="
|
||||
},
|
||||
"assign-symbols": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
|
||||
|
@ -2710,6 +2768,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"call-me-maybe": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz",
|
||||
"integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms="
|
||||
},
|
||||
"caller": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/caller/-/caller-1.0.1.tgz",
|
||||
|
@ -2774,6 +2837,24 @@
|
|||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
|
||||
"dev": true
|
||||
},
|
||||
"chai": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
|
||||
"integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
|
||||
"requires": {
|
||||
"assertion-error": "^1.1.0",
|
||||
"check-error": "^1.0.2",
|
||||
"deep-eql": "^3.0.1",
|
||||
"get-func-name": "^2.0.0",
|
||||
"pathval": "^1.1.0",
|
||||
"type-detect": "^4.0.5"
|
||||
}
|
||||
},
|
||||
"chai-subset": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/chai-subset/-/chai-subset-1.6.0.tgz",
|
||||
"integrity": "sha1-pdDKFOMpp5WW7XAFi2ZGvWmIz+k="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
|
@ -2789,6 +2870,11 @@
|
|||
"resolved": "https://registry.npmjs.org/chance/-/chance-1.1.5.tgz",
|
||||
"integrity": "sha512-uBVETzUktMGLALWQ8fCJCOjNF4Gm1lRjjjuC2+z7rCjx78ioONIK7bYhGzBovhQyqOegJEl3nAJxjE7mvY6aIw=="
|
||||
},
|
||||
"check-error": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
|
||||
"integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII="
|
||||
},
|
||||
"choices-separator": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/choices-separator/-/choices-separator-2.0.0.tgz",
|
||||
|
@ -3249,6 +3335,11 @@
|
|||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.1.0.tgz",
|
||||
"integrity": "sha512-Alvs19Vgq07eunykd3Xy2jF0/qSNv2u7KDbAek9H5liV1UMijbqFs5cycZvv5dVsvseT/U4H8/7/w8Koh35C4A=="
|
||||
},
|
||||
"cookiejar": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz",
|
||||
"integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA=="
|
||||
},
|
||||
"copy-concurrently": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
|
||||
|
@ -3497,6 +3588,14 @@
|
|||
"mimic-response": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"deep-eql": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
|
||||
"integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
|
||||
"requires": {
|
||||
"type-detect": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"deep-extend": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
|
||||
|
@ -3584,6 +3683,30 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"dir-glob": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz",
|
||||
"integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==",
|
||||
"requires": {
|
||||
"arrify": "^1.0.1",
|
||||
"path-type": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"path-type": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
|
||||
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
|
||||
"requires": {
|
||||
"pify": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
||||
}
|
||||
}
|
||||
},
|
||||
"domain-browser": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
|
||||
|
@ -4004,6 +4127,19 @@
|
|||
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
|
||||
"dev": true
|
||||
},
|
||||
"fast-glob": {
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
|
||||
"integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==",
|
||||
"requires": {
|
||||
"@mrmlnc/readdir-enhanced": "^2.2.1",
|
||||
"@nodelib/fs.stat": "^1.1.2",
|
||||
"glob-parent": "^3.1.0",
|
||||
"is-glob": "^4.0.0",
|
||||
"merge2": "^1.2.3",
|
||||
"micromatch": "^3.1.10"
|
||||
}
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
|
@ -4154,6 +4290,11 @@
|
|||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"formidable": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz",
|
||||
"integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q=="
|
||||
},
|
||||
"forwarded": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
||||
|
@ -4294,6 +4435,11 @@
|
|||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"get-func-name": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
|
||||
"integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE="
|
||||
},
|
||||
"get-stdin": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
|
||||
|
@ -4354,6 +4500,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"glob-to-regexp": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz",
|
||||
"integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs="
|
||||
},
|
||||
"global-dirs": {
|
||||
"version": "0.1.1",
|
||||
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
|
||||
|
@ -4388,6 +4539,27 @@
|
|||
"integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
|
||||
"dev": true
|
||||
},
|
||||
"globby": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz",
|
||||
"integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==",
|
||||
"requires": {
|
||||
"array-union": "^1.0.1",
|
||||
"dir-glob": "2.0.0",
|
||||
"fast-glob": "^2.0.2",
|
||||
"glob": "^7.1.2",
|
||||
"ignore": "^3.3.5",
|
||||
"pify": "^3.0.0",
|
||||
"slash": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"pify": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
|
||||
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
|
||||
}
|
||||
}
|
||||
},
|
||||
"globule": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/globule/-/globule-1.3.1.tgz",
|
||||
|
@ -4458,7 +4630,6 @@
|
|||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
||||
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
|
@ -4654,6 +4825,11 @@
|
|||
"integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=",
|
||||
"dev": true
|
||||
},
|
||||
"ignore": {
|
||||
"version": "3.3.10",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
|
||||
"integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug=="
|
||||
},
|
||||
"ignore-by-default": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz",
|
||||
|
@ -5063,6 +5239,19 @@
|
|||
"is-object": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"japa": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/japa/-/japa-1.0.6.tgz",
|
||||
"integrity": "sha512-WDc1/hdlTr2Sb37AZEAKvg9Hs8x2LermeqkQHtLVYn1MRnu8QPjywX/rCSda7xn6w9MScKQeQ8xKfXrDsE3cMQ==",
|
||||
"requires": {
|
||||
"chai": "^4.1.2",
|
||||
"chalk": "^2.3.0",
|
||||
"ms": "^2.1.1",
|
||||
"retry": "^0.10.1",
|
||||
"right-pad": "^1.0.1",
|
||||
"variable-diff": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"js-base64": {
|
||||
"version": "2.5.2",
|
||||
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz",
|
||||
|
@ -5743,6 +5932,16 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"merge2": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz",
|
||||
"integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw=="
|
||||
},
|
||||
"methods": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
||||
},
|
||||
"micromatch": {
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
|
||||
|
@ -6661,6 +6860,20 @@
|
|||
"p-limit": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"p-reduce": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz",
|
||||
"integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo="
|
||||
},
|
||||
"p-series": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-series/-/p-series-1.1.0.tgz",
|
||||
"integrity": "sha512-356covArc9UCfj2twY/sxCJKGMzzO+pJJtucizsPC6aS1xKSTBc9PQrQhvFR3+7F+fa2KBKdJjdIcv6NEWDcIQ==",
|
||||
"requires": {
|
||||
"@sindresorhus/is": "^0.7.0",
|
||||
"p-reduce": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"p-timeout": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz",
|
||||
|
@ -6825,6 +7038,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"pathval": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
|
||||
"integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA="
|
||||
},
|
||||
"pbkdf2": {
|
||||
"version": "3.0.17",
|
||||
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz",
|
||||
|
@ -8013,6 +8231,16 @@
|
|||
"resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
|
||||
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg=="
|
||||
},
|
||||
"retry": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz",
|
||||
"integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q="
|
||||
},
|
||||
"right-pad": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/right-pad/-/right-pad-1.0.1.tgz",
|
||||
"integrity": "sha1-jKCMLLtbVedNr6lr9/0aJ9VoyNA="
|
||||
},
|
||||
"rimraf": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz",
|
||||
|
@ -8334,6 +8562,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"slash": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz",
|
||||
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU="
|
||||
},
|
||||
"snapdragon": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
|
||||
|
@ -8808,6 +9041,47 @@
|
|||
"resolved": "https://registry.npmjs.org/success-symbol/-/success-symbol-0.1.0.tgz",
|
||||
"integrity": "sha1-JAIuSG878c3KCUKDt2nEctO3KJc="
|
||||
},
|
||||
"superagent": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-4.1.0.tgz",
|
||||
"integrity": "sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==",
|
||||
"requires": {
|
||||
"component-emitter": "^1.2.0",
|
||||
"cookiejar": "^2.1.2",
|
||||
"debug": "^4.1.0",
|
||||
"form-data": "^2.3.3",
|
||||
"formidable": "^1.2.0",
|
||||
"methods": "^1.1.1",
|
||||
"mime": "^2.4.0",
|
||||
"qs": "^6.6.0",
|
||||
"readable-stream": "^3.0.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.4.5",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz",
|
||||
"integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
|
@ -9249,6 +9523,11 @@
|
|||
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
|
||||
"dev": true
|
||||
},
|
||||
"type-detect": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
|
||||
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="
|
||||
},
|
||||
"type-is": {
|
||||
"version": "1.6.18",
|
||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
||||
|
@ -9542,6 +9821,39 @@
|
|||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"variable-diff": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/variable-diff/-/variable-diff-1.1.0.tgz",
|
||||
"integrity": "sha1-0r1cZtt2wTh52W5qMG7cmJ35eNo=",
|
||||
"requires": {
|
||||
"chalk": "^1.1.1",
|
||||
"object-assign": "^4.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
|
||||
},
|
||||
"chalk": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||
"requires": {
|
||||
"ansi-styles": "^2.2.1",
|
||||
"escape-string-regexp": "^1.0.2",
|
||||
"has-ansi": "^2.0.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"supports-color": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||
}
|
||||
}
|
||||
},
|
||||
"vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
|
152
package.json
152
package.json
|
@ -1,77 +1,79 @@
|
|||
{
|
||||
"name": "Seepur",
|
||||
"version": "0.0.1",
|
||||
"adonis-version": "4.1.0",
|
||||
"description": "A shared story time experience",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"build:css": "npx node-sass --omit-source-map-url resources/sass/main.scss public/style.css",
|
||||
"build:applications": "npx webpack --mode production",
|
||||
"watch:css": "npm run build:css -- --watch",
|
||||
"watch:applications": "npx webpack --watch",
|
||||
"migrate": "npx adonis migration:run -f",
|
||||
"build": "npm run migrate && npm run build:css && npm run build:applications",
|
||||
"start": "npm run migrate && node server.js",
|
||||
"clean": "bash clean-hot-update.sh",
|
||||
"test": "node ace test"
|
||||
},
|
||||
"keywords": [
|
||||
"seepur"
|
||||
],
|
||||
"author": "",
|
||||
"license": "UNLICENSED",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@adonisjs/ace": "^5.0.8",
|
||||
"@adonisjs/auth": "^3.0.7",
|
||||
"@adonisjs/bodyparser": "^2.0.5",
|
||||
"@adonisjs/cli": "^4.0.12",
|
||||
"@adonisjs/cors": "^1.0.7",
|
||||
"@adonisjs/drive": "^1.0.4",
|
||||
"@adonisjs/fold": "^4.0.9",
|
||||
"@adonisjs/framework": "^5.0.9",
|
||||
"@adonisjs/ignitor": "^2.0.8",
|
||||
"@adonisjs/lucid": "^6.1.3",
|
||||
"@adonisjs/mail": "^3.0.10",
|
||||
"@adonisjs/redis": "^2.0.7",
|
||||
"@adonisjs/session": "^1.0.27",
|
||||
"@adonisjs/shield": "^1.0.8",
|
||||
"@adonisjs/validator": "^5.0.6",
|
||||
"@adonisjs/websocket": "^1.0.12",
|
||||
"@adonisjs/websocket-client": "^1.0.9",
|
||||
"adonis-vue-websocket": "^2.0.2",
|
||||
"animate.css": "^4.1.0",
|
||||
"bulma": "^0.8.0",
|
||||
"fork-awesome": "^1.1.7",
|
||||
"moment": "^2.24.0",
|
||||
"regenerator-runtime": "^0.13.5",
|
||||
"rematrix": "^0.7.0",
|
||||
"sqlite3": "^4.1.1",
|
||||
"typescript": "^3.7.5",
|
||||
"uuid": "^8.0.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-croppa": "^1.3.8",
|
||||
"vue-router": "^3.1.5",
|
||||
"vuex": "^3.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.3",
|
||||
"@babel/plugin-transform-regenerator": "^7.8.7",
|
||||
"@babel/plugin-transform-runtime": "^7.9.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"css-loader": "^3.4.2",
|
||||
"node-sass": "^4.13.0",
|
||||
"ts-loader": "^7.0.4",
|
||||
"vue-loader": "^15.8.3",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.41.5",
|
||||
"webpack-cli": "^3.3.10"
|
||||
},
|
||||
"autoload": {
|
||||
"App": "./app"
|
||||
}
|
||||
"name": "Seepur",
|
||||
"version": "0.0.1",
|
||||
"adonis-version": "4.1.0",
|
||||
"description": "A shared story time experience",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
"build:css": "npx node-sass --omit-source-map-url resources/sass/main.scss public/style.css",
|
||||
"build:applications": "npx webpack --mode production",
|
||||
"watch:css": "npm run build:css -- --watch",
|
||||
"watch:applications": "npx webpack --watch",
|
||||
"migrate": "npx adonis migration:run -f",
|
||||
"build": "npm run migrate && npm run build:css && npm run build:applications",
|
||||
"start": "npm run migrate && node server.js",
|
||||
"start:dev": "npx adonis serve --dev",
|
||||
"clean": "bash clean-hot-update.sh",
|
||||
"test": "node ace test"
|
||||
},
|
||||
"keywords": [
|
||||
"seepur"
|
||||
],
|
||||
"author": "",
|
||||
"license": "UNLICENSED",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@adonisjs/ace": "^5.0.8",
|
||||
"@adonisjs/auth": "^3.0.7",
|
||||
"@adonisjs/bodyparser": "^2.0.5",
|
||||
"@adonisjs/cli": "^4.0.12",
|
||||
"@adonisjs/cors": "^1.0.7",
|
||||
"@adonisjs/drive": "^1.0.4",
|
||||
"@adonisjs/fold": "^4.0.9",
|
||||
"@adonisjs/framework": "^5.0.9",
|
||||
"@adonisjs/ignitor": "^2.0.8",
|
||||
"@adonisjs/lucid": "^6.1.3",
|
||||
"@adonisjs/mail": "^3.0.10",
|
||||
"@adonisjs/redis": "^2.0.7",
|
||||
"@adonisjs/session": "^1.0.27",
|
||||
"@adonisjs/shield": "^1.0.8",
|
||||
"@adonisjs/validator": "^5.0.6",
|
||||
"@adonisjs/vow": "^1.0.17",
|
||||
"@adonisjs/websocket": "^1.0.12",
|
||||
"@adonisjs/websocket-client": "^1.0.9",
|
||||
"adonis-vue-websocket": "^2.0.2",
|
||||
"animate.css": "^4.1.0",
|
||||
"bulma": "^0.8.0",
|
||||
"fork-awesome": "^1.1.7",
|
||||
"moment": "^2.24.0",
|
||||
"regenerator-runtime": "^0.13.5",
|
||||
"rematrix": "^0.7.0",
|
||||
"sqlite3": "^4.1.1",
|
||||
"typescript": "^3.7.5",
|
||||
"uuid": "^8.0.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-croppa": "^1.3.8",
|
||||
"vue-router": "^3.1.5",
|
||||
"vuex": "^3.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.8.3",
|
||||
"@babel/plugin-transform-regenerator": "^7.8.7",
|
||||
"@babel/plugin-transform-runtime": "^7.9.0",
|
||||
"@types/node": "^14.0.1",
|
||||
"babel-loader": "^8.0.6",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-preset-stage-2": "^6.24.1",
|
||||
"css-loader": "^3.4.2",
|
||||
"node-sass": "^4.13.0",
|
||||
"ts-loader": "^7.0.4",
|
||||
"vue-loader": "^15.8.3",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack": "^4.41.5",
|
||||
"webpack-cli": "^3.3.10"
|
||||
},
|
||||
"autoload": {
|
||||
"App": "./app"
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -3,6 +3,9 @@
|
|||
<Modal title="CreateUser" :isActive="showCreateUser" @close="showCreateUser=false" acceptText="Create" @accept="createUser()">
|
||||
test
|
||||
</Modal>
|
||||
<Modal title="DeleteUser" :isActive="showDeleteUser" @close="showDeleteUser=false; currentUser=null" acceptText="Delete" rejectText="Cancel" @accept="deleteUser(currentUser)">
|
||||
Are you sure you want to delete {{currentUser !== null ? currentUser.name: ''}}?
|
||||
</Modal>
|
||||
<nav class="level">
|
||||
<div class="level-left">
|
||||
<div class="level-item">
|
||||
|
@ -35,6 +38,7 @@
|
|||
<th>name</th>
|
||||
<th>email</th>
|
||||
<th>admin</th>
|
||||
<th>edit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="user in users" :key="user.id">
|
||||
|
@ -49,13 +53,16 @@
|
|||
<td>
|
||||
<input class="checkbox" type="checkbox" :checked="user.is_admin" />
|
||||
</td>
|
||||
<td>
|
||||
<button v-if="!user.is_admin" class="button" @click="onDeleteClicked(user)">Delete</button>
|
||||
<button v-if="!user.is_admin" class="button" @click="onEditClicked(user)">Edit</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import ChildAvatar, { IChildAvatar } from "../components/child_avatar.vue";
|
||||
import Services from "../../services/index";
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
import Modal from "../../shared/components/Modal/Modal.vue";
|
||||
|
@ -63,22 +70,32 @@ import Modal from "../../shared/components/Modal/Modal.vue";
|
|||
export default {
|
||||
name: "Home",
|
||||
components: {
|
||||
ChildAvatar,
|
||||
Modal
|
||||
},
|
||||
methods: {
|
||||
createUser(){
|
||||
alert('created');
|
||||
},
|
||||
async deleteUser(user){
|
||||
console.log(user)
|
||||
await Services.ApiService.deleteUser(user);
|
||||
this.showDeleteUser=false;
|
||||
await this.getUsers()
|
||||
},
|
||||
onDeleteClicked(user){
|
||||
this.showDeleteUser = true;
|
||||
this.currentUser = user;
|
||||
},
|
||||
onEditClicked(user){
|
||||
// //this.showEditUser = true;
|
||||
// //this.currentUser = user;
|
||||
},
|
||||
...mapActions(["getUsers"])
|
||||
},
|
||||
async created() {
|
||||
this.loading = true;
|
||||
if (this.users === null) await this.getUsers();
|
||||
this.loading = false;
|
||||
// this.connections = await Services.ApiService.getConnections();
|
||||
// this.users = await Services.ApiService.getAllUsers();
|
||||
// console.dir(connections);
|
||||
},
|
||||
computed: {
|
||||
// async users() {
|
||||
|
@ -89,6 +106,8 @@ export default {
|
|||
return {
|
||||
loading: true,
|
||||
showCreateUser: false,
|
||||
showDeleteUser: false,
|
||||
currentUser: null,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
export default class ApiService {
|
||||
|
||||
static async deleteUser(user: any) {
|
||||
try{
|
||||
return (await fetch(`/api/v1/admin/user/${user.id}`, {method: 'DELETE'})).json();
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`deleteUser ERROR: ${e.message}`);
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
static async getUser(userId?: number) {
|
||||
try {
|
||||
return (await fetch('/api/v1/client/user/')).json();
|
||||
|
|
88
start/app.js
88
start/app.js
|
@ -10,47 +10,49 @@
|
|||
| provider here.
|
||||
|
|
||||
*/
|
||||
const providers =
|
||||
[
|
||||
'@adonisjs/framework/providers/AppProvider',
|
||||
'@adonisjs/framework/providers/ViewProvider',
|
||||
'@adonisjs/lucid/providers/LucidProvider',
|
||||
'@adonisjs/bodyparser/providers/BodyParserProvider',
|
||||
'@adonisjs/cors/providers/CorsProvider',
|
||||
'@adonisjs/shield/providers/ShieldProvider',
|
||||
'@adonisjs/session/providers/SessionProvider',
|
||||
'@adonisjs/auth/providers/AuthProvider',
|
||||
'@adonisjs/validator/providers/ValidatorProvider',
|
||||
'@adonisjs/drive/providers/DriveProvider',
|
||||
'@adonisjs/websocket/providers/WsProvider',
|
||||
'@adonisjs/mail/providers/MailProvider',
|
||||
'@adonisjs/redis/providers/RedisProvider',
|
||||
]
|
||||
const providers = [
|
||||
'@adonisjs/framework/providers/AppProvider',
|
||||
'@adonisjs/framework/providers/ViewProvider',
|
||||
'@adonisjs/lucid/providers/LucidProvider',
|
||||
'@adonisjs/bodyparser/providers/BodyParserProvider',
|
||||
'@adonisjs/cors/providers/CorsProvider',
|
||||
'@adonisjs/shield/providers/ShieldProvider',
|
||||
'@adonisjs/session/providers/SessionProvider',
|
||||
'@adonisjs/auth/providers/AuthProvider',
|
||||
'@adonisjs/validator/providers/ValidatorProvider',
|
||||
'@adonisjs/drive/providers/DriveProvider',
|
||||
'@adonisjs/websocket/providers/WsProvider',
|
||||
'@adonisjs/mail/providers/MailProvider',
|
||||
'@adonisjs/redis/providers/RedisProvider',
|
||||
]
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ace Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ace providers are required only when running ace commands. For example
|
||||
| Providers for migrations, tests etc.
|
||||
|
|
||||
*/
|
||||
const aceProviders = ['@adonisjs/lucid/providers/MigrationsProvider']
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ace Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Ace providers are required only when running ace commands. For example
|
||||
| Providers for migrations, tests etc.
|
||||
|
|
||||
*/
|
||||
const aceProviders = [
|
||||
'@adonisjs/lucid/providers/MigrationsProvider',
|
||||
'@adonisjs/vow/providers/VowProvider'
|
||||
]
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Aliases are short unique names for IoC container bindings. You are free
|
||||
| to create your own aliases.
|
||||
|
|
||||
| For example:
|
||||
| { Route: 'Adonis/Src/Route' }
|
||||
|
|
||||
*/
|
||||
const aliases = {}
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Aliases are short unique names for IoC container bindings. You are free
|
||||
| to create your own aliases.
|
||||
|
|
||||
| For example:
|
||||
| { Route: 'Adonis/Src/Route' }
|
||||
|
|
||||
*/
|
||||
const aliases = {}
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -63,8 +65,8 @@ const providers =
|
|||
const commands = []
|
||||
|
||||
module.exports = {
|
||||
providers,
|
||||
aceProviders,
|
||||
aliases,
|
||||
commands
|
||||
providers,
|
||||
aceProviders,
|
||||
aliases,
|
||||
commands
|
||||
}
|
|
@ -28,13 +28,13 @@ Route.post('/login', 'AuthController.login').validator('Login');
|
|||
|
||||
// reset-password
|
||||
Route.post('/password/request/reset', 'AuthController.resetPasswordRequest')
|
||||
.validator('ResetPasswordRequest')
|
||||
.as('resetPasswordRequest');
|
||||
.validator('ResetPasswordRequest')
|
||||
.as('resetPasswordRequest');
|
||||
Route.get('/password/reset', 'AuthController.resetPasswordRequestIndex');
|
||||
Route.get('/password/reset/:token', 'AuthController.resetPasswordIndex');
|
||||
Route.post('/password/reset', 'AuthController.resetPassword')
|
||||
.validator('ResetPassword')
|
||||
.as('resetPassword');
|
||||
.validator('ResetPassword')
|
||||
.as('resetPassword');
|
||||
|
||||
/*
|
||||
/ Client API
|
||||
|
@ -42,12 +42,12 @@ Route.post('/password/reset', 'AuthController.resetPassword')
|
|||
|
||||
Route
|
||||
.group(() => {
|
||||
Route.post('connections/create', 'ClientApiController.createConnection');
|
||||
Route.get('user', 'ClientApiController.getUser');
|
||||
Route.post('child', 'ClientApiController.createChild');
|
||||
Route.get('child/:id', 'ClientApiController.getChild');
|
||||
Route.post('child/:id', 'ClientApiController.updateChild');
|
||||
Route.post('call/create', 'ClientApiController.createCall');
|
||||
Route.post('connections/create', 'ClientApiController.createConnection');
|
||||
Route.get('user', 'ClientApiController.getUser');
|
||||
Route.post('child', 'ClientApiController.createChild');
|
||||
Route.get('child/:id', 'ClientApiController.getChild');
|
||||
Route.post('child/:id', 'ClientApiController.updateChild');
|
||||
Route.post('call/create', 'ClientApiController.createCall');
|
||||
})
|
||||
.prefix('api/v1/client')
|
||||
.middleware(['auth']);
|
||||
|
@ -65,9 +65,9 @@ Route
|
|||
*/
|
||||
Route.get('/u/books/:bookId/thumbnail', 'BookApiController.getThumbnail')
|
||||
.middleware(['auth', 'BookContext'])
|
||||
/*
|
||||
/ Pubic CDN Images
|
||||
*/
|
||||
/*
|
||||
/ Pubic CDN Images
|
||||
*/
|
||||
Route.get('/u/images/:fileName', 'CdnController.publicImages');
|
||||
|
||||
/*
|
||||
|
@ -76,16 +76,17 @@ Route.get('/u/images/:fileName', 'CdnController.publicImages');
|
|||
// API
|
||||
Route
|
||||
.group(() => {
|
||||
Route.get('users', 'AdminApiController.getUsers');
|
||||
Route.get(
|
||||
'settings/email/test/result', 'AdminApiController.testEmailSettings');
|
||||
Route.get('users', 'AdminApiController.getUsers');
|
||||
Route.delete('user/:id', 'AdminApiController.deleteUser');
|
||||
Route.get(
|
||||
'settings/email/test/result', 'AdminApiController.testEmailSettings');
|
||||
})
|
||||
.prefix('/api/v1/admin')
|
||||
.middleware(['auth', 'adminAuth']);
|
||||
Route
|
||||
.group(() => {
|
||||
//
|
||||
Route.get('/*', 'AdminController.index');
|
||||
//
|
||||
Route.get('/*', 'AdminController.index');
|
||||
})
|
||||
.prefix('admin')
|
||||
.middleware(['auth', 'adminAuth']);
|
||||
|
|
26
test/functional/example.spec.js
Normal file
26
test/functional/example.spec.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
'use strict'
|
||||
|
||||
const { test } = use('Test/Suite')('Users')
|
||||
const Child = use('App/Models/Child');
|
||||
const User = use('App/Models/User');
|
||||
const UserUtils = use('App/Utils/UserUtils');
|
||||
|
||||
test('User is deleted', async({ assert }) => {
|
||||
|
||||
const user = await User.create({
|
||||
email: 'test@mail.com',
|
||||
name: 'test',
|
||||
password: 'password',
|
||||
avatar: `/images/default-user-avatar.png`,
|
||||
is_admin: false
|
||||
});
|
||||
await user.save();
|
||||
|
||||
const newUser = await User.query().where({ name: 'test' }).fetch();
|
||||
assert.equal(newUser.rows.length, 1)
|
||||
|
||||
await UserUtils.deleteUser(newUser.rows[0].id)
|
||||
|
||||
const usersAfterDel = await User.query().where({ name: 'test' }).fetch();
|
||||
assert.equal(usersAfterDel.rows.length, 0)
|
||||
})
|
7
test/unit/example.spec.js
Normal file
7
test/unit/example.spec.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { test } = use('Test/Suite')('Example')
|
||||
|
||||
test('make sure 2 + 2 is 4', async ({ assert }) => {
|
||||
assert.equal(2 + 2, 4)
|
||||
})
|
62
vowfile.js
Normal file
62
vowfile.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
'use strict'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Vow file
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The vow file is loaded before running your tests. This is the best place
|
||||
| to hook operations `before` and `after` running the tests.
|
||||
|
|
||||
*/
|
||||
|
||||
// Uncomment when want to run migrations
|
||||
// const ace = require('@adonisjs/ace')
|
||||
|
||||
module.exports = (cli, runner) => {
|
||||
runner.before(async () => {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Start the server
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Starts the http server before running the tests. You can comment this
|
||||
| line, if http server is not required
|
||||
|
|
||||
*/
|
||||
use('Adonis/Src/Server').listen(process.env.HOST, process.env.PORT)
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run migrations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Migrate the database before starting the tests.
|
||||
|
|
||||
*/
|
||||
// await ace.call('migration:run', {}, { silent: true })
|
||||
})
|
||||
|
||||
runner.after(async () => {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown server
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Shutdown the HTTP server when all tests have been executed.
|
||||
|
|
||||
*/
|
||||
use('Adonis/Src/Server').getInstance().close()
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Rollback migrations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once all tests have been completed, we should reset the database to it's
|
||||
| original state
|
||||
|
|
||||
*/
|
||||
// await ace.call('migration:reset', {}, { silent: true })
|
||||
})
|
||||
}
|
Reference in a new issue