@jsreport/jsreport-core 3.3.0 → 3.4.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
+ ### 3.4.0
286
+
287
+ - fix for reports execution
288
+ - fix for render profiling
289
+ - fix for blob storage remove
290
+ - update deps to fix npm audit
291
+
285
292
  ### 3.1.0
286
293
 
287
294
  - fix blob storage append to not existing blob (mongo)
@@ -133,15 +133,9 @@ async function loadConfig (defaults, options, loadExternal = true) {
133
133
  const currentValue = obj.value[extensionKey]
134
134
  delete obj.value[extensionKey]
135
135
 
136
- if (realExtensionName !== extensionKey && obj.value[realExtensionName]) {
137
- obj.value[realExtensionName] = extend(
138
- true,
139
- obj.value[realExtensionName],
140
- currentValue
141
- )
142
- } else {
143
- obj.value[realExtensionName] = currentValue
144
- }
136
+ // the camelCase key version should already contain all merged values
137
+ // (from both the real extension name with "-" and camel case)
138
+ obj.value[realExtensionName] = currentValue
145
139
  })
146
140
  } else if (!normalize && obj.key.startsWith('extensions')) {
147
141
  // the transform ensures that camelCase alias keys of extensions
@@ -405,6 +405,7 @@ class MainReporter extends Reporter {
405
405
  if (req.context.returnResponseAndKeepWorker) {
406
406
  keepWorker = true
407
407
  res.stream = Readable.from(res.content)
408
+ await this.afterRenderListeners.fire(req, res)
408
409
  return res
409
410
  }
410
411
 
@@ -8,7 +8,7 @@ class Profiler {
8
8
  constructor (reporter) {
9
9
  this.reporter = reporter
10
10
 
11
- this.reporter.addRequestContextMetaConfig('profiling', { sandboxReadOnly: true })
11
+ this.reporter.addRequestContextMetaConfig('profiling', { sandboxHidden: true })
12
12
  this.reporter.addRequestContextMetaConfig('resolvedTemplate', { sandboxHidden: true })
13
13
 
14
14
  this.reporter.beforeMainActionListeners.add('profiler', (actionName, data, req) => {
@@ -93,7 +93,7 @@ class Profiler {
93
93
 
94
94
  m.req = { diff: createPatch('req', req.context.profiling.reqLastVal || '', stringifiedReq, 0) }
95
95
 
96
- req.context.profiling.resLastVal = res.content
96
+ req.context.profiling.resLastVal = (res.content == null || isbinaryfile(res.content)) ? null : res.content.toString()
97
97
  req.context.profiling.resMetaLastVal = stringifiedResMeta
98
98
  req.context.profiling.reqLastVal = stringifiedReq
99
99
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsreport/jsreport-core",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "javascript based business reporting",
5
5
  "keywords": [
6
6
  "report",
@@ -53,8 +53,8 @@
53
53
  "lodash.set": "4.3.2",
54
54
  "lru-cache": "4.1.1",
55
55
  "ms": "2.1.3",
56
- "nanoid": "3.1.16",
57
- "nconf": "0.10.0",
56
+ "nanoid": "3.2.0",
57
+ "nconf": "0.11.3",
58
58
  "node.extend.without.arrays": "1.1.6",
59
59
  "reap2": "1.0.1",
60
60
  "semver": "7.3.5",
@@ -18,4 +18,8 @@ module.exports = (storage) => {
18
18
  const buf = await storage().read('foldera/folderb/myblob.txt')
19
19
  buf.toString().should.be.eql('hula')
20
20
  })
21
+
22
+ it('remove shouldnt fail for missing blob', async () => {
23
+ await storage().remove('foo')
24
+ })
21
25
  }