@jsreport/jsreport-core 4.0.1 → 4.1.0

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/README.md CHANGED
@@ -282,6 +282,13 @@ jsreport.documentStore.collection('templates')
282
282
 
283
283
  ## Changelog
284
284
 
285
+ ### 4.1.0
286
+
287
+ - update deps to fix npm audit
288
+ - fix memory being held when timeouts are large
289
+ - fix node.js 21 compatibility when sandbox is used (`trustUserCode: false`
290
+ - support using different cache key per template engine if it supports it
291
+
285
292
  ### 4.0.1
286
293
 
287
294
  - fix parameter mutations passed to store methods producing unexpected changes in store
@@ -29,7 +29,7 @@ module.exports = (reporter) => {
29
29
  const profilerRequestMap = new Map()
30
30
 
31
31
  function runInProfilerChain (fnOrOptions, req) {
32
- if (req.context.profiling.mode === 'disabled') {
32
+ if (req.context.profiling == null || req.context.profiling.mode === 'disabled') {
33
33
  return
34
34
  }
35
35
 
@@ -352,7 +352,7 @@ module.exports = (reporter) => {
352
352
  type: 'log',
353
353
  level: info.level,
354
354
  message: info.message,
355
- previousOperationId: req.context.profiling.lastOperationId
355
+ previousOperationId: req.context.profiling?.lastOperationId
356
356
  }, req)],
357
357
  log: false
358
358
  }, req)
@@ -266,7 +266,7 @@ class MainReporter extends Reporter {
266
266
 
267
267
  this._workersManager = this._workersManagerFactory
268
268
  ? this._workersManagerFactory(workersManagerOptions, workersManagerSystemOptions)
269
- : WorkersManager(workersManagerOptions, workersManagerSystemOptions, this.logger)
269
+ : WorkersManager(workersManagerOptions, workersManagerSystemOptions)
270
270
 
271
271
  const workersStart = new Date().getTime()
272
272
 
@@ -192,7 +192,9 @@ module.exports = (reporter) => {
192
192
  executionAsyncResultsMap.set(executionId, asyncResultMap)
193
193
  executionFnParsedParamsMap.get(req.context.id).get(executionFnParsedParamsKey).resolve({ require, console, topLevelFunctions, context })
194
194
 
195
- const key = `template:${content}:${engine.name}`
195
+ const key = engine.buildTemplateCacheKey
196
+ ? engine.buildTemplateCacheKey({ content }, req)
197
+ : `template:${content}:${engine.name}`
196
198
 
197
199
  if (!templatesCache.has(key)) {
198
200
  try {
@@ -3,7 +3,6 @@
3
3
  *
4
4
  * Orchestration of the rendering process
5
5
  */
6
- const { Readable } = require('stream')
7
6
  const extend = require('node.extend.without.arrays')
8
7
  const ExecuteEngine = require('./executeEngine')
9
8
  const Request = require('../../shared/request')
@@ -101,10 +100,6 @@ module.exports = (reporter) => {
101
100
 
102
101
  async function afterRender (reporter, request, response) {
103
102
  await reporter.afterRenderListeners.fire(request, response)
104
-
105
- response.stream = Readable.from(response.content)
106
- response.result = response.stream
107
-
108
103
  return response
109
104
  }
110
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsreport/jsreport-core",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "description": "javascript based business reporting",
5
5
  "keywords": [
6
6
  "report",
@@ -36,15 +36,15 @@
36
36
  "test:watch": "mocha --watch --recursive test"
37
37
  },
38
38
  "dependencies": {
39
- "@babel/code-frame": "7.12.13",
40
- "@babel/parser": "7.14.4",
41
- "@babel/traverse": "7.12.9",
39
+ "@babel/code-frame": "7.23.5",
40
+ "@babel/parser": "7.23.5",
41
+ "@babel/traverse": "7.23.5",
42
42
  "@colors/colors": "1.5.0",
43
- "@jsreport/advanced-workers": "2.0.0",
43
+ "@jsreport/advanced-workers": "2.0.1",
44
44
  "@jsreport/mingo": "2.4.1",
45
45
  "@jsreport/reap": "0.1.0",
46
46
  "@jsreport/serializator": "1.0.0",
47
- "@jsreport/ses": "1.0.0",
47
+ "@jsreport/ses": "1.0.1",
48
48
  "ajv": "6.12.6",
49
49
  "app-root-path": "3.0.0",
50
50
  "bytes": "3.1.2",