@jsreport/jsreport-core 4.7.1 → 4.9.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,10 @@ jsreport.documentStore.collection('templates')
282
282
 
283
283
  ## Changelog
284
284
 
285
+ ### 4.8.0
286
+ - update minimum nodejs to 22.18
287
+ - expose `version` to the jsreport-proxy
288
+
285
289
  ### 4.7.1
286
290
 
287
291
  - update @jsreport/ses to 1.4.0 to fix audit
@@ -396,9 +396,11 @@ class MainReporter extends Reporter {
396
396
  }
397
397
 
398
398
  worker = await this._workersManager.allocate(req, {
399
- timeout: this.getReportTimeout(req)
399
+ timeout: req.context.reportTimeoutCountAfterWorkerAllocated ? 0 : this.getReportTimeout(req)
400
400
  })
401
401
 
402
+ req.context.workerAllocatedTimestamp = new Date().getTime()
403
+
402
404
  if (options.abortEmitter) {
403
405
  options.abortEmitter.once('abort', () => {
404
406
  if (workerAborted) {
@@ -61,7 +61,9 @@ class Reporter extends EventEmitter {
61
61
  * @public Ensures that we get the proper report timeout in case when custom timeout per request was enabled
62
62
  */
63
63
  getReportTimeout (req) {
64
- const elapsedTime = req.context.startTimestamp ? (new Date().getTime() - req.context.startTimestamp) : 0
64
+ const startTimestamp = req.context.reportTimeoutCountAfterWorkerAllocated ? req.context.workerAllocatedTimestamp : req.context.startTimestamp
65
+
66
+ const elapsedTime = startTimestamp ? (new Date().getTime() - startTimestamp) : 0
65
67
  if (
66
68
  this.options.enableRequestReportTimeout &&
67
69
  req.options != null &&
@@ -42,6 +42,8 @@ module.exports = (reporter) => (proxy, req) => {
42
42
  }
43
43
  }
44
44
 
45
+ proxy.version = reporter.version
46
+
45
47
  // expose tempfile functions
46
48
  const createTempFileFns = [
47
49
  'getTempFilePath', 'openTempFile', 'writeTempFileSync', 'writeTempFile',
@@ -61,6 +61,7 @@ class WorkerReporter extends Reporter {
61
61
  this.addRequestContextMetaConfig('id', { sandboxReadOnly: true })
62
62
  this.addRequestContextMetaConfig('reportCounter', { sandboxReadOnly: true })
63
63
  this.addRequestContextMetaConfig('startTimestamp', { sandboxReadOnly: true })
64
+ this.addRequestContextMetaConfig('workerAllocatedTimestamp', { sandboxReadOnly: true })
64
65
  this.addRequestContextMetaConfig('logs', { sandboxReadOnly: true })
65
66
  this.addRequestContextMetaConfig('isChildRequest', { sandboxReadOnly: true })
66
67
  this.addRequestContextMetaConfig('originalInputDataIsEmpty', { sandboxReadOnly: true })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsreport/jsreport-core",
3
- "version": "4.7.1",
3
+ "version": "4.9.0",
4
4
  "description": "javascript based business reporting",
5
5
  "keywords": [
6
6
  "report",
@@ -32,7 +32,7 @@
32
32
  "test/extensions/validExtensions/listeners"
33
33
  ],
34
34
  "scripts": {
35
- "test": "mocha --timeout 5000 --recursive test --exit && standard",
35
+ "test": "mocha --timeout 8000 --recursive test --exit && standard",
36
36
  "test:watch": "mocha --watch --recursive test"
37
37
  },
38
38
  "dependencies": {
@@ -40,11 +40,11 @@
40
40
  "@babel/parser": "7.23.5",
41
41
  "@babel/traverse": "7.23.5",
42
42
  "@colors/colors": "1.5.0",
43
- "@jsreport/advanced-workers": "2.1.0",
43
+ "@jsreport/advanced-workers": "2.2.0",
44
44
  "@jsreport/mingo": "2.4.1",
45
45
  "@jsreport/reap": "0.1.0",
46
- "@jsreport/serializator": "1.0.1",
47
- "@jsreport/ses": "1.3.0",
46
+ "@jsreport/serializator": "1.1.0",
47
+ "@jsreport/ses": "1.4.0",
48
48
  "ajv": "6.12.6",
49
49
  "app-root-path": "3.0.0",
50
50
  "bytes": "3.1.2",
@@ -52,12 +52,12 @@
52
52
  "debug": "4.3.2",
53
53
  "decamelize": "2.0.0",
54
54
  "deepmerge": "2.1.0",
55
- "diff": "3.5.0",
55
+ "diff": "4.0.4",
56
56
  "diff-match-patch": "1.0.5",
57
57
  "enhanced-resolve": "5.8.3",
58
58
  "has-own-deep": "1.1.0",
59
59
  "isbinaryfile": "5.0.0",
60
- "listener-collection": "2.0.0",
60
+ "listener-collection": "2.1.0",
61
61
  "lodash.get": "4.4.2",
62
62
  "lodash.groupby": "4.6.0",
63
63
  "lodash.omit": "4.5.0",
@@ -79,14 +79,14 @@
79
79
  "devDependencies": {
80
80
  "@node-rs/jsonwebtoken": "0.2.0",
81
81
  "jsdom": "24.1.0",
82
- "mocha": "10.1.0",
82
+ "mocha": "11.7.5",
83
83
  "should": "13.2.3",
84
84
  "standard": "16.0.4",
85
85
  "std-mocks": "1.0.1",
86
86
  "winston-loggly-bulk": "3.2.1"
87
87
  },
88
88
  "engines": {
89
- "node": ">=18.15"
89
+ "node": ">=22.18"
90
90
  },
91
91
  "standard": {
92
92
  "env": {