step-node-agent 3.24.2 → 3.24.3

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 (31) hide show
  1. package/node_modules/express/History.md +14 -5
  2. package/node_modules/express/Readme.md +1 -1
  3. package/node_modules/express/lib/router/index.js +1 -1
  4. package/node_modules/express/lib/router/route.js +7 -2
  5. package/node_modules/express/lib/utils.js +3 -4
  6. package/node_modules/express/package.json +5 -6
  7. package/node_modules/side-channel/CHANGELOG.md +9 -0
  8. package/node_modules/side-channel/index.d.ts +27 -0
  9. package/node_modules/side-channel/index.js +19 -7
  10. package/node_modules/side-channel/package.json +11 -9
  11. package/node_modules/side-channel/test/index.js +1 -1
  12. package/node_modules/side-channel/tsconfig.json +50 -0
  13. package/package.json +1 -1
  14. package/node_modules/express/node_modules/body-parser/HISTORY.md +0 -657
  15. package/node_modules/express/node_modules/body-parser/LICENSE +0 -23
  16. package/node_modules/express/node_modules/body-parser/README.md +0 -464
  17. package/node_modules/express/node_modules/body-parser/SECURITY.md +0 -25
  18. package/node_modules/express/node_modules/body-parser/index.js +0 -156
  19. package/node_modules/express/node_modules/body-parser/lib/read.js +0 -205
  20. package/node_modules/express/node_modules/body-parser/lib/types/json.js +0 -236
  21. package/node_modules/express/node_modules/body-parser/lib/types/raw.js +0 -101
  22. package/node_modules/express/node_modules/body-parser/lib/types/text.js +0 -121
  23. package/node_modules/express/node_modules/body-parser/lib/types/urlencoded.js +0 -284
  24. package/node_modules/express/node_modules/body-parser/package.json +0 -56
  25. package/node_modules/express/node_modules/raw-body/HISTORY.md +0 -303
  26. package/node_modules/express/node_modules/raw-body/LICENSE +0 -22
  27. package/node_modules/express/node_modules/raw-body/README.md +0 -223
  28. package/node_modules/express/node_modules/raw-body/SECURITY.md +0 -24
  29. package/node_modules/express/node_modules/raw-body/index.d.ts +0 -87
  30. package/node_modules/express/node_modules/raw-body/index.js +0 -329
  31. package/node_modules/express/node_modules/raw-body/package.json +0 -49
