expressa 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.circleci/config.yml +1 -1
  2. package/README.md +4 -3
  3. package/controllers/collections.js +53 -32
  4. package/controllers/status.js +2 -1
  5. package/db/cached.js +3 -0
  6. package/db/file.js +3 -0
  7. package/db/memory.js +3 -0
  8. package/db/mongo.js +7 -8
  9. package/db/postgres.js +13 -0
  10. package/index.js +3 -1
  11. package/listeners_validation.js +4 -0
  12. package/modules/admin/dist/index.html +1 -1
  13. package/modules/admin/dist/index.html.gz +0 -0
  14. package/modules/admin/dist/static/css/app.9dd57eea.css.gz +0 -0
  15. package/modules/admin/dist/static/css/chunk-318c.ffb0d81e.css +1 -0
  16. package/modules/admin/dist/static/css/chunk-318c.ffb0d81e.css.gz +0 -0
  17. package/modules/admin/dist/static/css/chunk-3bc2.89632b9d.css.gz +0 -0
  18. package/modules/admin/dist/static/css/chunk-5cee.ce0e4bdb.css.gz +0 -0
  19. package/modules/admin/dist/static/css/chunk-621e.97323951.css +1 -0
  20. package/modules/admin/dist/static/css/chunk-621e.97323951.css.gz +0 -0
  21. package/modules/admin/dist/static/css/{chunk-e80a.5ee55031.css → chunk-6644.69ccf1a7.css} +1 -1
  22. package/modules/admin/dist/static/css/chunk-6644.69ccf1a7.css.gz +0 -0
  23. package/modules/admin/dist/static/css/chunk-7291.13514e45.css.gz +0 -0
  24. package/modules/admin/dist/static/css/chunk-b423.5f239333.css.gz +0 -0
  25. package/modules/admin/dist/static/css/chunk-bd5f.aefa49d7.css.gz +0 -0
  26. package/modules/admin/dist/static/css/chunk-e375.1d849865.css +1 -0
  27. package/modules/admin/dist/static/css/chunk-e375.1d849865.css.gz +0 -0
  28. package/modules/admin/dist/static/css/chunk-elementUI.3d004d9f.css.gz +0 -0
  29. package/modules/admin/dist/static/css/{chunk-759b.3a895a1e.css → chunk-f075.3a895a1e.css} +0 -0
  30. package/modules/admin/dist/static/css/chunk-f075.3a895a1e.css.gz +0 -0
  31. package/modules/admin/dist/static/css/chunk-libs.327ad89e.css +14 -0
  32. package/modules/admin/dist/static/css/chunk-libs.327ad89e.css.gz +0 -0
  33. package/modules/admin/dist/static/js/{app.12d7fe96.js → app.03e8afa3.js} +1 -1
  34. package/modules/admin/dist/static/js/app.03e8afa3.js.gz +0 -0
  35. package/modules/admin/dist/static/js/chunk-318c.03fa0032.js +1 -0
  36. package/modules/admin/dist/static/js/chunk-318c.03fa0032.js.gz +0 -0
  37. package/modules/admin/dist/static/js/chunk-3bc2.028748b7.js.gz +0 -0
  38. package/modules/admin/dist/static/js/chunk-5cee.a3b03f7a.js.gz +0 -0
  39. package/modules/admin/dist/static/js/chunk-621e.a9ed86e2.js +1 -0
  40. package/modules/admin/dist/static/js/chunk-621e.a9ed86e2.js.gz +0 -0
  41. package/modules/admin/dist/static/js/chunk-6644.9c6f5c7b.js +1 -0
  42. package/modules/admin/dist/static/js/chunk-6644.9c6f5c7b.js.gz +0 -0
  43. package/modules/admin/dist/static/js/chunk-7291.590524e9.js.gz +0 -0
  44. package/modules/admin/dist/static/js/chunk-8bab.7052832d.js +2 -0
  45. package/modules/admin/dist/static/js/{chunk-23bd.5fa24c85.js.LICENSE.txt → chunk-8bab.7052832d.js.LICENSE.txt} +1 -1
  46. package/modules/admin/dist/static/js/chunk-8bab.7052832d.js.LICENSE.txt.gz +0 -0
  47. package/modules/admin/dist/static/js/chunk-8bab.7052832d.js.gz +0 -0
  48. package/modules/admin/dist/static/js/chunk-b423.387c504c.js.gz +0 -0
  49. package/modules/admin/dist/static/js/chunk-bd5f.e9509f10.js.gz +0 -0
  50. package/modules/admin/dist/static/js/chunk-e375.089d85cd.js +1 -0
  51. package/modules/admin/dist/static/js/chunk-e375.089d85cd.js.gz +0 -0
  52. package/modules/admin/dist/static/js/chunk-e7c3.e5df8ceb.js.gz +0 -0
  53. package/modules/admin/dist/static/js/chunk-elementUI.b0c99c08.js.gz +0 -0
  54. package/modules/admin/dist/static/js/chunk-f075.315ceec1.js +1 -0
  55. package/modules/admin/dist/static/js/chunk-f075.315ceec1.js.gz +0 -0
  56. package/modules/admin/dist/static/js/chunk-libs.06c38828.js +2 -0
  57. package/modules/admin/dist/static/js/{chunk-libs.b6f27cfe.js.LICENSE.txt → chunk-libs.06c38828.js.LICENSE.txt} +1 -1
  58. package/modules/admin/dist/static/js/chunk-libs.06c38828.js.LICENSE.txt.gz +0 -0
  59. package/modules/admin/dist/static/js/chunk-libs.06c38828.js.gz +0 -0
  60. package/modules/admin/package.json +3 -3
  61. package/modules/admin/src/main.js +2 -2
  62. package/modules/admin/src/router/index.js +185 -185
  63. package/modules/admin/src/views/ListDocuments2.vue +309 -309
  64. package/package.json +5 -5
  65. package/test/collections.js +2 -3
  66. package/test/collections.querying.js +18 -4
  67. package/test/test.js +4 -0
  68. package/util.js +19 -0
  69. package/modules/admin/dist/static/css/chunk-36ca.e7e72230.css +0 -1
  70. package/modules/admin/dist/static/css/chunk-62f2.538cfd24.css +0 -1
  71. package/modules/admin/dist/static/css/chunk-7869.220d4af5.css +0 -1
  72. package/modules/admin/dist/static/css/chunk-libs.68e8d170.css +0 -14
  73. package/modules/admin/dist/static/js/chunk-23bd.5fa24c85.js +0 -2
  74. package/modules/admin/dist/static/js/chunk-36ca.eda87655.js +0 -1
  75. package/modules/admin/dist/static/js/chunk-62f2.ee07e11b.js +0 -1
  76. package/modules/admin/dist/static/js/chunk-759b.89a889b6.js +0 -1
  77. package/modules/admin/dist/static/js/chunk-7869.b7ab2c47.js +0 -1
  78. package/modules/admin/dist/static/js/chunk-e80a.cc0d79f4.js +0 -1
  79. package/modules/admin/dist/static/js/chunk-libs.b6f27cfe.js +0 -2
