adapt-authoring-server 0.0.1 → 1.0.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.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +55 -55
- package/.github/ISSUE_TEMPLATE/feature_request.yml +22 -22
- package/.github/dependabot.yml +11 -11
- package/.github/pull_request_template.md +25 -25
- package/.github/workflows/new.yml +19 -19
- package/.github/workflows/releases.yml +25 -0
- package/.github/workflows/standardjs.yml +13 -0
- package/adapt-authoring.json +8 -8
- package/conf/config.schema.json +33 -38
- package/docs/server-requests.md +28 -28
- package/errors/errors.json +23 -23
- package/index.js +5 -5
- package/lib/Router.js +272 -272
- package/lib/ServerModule.js +155 -153
- package/lib/ServerUtils.js +189 -191
- package/lib/typedefs.js +57 -57
- package/package.json +56 -22
- package/.eslintignore +0 -1
- package/.eslintrc +0 -14
- package/tests/router.spec.js +0 -142
- package/tests/serverModule.spec.js +0 -51
package/lib/ServerUtils.js
CHANGED
|
@@ -1,191 +1,189 @@
|
|
|
1
|
-
import _ from 'lodash'
|
|
2
|
-
import { App } from 'adapt-authoring-core'
|
|
3
|
-
/**
|
|
4
|
-
* Server-related utilities
|
|
5
|
-
* @memberof server
|
|
6
|
-
*/
|
|
7
|
-
class ServerUtils {
|
|
8
|
-
/**
|
|
9
|
-
* Middleware for handling 404 errors on the API router
|
|
10
|
-
* @param {external:ExpressRequest} req
|
|
11
|
-
* @param {external:ExpressResponse} res
|
|
12
|
-
* @param {Function} next
|
|
13
|
-
*/
|
|
14
|
-
static apiNotFoundHandler (req, res, next) {
|
|
15
|
-
next(App.instance.errors.ENDPOINT_NOT_FOUND.setData({ endpoint: req.originalUrl, method: req.method }))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Generic error handling middleware for the API router
|
|
20
|
-
* @param {Error} error
|
|
21
|
-
* @param {external:ExpressRequest} req
|
|
22
|
-
* @param {external:ExpressResponse} res
|
|
23
|
-
* @param {Function} next
|
|
24
|
-
*/
|
|
25
|
-
static genericErrorHandler (error, req, res, next) {
|
|
26
|
-
this.log('error', App.instance.lang.translate(undefined, error), this.getConfig('verboseErrorLogging') && error.stack ? error.stack : '')
|
|
27
|
-
res.sendError(error)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Middleware for handling 404 errors on the root router
|
|
32
|
-
* @param {external:ExpressRequest} req
|
|
33
|
-
* @param {external:ExpressResponse} res
|
|
34
|
-
*/
|
|
35
|
-
static rootNotFoundHandler (req, res) {
|
|
36
|
-
res.status(App.instance.errors.NOT_FOUND.statusCode).end()
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Handler for returning an API map
|
|
41
|
-
* @param {Router} topRouter
|
|
42
|
-
* @return {Function} Middleware function
|
|
43
|
-
*/
|
|
44
|
-
static mapHandler (topRouter) {
|
|
45
|
-
return (req, res) => res.json(topRouter.map)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Generates a map for a given router
|
|
50
|
-
* @param {Router} topRouter
|
|
51
|
-
* @return {Object} The route map
|
|
52
|
-
*/
|
|
53
|
-
static generateRouterMap (topRouter) {
|
|
54
|
-
return topRouter.flattenRouters()
|
|
55
|
-
.sort((a, b) => a.root.localeCompare(b.root))
|
|
56
|
-
.reduce((m, r) => {
|
|
57
|
-
const key = `${getRelativeRoute(topRouter, r)}endpoints`
|
|
58
|
-
const endpoints = getEndpoints(r)
|
|
59
|
-
return endpoints.length ? { ...m, [key]: endpoints } : m
|
|
60
|
-
}, {})
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Adds extra properties to the request object to allow for easy translations
|
|
65
|
-
* @param {Function} next
|
|
66
|
-
*/
|
|
67
|
-
static addErrorHandler (req, res, next) {
|
|
68
|
-
res.sendError = error => {
|
|
69
|
-
if (error.constructor.name !== 'AdaptError') {
|
|
70
|
-
const e = App.instance.errors[error.code]
|
|
71
|
-
if (e) {
|
|
72
|
-
if (error.statusCode) e.statusCode = error.statusCode
|
|
73
|
-
e.error = error.message
|
|
74
|
-
error = e
|
|
75
|
-
} else {
|
|
76
|
-
error = App.instance.errors.SERVER_ERROR
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
res
|
|
80
|
-
.status(error.statusCode)
|
|
81
|
-
.json({ code: error.code, message: req.translate?.(error) ?? error.message })
|
|
82
|
-
}
|
|
83
|
-
next()
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Adds logs for debugging each request time
|
|
88
|
-
* @param {external:ExpressRequest} req
|
|
89
|
-
* @param {external:ExpressResponse} res
|
|
90
|
-
* @param {Function} next
|
|
91
|
-
*/
|
|
92
|
-
static async debugRequestTime (req, res, next) {
|
|
93
|
-
const server = await App.instance.waitForModule('server')
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
*
|
|
103
|
-
* @param {
|
|
104
|
-
* @
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* req.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
* @param {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
export default ServerUtils
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
import { App } from 'adapt-authoring-core'
|
|
3
|
+
/**
|
|
4
|
+
* Server-related utilities
|
|
5
|
+
* @memberof server
|
|
6
|
+
*/
|
|
7
|
+
class ServerUtils {
|
|
8
|
+
/**
|
|
9
|
+
* Middleware for handling 404 errors on the API router
|
|
10
|
+
* @param {external:ExpressRequest} req
|
|
11
|
+
* @param {external:ExpressResponse} res
|
|
12
|
+
* @param {Function} next
|
|
13
|
+
*/
|
|
14
|
+
static apiNotFoundHandler (req, res, next) {
|
|
15
|
+
next(App.instance.errors.ENDPOINT_NOT_FOUND.setData({ endpoint: req.originalUrl, method: req.method }))
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Generic error handling middleware for the API router
|
|
20
|
+
* @param {Error} error
|
|
21
|
+
* @param {external:ExpressRequest} req
|
|
22
|
+
* @param {external:ExpressResponse} res
|
|
23
|
+
* @param {Function} next
|
|
24
|
+
*/
|
|
25
|
+
static genericErrorHandler (error, req, res, next) {
|
|
26
|
+
this.log('error', App.instance.lang.translate(undefined, error), this.getConfig('verboseErrorLogging') && error.stack ? error.stack : '')
|
|
27
|
+
res.sendError(error)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Middleware for handling 404 errors on the root router
|
|
32
|
+
* @param {external:ExpressRequest} req
|
|
33
|
+
* @param {external:ExpressResponse} res
|
|
34
|
+
*/
|
|
35
|
+
static rootNotFoundHandler (req, res) {
|
|
36
|
+
res.status(App.instance.errors.NOT_FOUND.statusCode).end()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Handler for returning an API map
|
|
41
|
+
* @param {Router} topRouter
|
|
42
|
+
* @return {Function} Middleware function
|
|
43
|
+
*/
|
|
44
|
+
static mapHandler (topRouter) {
|
|
45
|
+
return (req, res) => res.json(topRouter.map)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Generates a map for a given router
|
|
50
|
+
* @param {Router} topRouter
|
|
51
|
+
* @return {Object} The route map
|
|
52
|
+
*/
|
|
53
|
+
static generateRouterMap (topRouter) {
|
|
54
|
+
return topRouter.flattenRouters()
|
|
55
|
+
.sort((a, b) => a.root.localeCompare(b.root))
|
|
56
|
+
.reduce((m, r) => {
|
|
57
|
+
const key = `${getRelativeRoute(topRouter, r)}endpoints`
|
|
58
|
+
const endpoints = getEndpoints(r)
|
|
59
|
+
return endpoints.length ? { ...m, [key]: endpoints } : m
|
|
60
|
+
}, {})
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Adds extra properties to the request object to allow for easy translations
|
|
65
|
+
* @param {Function} next
|
|
66
|
+
*/
|
|
67
|
+
static addErrorHandler (req, res, next) {
|
|
68
|
+
res.sendError = error => {
|
|
69
|
+
if (error.constructor.name !== 'AdaptError') {
|
|
70
|
+
const e = App.instance.errors[error.code]
|
|
71
|
+
if (e) {
|
|
72
|
+
if (error.statusCode) e.statusCode = error.statusCode
|
|
73
|
+
e.error = error.message
|
|
74
|
+
error = e
|
|
75
|
+
} else {
|
|
76
|
+
error = App.instance.errors.SERVER_ERROR
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
res
|
|
80
|
+
.status(error.statusCode)
|
|
81
|
+
.json({ code: error.code, message: req.translate?.(error) ?? error.message })
|
|
82
|
+
}
|
|
83
|
+
next()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Adds logs for debugging each request time
|
|
88
|
+
* @param {external:ExpressRequest} req
|
|
89
|
+
* @param {external:ExpressResponse} res
|
|
90
|
+
* @param {Function} next
|
|
91
|
+
*/
|
|
92
|
+
static async debugRequestTime (req, res, next) {
|
|
93
|
+
const server = await App.instance.waitForModule('server')
|
|
94
|
+
const start = new Date()
|
|
95
|
+
res.on('finish', () => server.log('verbose', 'REQUEST_DURATION', req.method, req.originalUrl, new Date() - start, req.auth?.user?._id?.toString()))
|
|
96
|
+
next()
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Adds extra properties to the request object to allow for easy existence checking of common request objects
|
|
101
|
+
* @param {external:ExpressRequest} req
|
|
102
|
+
* @param {external:ExpressResponse} res
|
|
103
|
+
* @param {Function} next
|
|
104
|
+
* @example
|
|
105
|
+
* "IMPORTANT NOTE: body data is completely ignored for GET requests, any code
|
|
106
|
+
* requiring it should switch to use POST."
|
|
107
|
+
*
|
|
108
|
+
* let req = { 'params': { 'foo':'bar' }, 'query': {}, 'body': {} };
|
|
109
|
+
* req.hasParams // true
|
|
110
|
+
* req.hasQuery // false
|
|
111
|
+
* req.hasBody // false
|
|
112
|
+
*/
|
|
113
|
+
static addExistenceProps (req, res, next) {
|
|
114
|
+
if (req.method === 'GET') {
|
|
115
|
+
req.body = {}
|
|
116
|
+
}
|
|
117
|
+
const storeVal = (key, exists) => {
|
|
118
|
+
req[`has${_.capitalize(key)}`] = exists
|
|
119
|
+
}
|
|
120
|
+
['body', 'params', 'query'].forEach(attr => {
|
|
121
|
+
if (!req[attr]) {
|
|
122
|
+
return storeVal(attr, true)
|
|
123
|
+
}
|
|
124
|
+
const entries = Object.entries(req[attr])
|
|
125
|
+
let deleted = 0
|
|
126
|
+
if (entries.length === 0) {
|
|
127
|
+
return storeVal(attr, false)
|
|
128
|
+
}
|
|
129
|
+
entries.forEach(([key, val]) => {
|
|
130
|
+
if (val === undefined || val === null) {
|
|
131
|
+
delete req[attr][key]
|
|
132
|
+
deleted++
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
storeVal(attr, deleted < entries.length)
|
|
136
|
+
})
|
|
137
|
+
next()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Handles restriction of routes marked as internal
|
|
142
|
+
* @param {external:ExpressRequest} req
|
|
143
|
+
* @param {external:ExpressResponse} res
|
|
144
|
+
* @param {Function} next
|
|
145
|
+
*/
|
|
146
|
+
static async handleInternalRoutes (req, res, next) {
|
|
147
|
+
const server = await App.instance.waitForModule('server')
|
|
148
|
+
const isInternalIp = server.getConfig('host') === req.ip || req.ip === '127.0.0.1' || req.ip === '::1'
|
|
149
|
+
if (req.routeConfig.internal && !isInternalIp) {
|
|
150
|
+
return next(App.instance.errors.UNAUTHORISED.setData({ url: req.originalUrl, method: req.method }))
|
|
151
|
+
}
|
|
152
|
+
next()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Caches the route config on the incoming request
|
|
157
|
+
* @param {Route} routeConfig
|
|
158
|
+
* @return {Function}
|
|
159
|
+
*/
|
|
160
|
+
static cacheRouteConfig (routeConfig) {
|
|
161
|
+
return (req, res, next) => {
|
|
162
|
+
req.routeConfig = routeConfig
|
|
163
|
+
next()
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** @ignore */ function getEndpoints (r) {
|
|
168
|
+
return r.routes.map(route => {
|
|
169
|
+
return {
|
|
170
|
+
url: `${r.url}${route.route}`,
|
|
171
|
+
accepted_methods: Object.keys(route.handlers).reduce((memo, method) => {
|
|
172
|
+
return {
|
|
173
|
+
...memo,
|
|
174
|
+
[method]: route?.meta?.[method] ?? {}
|
|
175
|
+
}
|
|
176
|
+
}, {})
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
/** @ignore */ function getRelativeRoute (relFrom, relTo) {
|
|
181
|
+
if (relFrom === relTo) {
|
|
182
|
+
return `${relFrom.route}_`
|
|
183
|
+
}
|
|
184
|
+
let route = ''
|
|
185
|
+
for (let r = relTo; r !== relFrom; r = r.parentRouter) route = `${r.root}_${route}`
|
|
186
|
+
return route
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export default ServerUtils
|
package/lib/typedefs.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file exists to define the below types for documentation purposes.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Built-in HTTP server
|
|
6
|
-
* @memberof server
|
|
7
|
-
* @external HttpServer
|
|
8
|
-
* @see {@link https://nodejs.org/api/http.html#http_class_http_server}
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Express.js top-level application
|
|
12
|
-
* @memberof server
|
|
13
|
-
* @external ExpressApp
|
|
14
|
-
* @see {@link https://expressjs.com/en/4x/api.html#app}
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Express.js HTTP router
|
|
18
|
-
* @memberof server
|
|
19
|
-
* @external ExpressRouter
|
|
20
|
-
* @see {@link https://expressjs.com/en/4x/api.html#router}
|
|
21
|
-
*/
|
|
22
|
-
/**
|
|
23
|
-
* Express.js HTTP request
|
|
24
|
-
* @memberof server
|
|
25
|
-
* @external ExpressRequest
|
|
26
|
-
* @see {@link https://expressjs.com/en/4x/api.html#req}
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* Express.js HTTP response
|
|
30
|
-
* @memberof server
|
|
31
|
-
* @external ExpressResponse
|
|
32
|
-
* @see {@link https://nodejs.org/api/http.html#http_class_http_serverresponse}
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* Defines how an individual API route should be handled
|
|
36
|
-
* @memberof server
|
|
37
|
-
* @typedef {Object} Route
|
|
38
|
-
* @property {String} route The name of the api (this will be used as the API endpoint)
|
|
39
|
-
* @property {Object} handlers Object mapping HTTP methods to request handler functions. Note: Any HTTP methods not specified in `handlers` will not be exposed.
|
|
40
|
-
* @property {Array<Function>|Function} [handlers.post] POST handlers for the route
|
|
41
|
-
* @property {Array<Function>|Function} [handlers.get] GET handlers for the route
|
|
42
|
-
* @property {Array<Function>|Function} [handlers.put] PUT handlers for the route
|
|
43
|
-
* @property {Array<Function>|Function} [handlers.delete] DELETE handlers for the route
|
|
44
|
-
* @example
|
|
45
|
-
* {
|
|
46
|
-
* route: '/:id?',
|
|
47
|
-
* handlers: {
|
|
48
|
-
* // can be an array of middleware/handlers
|
|
49
|
-
* post: [beforePost, handlePostRequest, afterPost],
|
|
50
|
-
* // or an individual function
|
|
51
|
-
* get: getRequest,
|
|
52
|
-
* put: putRequest,
|
|
53
|
-
* // or an in-line function
|
|
54
|
-
* delete: (req, res, next) => { next(); }
|
|
55
|
-
* }
|
|
56
|
-
* }
|
|
57
|
-
*/
|
|
1
|
+
/**
|
|
2
|
+
* This file exists to define the below types for documentation purposes.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Built-in HTTP server
|
|
6
|
+
* @memberof server
|
|
7
|
+
* @external HttpServer
|
|
8
|
+
* @see {@link https://nodejs.org/api/http.html#http_class_http_server}
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Express.js top-level application
|
|
12
|
+
* @memberof server
|
|
13
|
+
* @external ExpressApp
|
|
14
|
+
* @see {@link https://expressjs.com/en/4x/api.html#app}
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Express.js HTTP router
|
|
18
|
+
* @memberof server
|
|
19
|
+
* @external ExpressRouter
|
|
20
|
+
* @see {@link https://expressjs.com/en/4x/api.html#router}
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Express.js HTTP request
|
|
24
|
+
* @memberof server
|
|
25
|
+
* @external ExpressRequest
|
|
26
|
+
* @see {@link https://expressjs.com/en/4x/api.html#req}
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Express.js HTTP response
|
|
30
|
+
* @memberof server
|
|
31
|
+
* @external ExpressResponse
|
|
32
|
+
* @see {@link https://nodejs.org/api/http.html#http_class_http_serverresponse}
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Defines how an individual API route should be handled
|
|
36
|
+
* @memberof server
|
|
37
|
+
* @typedef {Object} Route
|
|
38
|
+
* @property {String} route The name of the api (this will be used as the API endpoint)
|
|
39
|
+
* @property {Object} handlers Object mapping HTTP methods to request handler functions. Note: Any HTTP methods not specified in `handlers` will not be exposed.
|
|
40
|
+
* @property {Array<Function>|Function} [handlers.post] POST handlers for the route
|
|
41
|
+
* @property {Array<Function>|Function} [handlers.get] GET handlers for the route
|
|
42
|
+
* @property {Array<Function>|Function} [handlers.put] PUT handlers for the route
|
|
43
|
+
* @property {Array<Function>|Function} [handlers.delete] DELETE handlers for the route
|
|
44
|
+
* @example
|
|
45
|
+
* {
|
|
46
|
+
* route: '/:id?',
|
|
47
|
+
* handlers: {
|
|
48
|
+
* // can be an array of middleware/handlers
|
|
49
|
+
* post: [beforePost, handlePostRequest, afterPost],
|
|
50
|
+
* // or an individual function
|
|
51
|
+
* get: getRequest,
|
|
52
|
+
* put: putRequest,
|
|
53
|
+
* // or an in-line function
|
|
54
|
+
* delete: (req, res, next) => { next(); }
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,22 +1,56 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "adapt-authoring-server",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Provides an Express application routing and more",
|
|
5
|
-
"homepage": "https://github.com/adapt-security/adapt-authoring-server",
|
|
6
|
-
"license": "GPL-3.0",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "index.js",
|
|
9
|
-
"repository": "github:adapt-security/adapt-authoring-server",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"express": "^5.1.0",
|
|
12
|
-
"hbs": "^4.2.0",
|
|
13
|
-
"lodash": "^4.17.21"
|
|
14
|
-
},
|
|
15
|
-
"peerDependencies": {
|
|
16
|
-
"adapt-authoring-core": "github:adapt-security/adapt-authoring-core"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "adapt-authoring-server",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Provides an Express application routing and more",
|
|
5
|
+
"homepage": "https://github.com/adapt-security/adapt-authoring-server",
|
|
6
|
+
"license": "GPL-3.0",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"repository": "github:adapt-security/adapt-authoring-server",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"express": "^5.1.0",
|
|
12
|
+
"hbs": "^4.2.0",
|
|
13
|
+
"lodash": "^4.17.21"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"adapt-authoring-core": "github:adapt-security/adapt-authoring-core"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"standard": "^17.1.0",
|
|
20
|
+
"@semantic-release/commit-analyzer": "^9.0.2",
|
|
21
|
+
"@semantic-release/git": "^10.0.1",
|
|
22
|
+
"@semantic-release/github": "^8.0.5",
|
|
23
|
+
"@semantic-release/npm": "^9.0.1",
|
|
24
|
+
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
25
|
+
"conventional-changelog-eslint": "^3.0.9",
|
|
26
|
+
"semantic-release": "^21.0.1",
|
|
27
|
+
"semantic-release-replace-plugin": "^1.2.7"
|
|
28
|
+
},
|
|
29
|
+
"release": {
|
|
30
|
+
"plugins": [
|
|
31
|
+
[
|
|
32
|
+
"@semantic-release/commit-analyzer",
|
|
33
|
+
{
|
|
34
|
+
"preset": "eslint"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"@semantic-release/release-notes-generator",
|
|
39
|
+
{
|
|
40
|
+
"preset": "eslint"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"@semantic-release/npm",
|
|
44
|
+
"@semantic-release/github",
|
|
45
|
+
[
|
|
46
|
+
"@semantic-release/git",
|
|
47
|
+
{
|
|
48
|
+
"assets": [
|
|
49
|
+
"package.json"
|
|
50
|
+
],
|
|
51
|
+
"message": "Chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules
|