@@ -1,205 +0,0 @@
1
- /*!
2
- * body-parser
3
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * Module dependencies.
11
- * @private
12
- */
13
-
14
- var createError = require('http-errors')
15
- var destroy = require('destroy')
16
- var getBody = require('raw-body')
17
- var iconv = require('iconv-lite')
18
- var onFinished = require('on-finished')
19
- var unpipe = require('unpipe')
20
- var zlib = require('zlib')
21
-
22
- /**
23
- * Module exports.
24
- */
25
-
26
- module.exports = read
27
-
28
- /**
29
- * Read a request into a buffer and parse.
30
- *
31
- * @param {object} req
32
- * @param {object} res
33
- * @param {function} next
34
- * @param {function} parse
35
- * @param {function} debug
36
- * @param {object} options
37
- * @private
38
- */
39
-
40
- function read (req, res, next, parse, debug, options) {
41
- var length
42
- var opts = options
43
- var stream
44
-
45
- // flag as parsed
46
- req._body = true
47
-
48
- // read options
49
- var encoding = opts.encoding !== null
50
- ? opts.encoding
51
- : null
52
- var verify = opts.verify
53
-
54
- try {
55
- // get the content stream
56
- stream = contentstream(req, debug, opts.inflate)
57
- length = stream.length
58
- stream.length = undefined
59
- } catch (err) {
60
- return next(err)
61
- }
62
-
63
- // set raw-body options
64
- opts.length = length
65
- opts.encoding = verify
66
- ? null
67
- : encoding
68
-
69
- // assert charset is supported
70
- if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
71
- return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
72
- charset: encoding.toLowerCase(),
73
- type: 'charset.unsupported'
74
- }))
75
- }
76
-
77
- // read body
78
- debug('read body')
79
- getBody(stream, opts, function (error, body) {
80
- if (error) {
81
- var _error
82
-
83
- if (error.type === 'encoding.unsupported') {
84
- // echo back charset
85
- _error = createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
86
- charset: encoding.toLowerCase(),
87
- type: 'charset.unsupported'
88
- })
89
- } else {
90
- // set status code on error
91
- _error = createError(400, error)
92
- }
93
-
94
- // unpipe from stream and destroy
95
- if (stream !== req) {
96
- unpipe(req)
97
- destroy(stream, true)
98
- }
99
-
100
- // read off entire request
101
- dump(req, function onfinished () {
102
- next(createError(400, _error))
103
- })
104
- return
105
- }
106
-
107
- // verify
108
- if (verify) {
109
- try {
110
- debug('verify body')
111
- verify(req, res, body, encoding)
112
- } catch (err) {
113
- next(createError(403, err, {
114
- body: body,
115
- type: err.type || 'entity.verify.failed'
116
- }))
117
- return
118
- }
119
- }
120
-
121
- // parse
122
- var str = body
123
- try {
124
- debug('parse body')
125
- str = typeof body !== 'string' && encoding !== null
126
- ? iconv.decode(body, encoding)
127
- : body
128
- req.body = parse(str)
129
- } catch (err) {
130
- next(createError(400, err, {
131
- body: str,
132
- type: err.type || 'entity.parse.failed'
133
- }))
134
- return
135
- }
136
-
137
- next()
138
- })
139
- }
140
-
141
- /**
142
- * Get the content stream of the request.
143
- *
144
- * @param {object} req
145
- * @param {function} debug
146
- * @param {boolean} [inflate=true]
147
- * @return {object}
148
- * @api private
149
- */
150
-
151
- function contentstream (req, debug, inflate) {
152
- var encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
153
- var length = req.headers['content-length']
154
- var stream
155
-
156
- debug('content-encoding "%s"', encoding)
157
-
158
- if (inflate === false && encoding !== 'identity') {
159
- throw createError(415, 'content encoding unsupported', {
160
- encoding: encoding,
161
- type: 'encoding.unsupported'
162
- })
163
- }
164
-
165
- switch (encoding) {
166
- case 'deflate':
167
- stream = zlib.createInflate()
168
- debug('inflate body')
169
- req.pipe(stream)
170
- break
171
- case 'gzip':
172
- stream = zlib.createGunzip()
173
- debug('gunzip body')
174
- req.pipe(stream)
175
- break
176
- case 'identity':
177
- stream = req
178
- stream.length = length
179
- break
180
- default:
181
- throw createError(415, 'unsupported content encoding "' + encoding + '"', {
182
- encoding: encoding,
183
- type: 'encoding.unsupported'
184
- })
185
- }
186
-
187
- return stream
188
- }
189
-
190
- /**
191
- * Dump the contents of a request.
192
- *
193
- * @param {object} req
194
- * @param {function} callback
195
- * @api private
196
- */
197
-
198
- function dump (req, callback) {
199
- if (onFinished.isFinished(req)) {
200
- callback(null)
201
- } else {
202
- onFinished(req, callback)
203
- req.resume()
204
- }
205
- }
@@ -1,236 +0,0 @@
1
- /*!
2
- * body-parser
3
- * Copyright(c) 2014 Jonathan Ong
4
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
5
- * MIT Licensed
6
- */
7
-
8
- 'use strict'
9
-
10
- /**
11
- * Module dependencies.
12
- * @private
13
- */
14
-
15
- var bytes = require('bytes')
16
- var contentType = require('content-type')
17
- var createError = require('http-errors')
18
- var debug = require('debug')('body-parser:json')
19
- var read = require('../read')
20
- var typeis = require('type-is')
21
-
22
- /**
23
- * Module exports.
24
- */
25
-
26
- module.exports = json
27
-
28
- /**
29
- * RegExp to match the first non-space in a string.
30
- *
31
- * Allowed whitespace is defined in RFC 7159:
32
- *
33
- * ws = *(
34
- * %x20 / ; Space
35
- * %x09 / ; Horizontal tab
36
- * %x0A / ; Line feed or New line
37
- * %x0D ) ; Carriage return
38
- */
39
-
40
- var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
41
-
42
- /**
43
- * Create a middleware to parse JSON bodies.
44
- *
45
- * @param {object} [options]
46
- * @return {function}
47
- * @public
48
- */
49
-
50
- function json (options) {
51
- var opts = options || {}
52
-
53
- var limit = typeof opts.limit !== 'number'
54
- ? bytes.parse(opts.limit || '100kb')
55
- : opts.limit
56
- var inflate = opts.inflate !== false
57
- var reviver = opts.reviver
58
- var strict = opts.strict !== false
59
- var type = opts.type || 'application/json'
60
- var verify = opts.verify || false
61
-
62
- if (verify !== false && typeof verify !== 'function') {
63
- throw new TypeError('option verify must be function')
64
- }
65
-
66
- // create the appropriate type checking function
67
- var shouldParse = typeof type !== 'function'
68
- ? typeChecker(type)
69
- : type
70
-
71
- function parse (body) {
72
- if (body.length === 0) {
73
- // special-case empty json body, as it's a common client-side mistake
74
- // TODO: maybe make this configurable or part of "strict" option
75
- return {}
76
- }
77
-
78
- if (strict) {
79
- var first = firstchar(body)
80
-
81
- if (first !== '{' && first !== '[') {
82
- debug('strict violation')
83
- throw createStrictSyntaxError(body, first)
84
- }
85
- }
86
-
87
- try {
88
- debug('parse json')
89
- return JSON.parse(body, reviver)
90
- } catch (e) {
91
- throw normalizeJsonSyntaxError(e, {
92
- message: e.message,
93
- stack: e.stack
94
- })
95
- }
96
- }
97
-
98
- return function jsonParser (req, res, next) {
99
- if (req._body) {
100
- debug('body already parsed')
101
- next()
102
- return
103
- }
104
-
105
- req.body = req.body || {}
106
-
107
- // skip requests without bodies
108
- if (!typeis.hasBody(req)) {
109
- debug('skip empty body')
110
- next()
111
- return
112
- }
113
-
114
- debug('content-type %j', req.headers['content-type'])
115
-
116
- // determine if request should be parsed
117
- if (!shouldParse(req)) {
118
- debug('skip parsing')
119
- next()
120
- return
121
- }
122
-
123
- // assert charset per RFC 7159 sec 8.1
124
- var charset = getCharset(req) || 'utf-8'
125
- if (charset.slice(0, 4) !== 'utf-') {
126
- debug('invalid charset')
127
- next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
128
- charset: charset,
129
- type: 'charset.unsupported'
130
- }))
131
- return
132
- }
133
-
134
- // read
135
- read(req, res, next, parse, debug, {
136
- encoding: charset,
137
- inflate: inflate,
138
- limit: limit,
139
- verify: verify
140
- })
141
- }
142
- }
143
-
144
- /**
145
- * Create strict violation syntax error matching native error.
146
- *
147
- * @param {string} str
148
- * @param {string} char
149
- * @return {Error}
150
- * @private
151
- */
152
-
153
- function createStrictSyntaxError (str, char) {
154
- var index = str.indexOf(char)
155
- var partial = index !== -1
156
- ? str.substring(0, index) + '#'
157
- : ''
158
-
159
- try {
160
- JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
161
- } catch (e) {
162
- return normalizeJsonSyntaxError(e, {
163
- message: e.message.replace('#', char),
164
- stack: e.stack
165
- })
166
- }
167
- }
168
-
169
- /**
170
- * Get the first non-whitespace character in a string.
171
- *
172
- * @param {string} str
173
- * @return {function}
174
- * @private
175
- */
176
-
177
- function firstchar (str) {
178
- var match = FIRST_CHAR_REGEXP.exec(str)
179
-
180
- return match
181
- ? match[1]
182
- : undefined
183
- }
184
-
185
- /**
186
- * Get the charset of a request.
187
- *
188
- * @param {object} req
189
- * @api private
190
- */
191
-
192
- function getCharset (req) {
193
- try {
194
- return (contentType.parse(req).parameters.charset || '').toLowerCase()
195
- } catch (e) {
196
- return undefined
197
- }
198
- }
199
-
200
- /**
201
- * Normalize a SyntaxError for JSON.parse.
202
- *
203
- * @param {SyntaxError} error
204
- * @param {object} obj
205
- * @return {SyntaxError}
206
- */
207
-
208
- function normalizeJsonSyntaxError (error, obj) {
209
- var keys = Object.getOwnPropertyNames(error)
210
-
211
- for (var i = 0; i < keys.length; i++) {
212
- var key = keys[i]
213
- if (key !== 'stack' && key !== 'message') {
214
- delete error[key]
215
- }
216
- }
217
-
218
- // replace stack before message for Node.js 0.10 and below
219
- error.stack = obj.stack.replace(error.message, obj.message)
220
- error.message = obj.message
221
-
222
- return error
223
- }
224
-
225
- /**
226
- * Get the simple type checker.
227
- *
228
- * @param {string} type
229
- * @return {function}
230
- */
231
-
232
- function typeChecker (type) {
233
- return function checkType (req) {
234
- return Boolean(typeis(req, type))
235
- }
236
- }
@@ -1,101 +0,0 @@
1
- /*!
2
- * body-parser
3
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * Module dependencies.
11
- */
12
-
13
- var bytes = require('bytes')
14
- var debug = require('debug')('body-parser:raw')
15
- var read = require('../read')
16
- var typeis = require('type-is')
17
-
18
- /**
19
- * Module exports.
20
- */
21
-
22
- module.exports = raw
23
-
24
- /**
25
- * Create a middleware to parse raw bodies.
26
- *
27
- * @param {object} [options]
28
- * @return {function}
29
- * @api public
30
- */
31
-
32
- function raw (options) {
33
- var opts = options || {}
34
-
35
- var inflate = opts.inflate !== false
36
- var limit = typeof opts.limit !== 'number'
37
- ? bytes.parse(opts.limit || '100kb')
38
- : opts.limit
39
- var type = opts.type || 'application/octet-stream'
40
- var verify = opts.verify || false
41
-
42
- if (verify !== false && typeof verify !== 'function') {
43
- throw new TypeError('option verify must be function')
44
- }
45
-
46
- // create the appropriate type checking function
47
- var shouldParse = typeof type !== 'function'
48
- ? typeChecker(type)
49
- : type
50
-
51
- function parse (buf) {
52
- return buf
53
- }
54
-
55
- return function rawParser (req, res, next) {
56
- if (req._body) {
57
- debug('body already parsed')
58
- next()
59
- return
60
- }
61
-
62
- req.body = req.body || {}
63
-
64
- // skip requests without bodies
65
- if (!typeis.hasBody(req)) {
66
- debug('skip empty body')
67
- next()
68
- return
69
- }
70
-
71
- debug('content-type %j', req.headers['content-type'])
72
-
73
- // determine if request should be parsed
74
- if (!shouldParse(req)) {
75
- debug('skip parsing')
76
- next()
77
- return
78
- }
79
-
80
- // read
81
- read(req, res, next, parse, debug, {
82
- encoding: null,
83
- inflate: inflate,
84
- limit: limit,
85
- verify: verify
86
- })
87
- }
88
- }
89
-
90
- /**
91
- * Get the simple type checker.
92
- *
93
- * @param {string} type
94
- * @return {function}
95
- */
96
-
97
- function typeChecker (type) {
98
- return function checkType (req) {
99
- return Boolean(typeis(req, type))
100
- }
101
- }
@@ -1,121 +0,0 @@
1
- /*!
2
- * body-parser
3
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
4
- * MIT Licensed
5
- */
6
-
7
- 'use strict'
8
-
9
- /**
10
- * Module dependencies.
11
- */
12
-
13
- var bytes = require('bytes')
14
- var contentType = require('content-type')
15
- var debug = require('debug')('body-parser:text')
16
- var read = require('../read')
17
- var typeis = require('type-is')
18
-
19
- /**
20
- * Module exports.
21
- */
22
-
23
- module.exports = text
24
-
25
- /**
26
- * Create a middleware to parse text bodies.
27
- *
28
- * @param {object} [options]
29
- * @return {function}
30
- * @api public
31
- */
32
-
33
- function text (options) {
34
- var opts = options || {}
35
-
36
- var defaultCharset = opts.defaultCharset || 'utf-8'
37
- var inflate = opts.inflate !== false
38
- var limit = typeof opts.limit !== 'number'
39
- ? bytes.parse(opts.limit || '100kb')
40
- : opts.limit
41
- var type = opts.type || 'text/plain'
42
- var verify = opts.verify || false
43
-
44
- if (verify !== false && typeof verify !== 'function') {
45
- throw new TypeError('option verify must be function')
46
- }
47
-
48
- // create the appropriate type checking function
49
- var shouldParse = typeof type !== 'function'
50
- ? typeChecker(type)
51
- : type
52
-
53
- function parse (buf) {
54
- return buf
55
- }
56
-
57
- return function textParser (req, res, next) {
58
- if (req._body) {
59
- debug('body already parsed')
60
- next()
61
- return
62
- }
63
-
64
- req.body = req.body || {}
65
-
66
- // skip requests without bodies
67
- if (!typeis.hasBody(req)) {
68
- debug('skip empty body')
69
- next()
70
- return
71
- }
72
-
73
- debug('content-type %j', req.headers['content-type'])
74
-
75
- // determine if request should be parsed
76
- if (!shouldParse(req)) {
77
- debug('skip parsing')
78
- next()
79
- return
80
- }
81
-
82
- // get charset
83
- var charset = getCharset(req) || defaultCharset
84
-
85
- // read
86
- read(req, res, next, parse, debug, {
87
- encoding: charset,
88
- inflate: inflate,
89
- limit: limit,
90
- verify: verify
91
- })
92
- }
93
- }
94
-
95
- /**
96
- * Get the charset of a request.
97
- *
98
- * @param {object} req
99
- * @api private
100
- */
101
-
102
- function getCharset (req) {
103
- try {
104
- return (contentType.parse(req).parameters.charset || '').toLowerCase()
105
- } catch (e) {
106
- return undefined
107
- }
108
- }
109
-
110
- /**
111
- * Get the simple type checker.
112
- *
113
- * @param {string} type
114
- * @return {function}
115
- */
116
-
117
- function typeChecker (type) {
118
- return function checkType (req) {
119
- return Boolean(typeis(req, type))
120
- }
121
- }