@@ -8,7 +8,7 @@ object-assign
8
8
  * @license MIT */
9
9
 
10
10
  /*!
11
- * Bootstrap v4.6.0 (https://getbootstrap.com/)
11
+ * Bootstrap v4.6.1 (https://getbootstrap.com/)
12
12
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
13
13
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
14
14
  */
@@ -52,10 +52,10 @@
52
52
  "eslint": "^7.0.0",
53
53
  "eslint-friendly-formatter": "^4.0.1",
54
54
  "eslint-loader": "^4.0.2",
55
- "eslint-plugin-vue": "^6.2.2",
55
+ "eslint-plugin-vue": "^7.0.0",
56
56
  "file-loader": "1.1.11",
57
57
  "friendly-errors-webpack-plugin": "1.7.0",
58
- "html-webpack-plugin": "4.0.0-alpha",
58
+ "html-webpack-plugin": "^4.0.0",
59
59
  "mini-css-extract-plugin": "0.4.1",
60
60
  "node-notifier": "5.2.1",
61
61
  "node-sass": "^6.0.1",
@@ -68,7 +68,7 @@
68
68
  "postcss-url": "7.3.2",
69
69
  "rimraf": "2.6.2",
70
70
  "sass-loader": "7.0.3",
71
- "script-ext-html-webpack-plugin": "2.0.1",
71
+ "script-ext-html-webpack-plugin": "^2.1.5",
72
72
  "semver": "5.5.0",
73
73
  "shelljs": "0.8.2",
74
74
  "svg-sprite-loader": "3.8.0",
@@ -23,9 +23,9 @@ import '@/permission' // permission control
23
23
  import { VuePlugin } from 'vuera'
24
24
 
25
25
  import Unicon from 'vue-unicons/dist/vue-unicons-vue2.umd'
