jsreport 2.11.0 → 3.0.1

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
@@ -1,87 +1,5 @@
1
-
2
-
3
-
4
1
  # jsreport
5
2
 
6
- [![Join the chat at https://gitter.im/jsreport/jsreport](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jsreport/jsreport?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
- [![NPM Version](http://img.shields.io/npm/v/jsreport.svg?style=flat-square)](https://npmjs.com/package/jsreport)
8
- [![NPM Downloads](https://img.shields.io/npm/dt/jsreport.svg?style=flat-square)](https://npmjs.com/package/jsreport)
9
- [![Docker Pulls](https://img.shields.io/docker/pulls/jsreport/jsreport)](https://hub.docker.com/r/jsreport/jsreport)
10
- [![Build Status](https://travis-ci.org/jsreport/jsreport.png?branch=master)](https://travis-ci.org/jsreport/jsreport)
11
-
12
- **Official distribution of jsreport**<br/>
13
- *An open-source platform for designing and rendering various reports.*
14
-
15
- jsreport is a reporting server which lets developers define reports using javascript templating engines (like jsrender or handlebars). It supports various report output formats like html, pdf, excel and others. It also includes advanced reporting features like user management, REST API, scheduling, designer or sending emails.
16
-
17
- You can find more information on the official project website https://jsreport.net
18
-
19
- ![studio](https://github.com/jsreport/website/blob/master/public/img/jsreport-demo.gif?raw=true)
20
-
21
- ## Installation
22
- see [https://jsreport.net/on-prem](http://jsreport.net/on-prem)
23
-
24
- > **npm install -g jsreport-cli**<br/>
25
- > **jsreport init**<br/>
26
- > **jsreport configure**<br/>
27
- > **jsreport start**
28
-
29
- To change environment use cmd `set NODE_ENV=development` or use options your IDE provides. If you don't specify node environment jsreport assumes `development` as default.
30
-
31
- ## Documentation
32
-
33
- see [https://jsreport.net/learn](https://jsreport.net/learn) for an overview of concepts, guides, clients and general documentation.
34
-
35
- ## Configuration
36
- jsreport loads `jsreport.config.json` configuration file on start. The configuration file is the most common way to adapt jsreport settings like http port. In addition to configuration file you can use also corresponding command-line arguments or options passed directly through nodejs code.
37
-
38
- See [config](https://jsreport.net/learn/configuration) documentation for details.
39
-
40
- ## Extensions
41
- The jsreport official distribution includes the most of the currently implemented extensions. However, there are still new extensions popping up which are not yet part of jsreport and you may like to additionally install it. See the list of extensions [here](https://github.com/jsreport/jsreport-core#list-of-extensions).
42
-
43
- You are also not limited to extensions we provide to you and you can implement your own. See the [Implementing custom extension](https://jsreport.net/learn/custom-extension) article.
44
-
45
- ## Node.js
46
-
47
- You can find documentation for adapting this jsreport distribution using nodejs and also information for integrating it into an existing nodejs application in the article [adapting jsreport](https://jsreport.net/learn/adapting-jsreport).
48
-
49
- This distribution includes many extensions like jsreport studio you may not need. To start from the ground see repository [jsreport-core](https://github.com/jsreport/jsreport-core).
50
-
51
- ## Contributions
52
-
53
- jsreport is split into many separated repositories usually representing extensions or other reusable libraries. Please forward your contributions to the dedicated repository.
54
-
55
- ## Roadmap
56
- - integrate to the xlsx recipe the same templating capabilities as in the docx
57
- - pdf linearization, PDF/A
58
- - docx/pptx - simple html embedding, raw openxml, memory optimization
59
- - word extension for reports design
60
- - async studio rendering - real-time log output
61
- - signing jsreport.exe
62
- - html-to-xlsx - images, filters...
63
- - nodejs workers usage
64
- - drag and drop designer [#121](../../issues/121)
65
-
66
- More in the [backlog](https://github.com/jsreport/jsreport/issues).
67
-
68
- **Missing a feature? Submit a feature request.**
69
-
70
- ## Vulnerabilities
71
-
72
- We guarantee every release is stable and has 0 vulnerabilities mentioned in the npm audit. When you see a security warning in your audit, please just wait until we release the next version with the dependencies update, there is no need to create a ticket for it. In case you see a direct impact on jsreport security, please send us an email and we will apply a direct hotfix if it will be possible.
73
-
74
- ## Licensing
75
- Copyright (C) 2020 Jan Blaha
76
-
77
- Do you want to use jsreport for a personal purpose, in a school project or a non-profit organization?
78
- Then you don't need the author's permission, just go on and use it. You can use jsreport without the author's permission
79
- also when having a maximum 5 templates stored in jsreport storage.
80
-
81
- For commercial projects using more than 5 stored report templates see [Pricing page](https://jsreport.net/buy).
82
-
83
- Under any of the licenses, free or not, you are allowed to download the source code and make your own edits.
84
-
85
- In every case, there are no warranties of any kind provided:
3
+ **The main jsreport distribution package**
86
4
 
87
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5
+ See the readme in the root of the monorepo [README](https://github.com/jsreport/jsreport/blob/master/README.md).
package/index.js CHANGED
@@ -1,75 +1,39 @@
1
- 'use strict'
2
-
3
- /*!
4
- * Copyright(c) 2018 Jan Blaha
5
- */
6
-
7
- var semver = require('semver')
8
- var packageJson = require('./package.json')
9
-
10
- if (!semver.satisfies(process.versions.node, packageJson.engines.node)) {
11
- console.error(
12
- 'jsreport requires to have installed a nodejs version of at least ' +
13
- packageJson.engines.node +
14
- ' but you have installed version ' + process.versions.node + '. please update your nodejs version and try again'
15
- )
16
-
17
- process.exit(1)
18
- }
19
-
20
- const extend = require('node.extend.without.arrays')
21
- const path = require('path')
22
- const core = require('jsreport-core')
23
- const main = require('./lib/main')
24
-
25
- const renderDefaults = {
26
- store: { provider: 'memory' },
27
- blobStorage: { provider: 'memory' },
28
- rootDirectory: path.join(__dirname, '../../'),
29
- logger: {
30
- console: { silent: true },
31
- file: { silent: true },
32
- error: { silent: true }
33
- },
34
- extensions: {
35
- express: { enabled: false },
36
- scheduling: { enabled: false },
37
- authentication: { enabled: false },
38
- authorization: { enabled: false },
39
- studio: { enabled: false },
40
- 'sample-template': { enabled: false },
41
- 'version-control': { enabled: false },
42
- 'public-templates': { enabled: false }
43
- }
44
- }
45
-
46
- function render (req) {
47
- if (!core.Reporter.instance) {
48
- return main({
49
- parentModuleDirectory: path.dirname(module.parent.filename)
50
- }, renderDefaults).init().then(function () {
51
- return core.Reporter.instance.render(req)
52
- })
53
- }
54
-
55
- return core.Reporter.instance.render(req)
56
- }
57
-
58
- function extendDefaults (config) {
59
- return extend(true, renderDefaults, config)
60
- }
61
-
62
- module.exports = function (options, defaults) {
63
- options = options || {}
64
-
65
- options.parentModuleDirectory = path.dirname(module.parent.filename)
66
-
67
- return main(options, defaults)
68
- }
69
-
70
- module.exports.Reporter = core.Reporter
71
- module.exports.renderDefaults = renderDefaults
72
- module.exports.render = render
73
- module.exports.extendDefaults = extendDefaults
74
- module.exports.reporter = core.Reporter.instance
75
- module.exports.core = core
1
+ 'use strict'
2
+
3
+ /*!
4
+ * Copyright(c) 2018 Jan Blaha
5
+ */
6
+
7
+ const semver = require('semver')
8
+ const packageJson = require('./package.json')
9
+
10
+ if (!semver.satisfies(process.versions.node, packageJson.engines.node)) {
11
+ console.error(
12
+ 'jsreport requires to have installed a nodejs version of at least ' +
13
+ packageJson.engines.node +
14
+ ' but you have installed version ' + process.versions.node + '. please update your nodejs version and try again'
15
+ )
16
+
17
+ process.exit(1)
18
+ }
19
+
20
+ const path = require('path')
21
+ const core = require('@jsreport/jsreport-core')
22
+ const main = require('./lib/main')
23
+
24
+ module.exports = function (options, defaults) {
25
+ options = options || {}
26
+
27
+ // when jsreport is loaded from ESM, module.parent does not exists
28
+ if (module.parent) {
29
+ options.parentModuleDirectory = path.dirname(module.parent.filename)
30
+ } else {
31
+ // we set empty value to ensure jsreport-core does not override it with its custom default
32
+ options.parentModuleDirectory = ''
33
+ }
34
+
35
+ return main(options, defaults)
36
+ }
37
+
38
+ module.exports.Reporter = core.Reporter
39
+ module.exports.core = core
@@ -1,56 +1,35 @@
1
- const path = require('path')
2
- const mkdirp = require('mkdirp')
3
-
4
- function addTransports (reporter) {
5
- // this condition prevents adding the same transports again.
6
- // usually this only happens when testing where there is a
7
- // lot of jsreport instances created
8
- if (
9
- reporter.logger.transports.console ||
10
- reporter.logger.transports.file ||
11
- reporter.logger.transports.error
12
- ) {
13
- return
14
- }
15
-
16
- const defaultLevel = reporter.options.mode === 'production' ? 'info' : 'debug'
17
-
18
- reporter.options.logger.console = Object.assign({
19
- transport: 'console',
20
- level: defaultLevel,
21
- timestamp: true,
22
- colorize: true,
23
- handleExceptions: true,
24
- humanReadableUnhandledException: true
25
- }, reporter.options.logger.console)
26
-
27
- reporter.options.logger.file = Object.assign({
28
- transport: 'file',
29
- level: defaultLevel,
30
- filename: 'logs/reporter.log',
31
- maxsize: 10485760,
32
- handleExceptions: true,
33
- humanReadableUnhandledException: true,
34
- json: false
35
- }, reporter.options.logger.file)
36
-
37
- reporter.options.logger.error = Object.assign({
38
- transport: 'file',
39
- level: 'error',
40
- filename: 'logs/error.log',
41
- handleExceptions: true,
42
- humanReadableUnhandledException: true,
43
- json: false
44
- }, reporter.options.logger.error)
45
-
46
- // winston doesn't create the directories for logs automatically
47
- // we don't want to do it for developers as well, but also we want to make jsreport with default config running
48
- // without errors, so we break the consistency here and precreate the logs directory if the config equals to default
49
- if (reporter.options.logger.file.filename === 'logs/reporter.log' && reporter.options.logger.file.silent !== true) {
50
- mkdirp.sync(path.dirname(reporter.options.logger.file.filename))
51
- }
52
- }
53
-
54
- module.exports = (reporter) => {
55
- addTransports(reporter)
56
- }
1
+ const { loggerFormat, createDefaultLoggerFormat } = require('@jsreport/jsreport-core')
2
+ const defaultLoggerFormatWithTimestamp = createDefaultLoggerFormat({ timestamp: true })
3
+
4
+ function addTransports (reporter) {
5
+ reporter.options.logger.console = Object.assign({
6
+ transport: 'console',
7
+ level: 'debug',
8
+ handleExceptions: true,
9
+ format: loggerFormat.combine(
10
+ loggerFormat.colorize(),
11
+ defaultLoggerFormatWithTimestamp()
12
+ )
13
+ }, reporter.options.logger.console)
14
+
15
+ reporter.options.logger.file = Object.assign({
16
+ transport: 'file',
17
+ level: 'debug',
18
+ filename: 'logs/reporter.log',
19
+ maxsize: 10485760,
20
+ handleExceptions: true
21
+ }, reporter.options.logger.file)
22
+
23
+ reporter.options.logger.error = Object.assign({
24
+ transport: 'file',
25
+ level: 'error',
26
+ filename: 'logs/error.log',
27
+ handleExceptions: true
28
+ }, reporter.options.logger.error)
29
+
30
+ // nothing else to do here, winston creates the directory specified in file transport .filename automatically
31
+ }
32
+
33
+ module.exports = (reporter) => {
34
+ addTransports(reporter)
35
+ }
package/lib/main.js CHANGED
@@ -1,20 +1,20 @@
1
- const path = require('path')
2
- const core = require('jsreport-core')
3
- const packagejson = require('../package.json')
4
- const extendConfig = require('./extendConfig')
5
-
6
- module.exports = (options, defaults) => {
7
- options = options || {}
8
-
9
- const defaultsToUse = Object.assign({}, {
10
- discover: true,
11
- rootDirectory: path.join(__dirname, '../../../'),
12
- loadConfig: true
13
- }, defaults)
14
-
15
- const reporter = core(options, defaultsToUse)
16
-
17
- reporter.version = packagejson.version
18
-
19
- return reporter.afterConfigLoaded(extendConfig)
20
- }
1
+ const path = require('path')
2
+ const core = require('@jsreport/jsreport-core')
3
+ const packageJson = require('../package.json')
4
+ const extendConfig = require('./extendConfig')
5
+
6
+ module.exports = (options, defaults) => {
7
+ options = options || {}
8
+
9
+ const defaultsToUse = Object.assign({}, {
10
+ discover: true,
11
+ rootDirectory: path.join(__dirname, '../../../'),
12
+ loadConfig: true
13
+ }, defaults)
14
+
15
+ const reporter = core(options, defaultsToUse)
16
+
17
+ reporter.version = packageJson.version
18
+
19
+ return reporter.afterConfigLoaded(extendConfig)
20
+ }
package/package.json CHANGED
@@ -1,14 +1,6 @@
1
1
  {
2
2
  "name": "jsreport",
3
- "version": "2.11.0",
4
- "author": {
5
- "name": "Jan Blaha",
6
- "email": "jan.blaha@hotmail.com"
7
- },
8
- "contributors": [
9
- "BJR Matos <bjrmatos@gmail.com> (https://github.com/bjrmatos)",
10
- "Jan Blaha"
11
- ],
3
+ "version": "3.0.1",
12
4
  "description": "javascript based business reporting",
13
5
  "keywords": [
14
6
  "report",
@@ -16,97 +8,97 @@
16
8
  "javascript"
17
9
  ],
18
10
  "homepage": "https://github.com/jsreport/jsreport",
11
+ "bugs": {
12
+ "url": "https://github.com/jsreport/jsreport/issues"
13
+ },
19
14
  "repository": {
20
15
  "type": "git",
21
16
  "url": "git@github.com:jsreport/jsreport.git"
22
17
  },
23
- "standard": {
24
- "ignore": [
25
- "data/**"
26
- ],
27
- "globals": [
28
- "describe",
29
- "it",
30
- "beforeEach",
31
- "afterEach",
32
- "define"
33
- ]
18
+ "license": "LGPL",
19
+ "author": {
20
+ "name": "Jan Blaha",
21
+ "email": "jan.blaha@hotmail.com"
34
22
  },
35
- "jsreport": {
36
- "entryPoint": "server.js"
23
+ "contributors": [
24
+ {
25
+ "name": "BJR Matos",
26
+ "email": "bjrmatos@gmail.com",
27
+ "url": "https://github.com/bjrmatos"
28
+ },
29
+ {
30
+ "name": "Jan Blaha"
31
+ }
32
+ ],
33
+ "main": "index.js",
34
+ "files": [
35
+ "lib",
36
+ "index.js",
37
+ "example.server.js"
38
+ ],
39
+ "scripts": {
40
+ "test": "mocha test --timeout 35000 && standard"
37
41
  },
38
42
  "dependencies": {
39
- "handlebars": "4.7.6",
40
- "jsreport-assets": "1.7.0",
41
- "jsreport-authentication": "2.6.1",
42
- "jsreport-authorization": "2.4.0",
43
- "jsreport-base": "2.0.2",
44
- "jsreport-browser-client": "2.2.2",
45
- "jsreport-child-templates": "1.4.0",
46
- "jsreport-chrome-pdf": "1.10.0",
47
- "jsreport-cli": "2.2.5",
48
- "jsreport-core": "2.10.1",
49
- "jsreport-data": "2.4.0",
50
- "jsreport-debug": "2.1.3",
51
- "jsreport-docx": "2.9.0",
52
- "jsreport-express": "2.8.1",
53
- "jsreport-freeze": "2.0.0",
54
- "jsreport-fs-store": "2.9.1",
55
- "jsreport-handlebars": "2.1.0",
56
- "jsreport-html-to-xlsx": "2.8.3",
57
- "jsreport-import-export": "2.1.1",
58
- "jsreport-jsrender": "2.1.1",
59
- "jsreport-licensing": "2.2.3",
60
- "jsreport-pdf-utils": "1.10.1",
61
- "jsreport-pptx": "0.7.0",
62
- "jsreport-public-templates": "2.2.0",
63
- "jsreport-reports": "2.5.1",
64
- "jsreport-resources": "2.1.0",
65
- "jsreport-sample-template": "2.6.1",
66
- "jsreport-scheduling": "2.5.0",
67
- "jsreport-scripts": "2.6.0",
68
- "jsreport-static-pdf": "0.4.0",
69
- "jsreport-studio": "2.10.1",
70
- "jsreport-studio-theme-dark": "0.3.0",
71
- "jsreport-tags": "2.5.0",
72
- "jsreport-templates": "2.4.0",
73
- "jsreport-text": "2.0.0",
74
- "jsreport-version-control": "1.6.0",
75
- "jsreport-xlsx": "2.5.0",
76
- "mkdirp": "0.5.5",
77
- "node.extend.without.arrays": "1.1.6",
78
- "puppeteer": "2.0.0",
43
+ "handlebars": "4.7.7",
44
+ "@jsreport/jsreport-assets": "3.0.0",
45
+ "@jsreport/jsreport-authentication": "3.0.0",
46
+ "@jsreport/jsreport-authorization": "3.0.1",
47
+ "@jsreport/jsreport-base": "3.0.0",
48
+ "@jsreport/jsreport-browser-client": "3.0.0",
49
+ "@jsreport/jsreport-child-templates": "3.0.0",
50
+ "@jsreport/jsreport-chrome-pdf": "3.0.0",
51
+ "@jsreport/jsreport-cli": "3.0.0",
52
+ "@jsreport/jsreport-components": "3.0.0",
53
+ "@jsreport/jsreport-core": "3.0.1",
54
+ "@jsreport/jsreport-data": "3.0.0",
55
+ "@jsreport/jsreport-docx": "3.0.0",
56
+ "@jsreport/jsreport-express": "3.0.0",
57
+ "@jsreport/jsreport-freeze": "3.0.1",
58
+ "@jsreport/jsreport-fs-store": "3.0.0",
59
+ "@jsreport/jsreport-handlebars": "3.0.0",
60
+ "@jsreport/jsreport-html-to-xlsx": "3.0.0",
61
+ "@jsreport/jsreport-import-export": "3.0.0",
62
+ "@jsreport/jsreport-jsrender": "3.0.0",
63
+ "@jsreport/jsreport-licensing": "3.0.1",
64
+ "@jsreport/jsreport-localization": "3.0.0",
65
+ "@jsreport/jsreport-npm": "3.0.1",
66
+ "@jsreport/jsreport-pdf-utils": "3.0.0",
67
+ "@jsreport/jsreport-pptx": "3.0.0",
68
+ "@jsreport/jsreport-public-templates": "3.0.0",
69
+ "@jsreport/jsreport-reports": "3.0.0",
70
+ "@jsreport/jsreport-sample-template": "3.0.0",
71
+ "@jsreport/jsreport-scheduling": "3.0.0",
72
+ "@jsreport/jsreport-scripts": "3.0.0",
73
+ "@jsreport/jsreport-static-pdf": "3.0.0",
74
+ "@jsreport/jsreport-studio": "3.0.0",
75
+ "@jsreport/jsreport-studio-theme-dark": "3.0.0",
76
+ "@jsreport/jsreport-tags": "3.0.0",
77
+ "@jsreport/jsreport-text": "3.0.0",
78
+ "@jsreport/jsreport-version-control": "3.0.0",
79
+ "@jsreport/jsreport-xlsx": "3.0.0",
80
+ "puppeteer": "10.4.0",
79
81
  "semver": "6.3.0"
80
82
  },
81
83
  "devDependencies": {
82
- "archiver": "3.0.0",
83
- "cross-env": "5.2.1",
84
- "eslint": "5.16.0",
85
- "eslint-config-standard": "12.0.0",
86
- "eslint-config-standard-react": "7.0.2",
87
- "in-publish": "2.0.1",
88
- "jsreport-compile": "2.5.1",
89
- "jsreport-puppeteer-compile": "1.2.2",
90
84
  "mocha": "6.2.0",
91
- "npm-run-all": "4.1.5",
92
- "rimraf": "2.6.3",
93
85
  "should": "13.2.3",
94
- "standard": "12.0.1"
95
- },
96
- "scripts": {
97
- "test": "mocha test --timeout 35000 && standard",
98
- "compile": "node compile.js",
99
- "start": "node server.js"
86
+ "standard": "16.0.3"
100
87
  },
101
88
  "engines": {
102
- "node": ">=8.9"
89
+ "node": ">=16.11"
103
90
  },
104
- "main": "index.js",
105
- "license": "LGPL",
106
- "files": [
107
- "lib",
108
- "index.js",
109
- "config.md",
110
- "example.server.js"
111
- ]
91
+ "jsreport": {
92
+ "entryPoint": "server.js"
93
+ },
94
+ "standard": {
95
+ "ignore": [
96
+ "data/**"
97
+ ],
98
+ "env": {
99
+ "mocha": true,
100
+ "browser": true,
101
+ "node": true
102
+ }
103
+ }
112
104
  }