@jsreport/jsreport-core 3.9.0 → 3.10.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 +15 -0
- package/lib/main/reporter.js +20 -1
- package/lib/main/templates.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -282,6 +282,21 @@ jsreport.documentStore.collection('templates')
|
|
|
282
282
|
|
|
283
283
|
## Changelog
|
|
284
284
|
|
|
285
|
+
### 3.10.0
|
|
286
|
+
|
|
287
|
+
- `mainReporter.executeWorkerAction` now supports cancellation with `AbortController.signal`
|
|
288
|
+
- add support for specifying what are the main document properties of templates entitySet
|
|
289
|
+
|
|
290
|
+
### 3.9.0
|
|
291
|
+
|
|
292
|
+
- add more store methods `collection.findAdmin`, `collection.findOneAdmin`, `reporter.adminRequest` to easily allow execure store queries without taking into account permissions
|
|
293
|
+
- improve logging for child requests and user level logs
|
|
294
|
+
- differentiate between template not found errors and permissions related errors (it is now more clean what is the cause of specific error)
|
|
295
|
+
- normalize to error when non-errors are throw (like throw "string")
|
|
296
|
+
- improve errors in helpers (it now includes the helper name)
|
|
297
|
+
- improve error message when template was not found in child request
|
|
298
|
+
- improve error handling in sandbox
|
|
299
|
+
|
|
285
300
|
### 3.8.1
|
|
286
301
|
|
|
287
302
|
- update vm2 for fix security issue
|
package/lib/main/reporter.js
CHANGED
|
@@ -557,6 +557,16 @@ class MainReporter extends Reporter {
|
|
|
557
557
|
timeout
|
|
558
558
|
})
|
|
559
559
|
|
|
560
|
+
const handleAbortSignal = () => {
|
|
561
|
+
if (worker) {
|
|
562
|
+
worker.release(req).catch((e) => this.logger.error('Failed to release worker ' + e))
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
if (options.signal && !options.worker) {
|
|
567
|
+
options.signal.addEventListener('abort', handleAbortSignal, { once: true })
|
|
568
|
+
}
|
|
569
|
+
|
|
560
570
|
try {
|
|
561
571
|
const result = await worker.execute({
|
|
562
572
|
actionName,
|
|
@@ -579,7 +589,16 @@ class MainReporter extends Reporter {
|
|
|
579
589
|
return result
|
|
580
590
|
} finally {
|
|
581
591
|
if (!options.worker) {
|
|
582
|
-
|
|
592
|
+
let shouldRelease = true
|
|
593
|
+
|
|
594
|
+
if (options.signal) {
|
|
595
|
+
options.signal.removeEventListener('abort', handleAbortSignal)
|
|
596
|
+
shouldRelease = options.signal.aborted !== true
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if (shouldRelease) {
|
|
600
|
+
await worker.release(req)
|
|
601
|
+
}
|
|
583
602
|
}
|
|
584
603
|
}
|
|
585
604
|
}
|
package/lib/main/templates.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
module.exports = (reporter) => {
|
|
3
3
|
reporter.documentStore.registerEntityType('TemplateType', {
|
|
4
4
|
name: { type: 'Edm.String' },
|
|
5
|
-
content: { type: 'Edm.String', document: { extension: 'html', engine: true } },
|
|
5
|
+
content: { type: 'Edm.String', document: { main: true, extension: 'html', engine: true } },
|
|
6
6
|
recipe: { type: 'Edm.String' },
|
|
7
|
-
helpers: { type: 'Edm.String', document: { extension: 'js' }, schema: { type: 'object' } },
|
|
7
|
+
helpers: { type: 'Edm.String', document: { main: true, extension: 'js' }, schema: { type: 'object' } },
|
|
8
8
|
engine: { type: 'Edm.String' }
|
|
9
9
|
}, true)
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsreport/jsreport-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "javascript based business reporting",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"report",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"diff-match-patch": "1.0.5",
|
|
55
55
|
"enhanced-resolve": "5.8.3",
|
|
56
56
|
"has-own-deep": "1.1.0",
|
|
57
|
-
"isbinaryfile": "
|
|
57
|
+
"isbinaryfile": "5.0.0",
|
|
58
58
|
"listener-collection": "2.0.0",
|
|
59
59
|
"lodash.get": "4.4.2",
|
|
60
60
|
"lodash.groupby": "4.6.0",
|