@websy/websy-designs 1.1.7 → 1.1.8

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.
@@ -92,9 +92,9 @@ let convertHTMLToPDF = (html, name, callback, options_in = null, displayHeaderFo
92
92
  browser.close()
93
93
  callback(error)
94
94
  })
95
- })
96
- })
97
- })
95
+ }, err => console.log('error evaluating handle in puppeteer', err))
96
+ }, err => console.log('error setting content in puppeteer', err))
97
+ }, err => console.log('error setting user agent in puppeteer', err))
98
98
  // page.goto(process.env.PDF_PAGE || 'http://localhost:4000', {waitUntil: ['load', 'domcontentloaded', 'networkidle2', 'networkidle0']}).then(gotoResponse => {
99
99
  // page.setViewport({width: 1500, height: 2000, deviceScaleFactor: 1}).then(() => {
100
100
  // options.path = `${process.env.APP_ROOT}/pdf/${pdfId}.pdf`
@@ -277,7 +277,7 @@ class PGHelper {
277
277
  })
278
278
  }
279
279
  execute (query) {
280
- console.log(query)
280
+ // console.log(query)
281
281
  return new Promise((resolve, reject) => {
282
282
  if (query !== null) {
283
283
  this.client.query(query, (err, queryResponse) => {
@@ -65,13 +65,7 @@ module.exports = function (options) {
65
65
  app.use('/pdf', require(`./routes/${version}/pdf`))
66
66
  if (options.useDB === true) {
67
67
  const dbHelper = require(`./helpers/${version}/${options.dbEngine}Helper`)
68
- dbHelper.init(options.dbOptions || {}).then(() => {
69
- console.log('initializing session')
70
- // const store = new DBSession({
71
- // pool: dbHelper.pool, // Connection pool, need to make dynamic to accommodate mySql
72
- // tableName: 'sessions' // Use another table-name than the default "session" one
73
- // })
74
- console.log('setting up session')
68
+ dbHelper.init(options.dbOptions || {}).then(() => {
75
69
  app.set('trust proxy', 1)
76
70
  app.use(cookieParser(process.env.SESSION_SECRET))
77
71
  let cookieConfig = {
@@ -90,8 +84,7 @@ module.exports = function (options) {
90
84
  }
91
85
  let DBSession = null
92
86
  let store = null
93
- if (options.useDBStore === true) {
94
- console.log('using db store')
87
+ if (options.useDBStore === true) {
95
88
  if (options.dbEngine === 'pg') {
96
89
  DBSession = require('connect-pg-simple')(expressSession)
97
90
  store = new DBSession({
@@ -109,8 +102,7 @@ module.exports = function (options) {
109
102
  store: store
110
103
  })))
111
104
  if (process.env.TRANSLATE === true || process.env.TRANSLATE === 'true') {
112
- app.use((req, res, next) => {
113
- console.log(req.session)
105
+ app.use((req, res, next) => {
114
106
  if (req.query.lang && req.session) {
115
107
  req.session.language = req.query.lang
116
108
  req.session.save(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websy/websy-designs",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"