26
- import { uniDatabase, uniHome, uniHomeAlt, uniUsersAlt, uniShieldCheck, uniBookOpen, uniDiary, uniFlask, uniCog, uniPlus } from 'vue-unicons/dist/icons'
26
+ import { uniDatabase, uniHome, uniUsersAlt, uniShieldCheck, uniBookOpen, uniDiary, uniFlask, uniCog, uniPlus, uniLink } from 'vue-unicons/dist/icons'
27
27
 
28
- Unicon.add([uniDatabase, uniHome, uniHomeAlt, uniUsersAlt, uniShieldCheck, uniBookOpen, uniDiary, uniFlask, uniCog, uniPlus])
28
+ Unicon.add([uniDatabase, uniHome, uniUsersAlt, uniShieldCheck, uniBookOpen, uniDiary, uniFlask, uniCog, uniPlus, uniLink])
29
29
  Vue.use(Unicon)
30
30
 
31
31
  Vue.use(ElementUI, { locale })
@@ -1,185 +1,185 @@
1
- import Vue from 'vue'
2
- import Router from 'vue-router'
3
-
4
- // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
5
- // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
6
-
7
- Vue.use(Router)
8
-
9
- /* Layout */
10
- import Layout from '../views/layout/Layout'
11
-
12
- const capitalize = (s) => {
13
- if (typeof s !== 'string') return ''
14
- return s.charAt(0).toUpperCase() + s.slice(1)
15
- }
16
-
17
- /**
18
- * hidden: true if `hidden:true` will not show in the sidebar(default is false)
19
- * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
20
- * if not set alwaysShow, only more than one route under the children
21
- * it will becomes nested mode, otherwise not show the root menu
22
- * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
23
- * name:'router-name' the name is used by <keep-alive> (must set!!!)
24
- * meta : {
25
- title: 'title' the name show in submenu and breadcrumb (recommend set)
26
- icon: 'svg-name' the icon show in the sidebar,
27
- }
28
- **/
29
-
30
- export const constantRouterMap = [
31
- { path: '/login', component: () => import('@/views/login/index'), hidden: true },
32
- { path: '/install', component: () => import('@/views/Install'), hidden: true },
33
- { path: '/404', component: () => import('@/views/404'), hidden: true },
34
-
35
- {
36
- path: '/',
37
- component: Layout,
38
- redirect: '/home',
39
- name: 'Home',
40
- meta: { title: 'Home', icon: 'home-alt' },
41
- children: [{
42
- path: 'home',
43
- meta: { title: 'Home', icon: 'home-alt' },
44
- component: () => import('@/views/Home')
45
- }, {
46
- path: '/edit/:collectionName/:id',
47
- component: () => import('@/views/EditDocument'),
48
- hidden: true
49
- }]
50
- },
51
-
52
- {
53
- path: '/users',
54
- redirect: '/users/list',
55
- component: Layout,
56
- name: 'Users',
57
- meta: { title: 'People', icon: 'users-alt' },
58
- children: [{
59
- path: 'list',
60
- meta: { title: 'Users', icon: 'users-alt' },
61
- name: 'users2',
62
- component: () => import('@/views/ListDocuments2'),
63
- props: { collectionName: 'users' },
64
- }, {
65
- path: 'add',
66
- meta: { title: 'Add User', icon: 'plus' },
67
- name: 'newuser',
68
- component: () => import('@/views/EditDocument'),
69
- props: { collectionName: 'users', id: 'create' },
70
- }, {
71
- path: 'role',
72
- meta: { title: 'Roles', icon: 'shield-check' },
73
- name: 'role',
74
- component: () => import('@/views/ListDocuments2'),
75
- props: { collectionName: 'role' },
76
- }, {
77
- path: 'addrole',
78
- meta: { title: 'Add Role', icon: 'plus' },
79
- name: 'newrole',
80
- component: () => import('@/views/EditDocument'),
81
- props: { collectionName: 'role', id: 'create' },
82
- }],
83
- },
84
-
85
- {
86
- path: '/list/:collectionName',
87
- component: Layout,
88
- hidden: true,
89
- name: 'Data',
90
- meta: { title: 'Data', icon: 'database' },
91
- children: [{
92
- path: '',
93
- name: ':collectionName',
94
- component: () => import('@/views/ListDocuments2'),
95
- props: route => ({ collectionName: route.params.collectionName }),
96
- meta: { title: capitalize(name) }
97
- }]
98
- },
99
-
100
- {
101
- path: '/manage/permissions',
102
- component: Layout,
103
- name: 'permissions',
104
- meta: { title: 'Manage' },
105
- children: [
106
- {
107
- path: '',
108
- name: 'permissions',
109
- component: () => import('@/views/ManagePermissions'),
110
- meta: { title: 'Permissions' }
111
- }
112
- ]
113
- },
114
-
115
- {
116
- path: '/dev',
117
- component: Layout,
118
- meta: { title: 'Dev', icon: 'flask' },
119
- name: 'Dev',
120
- children: [
121
- {
122
- path: '',
123
- name: '',
124
- component: () => import('@/views/Dev'),
125
- meta: { title: '' },
126
- hidden: true,
127
- },
128
- {
129
- path: 'listeners',
130
- name: 'listeners',
131
- component: () => import('@/views/ManageListeners'),
132
- meta: { title: 'Listeners' }
133
- },
134
- {
135
- path: 'middleware',
136
- name: 'middleware',
137
- component: () => import('@/views/ManageMiddleware'),
138
- meta: { title: 'Middleware' }
139
- }, {
140
- path: 'requestlogs',
141
- meta: { title: 'Request Logs', icon: 'diary' },
142
- name: 'requestlogs',
143
- component: () => import('@/views/ListDocuments2'),
144
- props: { collectionName: 'requestlog', columns: ['method', 'url', 'req.ip', 'user', 'res.message', 'res.statusCode', 'res.headers.content-length'] },
145
- }, {
146
- path: 'viewrequest/:requestId',
147
- hidden: true,
148
- meta: { title: 'View Request', icon: 'diary' },
149
- name: 'viewrequest',
150
- component: () => import('@/views/ViewRequest'),
151
- }, {
152
- path: '/edit/collection',
153
- component: Layout,
154
- name: 'Schema',
155
- hidden: true,
156
- meta: { title: 'Schemas', icon: 'cog' },
157
- children: [{
158
- hidden: true,
159
- path: '/:collectionName',
160
- name: name,
161
- meta: { title: capitalize(name) }
162
- }]
163
- },
164
- ]
165
- },
166
-
167
- {
168
- path: 'external-link',
169
- component: Layout,
170
- children: [
171
- {
172
- path: 'https://github.com/thomas4019/expressa',
173
- meta: { title: 'Expressa Docs', icon: 'link' }
174
- }
175
- ]
176
- },
177
-
178
- { path: '*', redirect: '/404', hidden: true }
179
- ]
180
-
181
- export default new Router({
182
- // mode: 'history',
183
- scrollBehavior: () => ({ y: 0 }),
184
- routes: constantRouterMap
185
- })
1
+ import Vue from 'vue'
2
+ import Router from 'vue-router'
3
+
4
+ // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
5
+ // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
6
+
7
+ Vue.use(Router)
8
+
9
+ /* Layout */
10
+ import Layout from '../views/layout/Layout'
11
+
12
+ const capitalize = (s) => {
13
+ if (typeof s !== 'string') return ''
14
+ return s.charAt(0).toUpperCase() + s.slice(1)
15
+ }
16
+
17
+ /**
18
+ * hidden: true if `hidden:true` will not show in the sidebar(default is false)
19
+ * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
20
+ * if not set alwaysShow, only more than one route under the children
21
+ * it will becomes nested mode, otherwise not show the root menu
22
+ * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
23
+ * name:'router-name' the name is used by <keep-alive> (must set!!!)
24
+ * meta : {
25
+ title: 'title' the name show in submenu and breadcrumb (recommend set)
26
+ icon: 'svg-name' the icon show in the sidebar,
27
+ }
28
+ **/
29
+
30
+ export const constantRouterMap = [
31
+ { path: '/login', component: () => import('@/views/login/index'), hidden: true },
32
+ { path: '/install', component: () => import('@/views/Install'), hidden: true },
33
+ { path: '/404', component: () => import('@/views/404'), hidden: true },
34
+
35
+ {
36
+ path: '/',
37
+ component: Layout,
38
+ redirect: '/home',
39
+ name: 'Home',
40
+ meta: { title: 'Home', icon: 'home' },
41
+ children: [{
42
+ path: 'home',
43
+ meta: { title: 'Home', icon: 'home' },
44
+ component: () => import('@/views/Home')
45
+ }, {
46
+ path: '/edit/:collectionName/:id',
47
+ component: () => import('@/views/EditDocument'),
48
+ hidden: true
49
+ }]
50
+ },
51
+
52
+ {
53
+ path: '/users',
54
+ redirect: '/users/list',
55
+ component: Layout,
56
+ name: 'Users',
57
+ meta: { title: 'People', icon: 'users-alt' },
58
+ children: [{
59
+ path: 'list',
60
+ meta: { title: 'Users', icon: 'users-alt' },
61
+ name: 'users2',
62
+ component: () => import('@/views/ListDocuments2'),
63
+ props: { collectionName: 'users' },
64
+ }, {
65
+ path: 'add',
66
+ meta: { title: 'Add User', icon: 'plus' },
67
+ name: 'newuser',
68
+ component: () => import('@/views/EditDocument'),
69
+ props: { collectionName: 'users', id: 'create' },
70
+ }, {
71
+ path: 'role',
72
+ meta: { title: 'Roles', icon: 'shield-check' },
73
+ name: 'role',
74
+ component: () => import('@/views/ListDocuments2'),
75
+ props: { collectionName: 'role' },
76
+ }, {
77
+ path: 'addrole',
78
+ meta: { title: 'Add Role', icon: 'plus' },
79
+ name: 'newrole',
80
+ component: () => import('@/views/EditDocument'),
81
+ props: { collectionName: 'role', id: 'create' },
82
+ }],
83
+ },
84
+
85
+ {
86
+ path: '/list/:collectionName',
87
+ component: Layout,
88
+ hidden: true,
89
+ name: 'Data',
90
+ meta: { title: 'Data', icon: 'database' },
91
+ children: [{
92
+ path: '',
93
+ name: ':collectionName',
94
+ component: () => import('@/views/ListDocuments2'),
95
+ props: route => ({ collectionName: route.params.collectionName }),
96
+ meta: { title: capitalize(name) }
97
+ }]
98
+ },
99
+
100
+ {
101
+ path: '/manage/permissions',
102
+ component: Layout,
103
+ name: 'permissions',
104
+ meta: { title: 'Manage', icon: 'shield-check' },
105
+ children: [
106
+ {
107
+ path: '',
108
+ name: 'permissions',
109
+ component: () => import('@/views/ManagePermissions'),
110
+ meta: { title: 'Permissions' }
111
+ }
112
+ ]
113
+ },
114
+
115
+ {
116
+ path: '/dev',
117
+ component: Layout,
118
+ meta: { title: 'Dev', icon: 'flask' },
119
+ name: 'Dev',
120
+ children: [
121
+ {
122
+ path: '',
123
+ name: '',
124
+ component: () => import('@/views/Dev'),
125
+ meta: { title: '' },
126
+ hidden: true,
127
+ },
128
+ {
129
+ path: 'listeners',
130
+ name: 'listeners',
131
+ component: () => import('@/views/ManageListeners'),
132
+ meta: { title: 'Listeners' }
133
+ },
134
+ {
135
+ path: 'middleware',
136
+ name: 'middleware',
137
+ component: () => import('@/views/ManageMiddleware'),
138
+ meta: { title: 'Middleware' }
139
+ }, {
140
+ path: 'requestlogs',
141
+ meta: { title: 'Request Logs', icon: 'diary' },
142
+ name: 'requestlogs',
143
+ component: () => import('@/views/ListDocuments2'),
144
+ props: { collectionName: 'requestlog', columns: ['method', 'url', 'req.ip', 'user', 'res.message', 'res.statusCode', 'res.headers.content-length'] },
145
+ }, {
146
+ path: 'viewrequest/:requestId',
147
+ hidden: true,
148
+ meta: { title: 'View Request', icon: 'diary' },
149
+ name: 'viewrequest',
150
+ component: () => import('@/views/ViewRequest'),
151
+ }, {
152
+ path: '/edit/collection',
153
+ component: Layout,
154
+ name: 'Schema',
155
+ hidden: true,
156
+ meta: { title: 'Schemas', icon: 'cog' },
157
+ children: [{
158
+ hidden: true,
159
+ path: '/:collectionName',
160
+ name: name,
161
+ meta: { title: capitalize(name) }
162
+ }]
163
+ },
164
+ ]
165
+ },
166
+
167
+ {
168
+ path: 'external-link',
169
+ component: Layout,
170
+ children: [
171
+ {
172
+ path: 'https://github.com/thomas4019/expressa',
173
+ meta: { title: 'Expressa Docs', icon: 'link' }
174
+ }
175
+ ]
176
+ },
177
+
178
+ { path: '*', redirect: '/404', hidden: true }
179
+ ]
180
+
181
+ export default new Router({
182
+ // mode: 'history',
183
+ scrollBehavior: () => ({ y: 0 }),
184
+ routes: constantRouterMap
185
+ })