@wppconnect/server-cli 1.3.0 → 1.3.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 1.3.3 (2022-08-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @wppconnect/server to ^1.6.2 ([#310](https://github.com/wppconnect-team/server-cli/issues/310)) ([d2c40c5](https://github.com/wppconnect-team/server-cli/commit/d2c40c537b1795ef4e6e5ff4c1be2ecb58b6a161))
7
+
8
+
9
+
10
+ ## 1.3.2 (2022-08-05)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deps:** update dependency @wppconnect/server to ^1.6.1 ([#309](https://github.com/wppconnect-team/server-cli/issues/309)) ([3fc41bb](https://github.com/wppconnect-team/server-cli/commit/3fc41bba0341a0eb38368472bf7c8fc404182586))
16
+
17
+
18
+
19
+ ## 1.3.1 (2022-05-10)
20
+
21
+
22
+
1
23
  # 1.3.0 (2022-05-10)
2
24
 
3
25
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["run","serverOptions","program","parse","commandOptions","opts","config","json","fs","readFileSync","encoding","configOptions","JSON","error","console","log","process","exit","subOptions","key","opt","find","startsWith","name","substr","length","newName","toLowerCase","slice","app","frontend","frontendPath","frontendPackage","require","resolve","path","join","dirname","use","req","res","set","send","express","static","get","next","accepts","sendfile","env"],"sources":["../src/index.js"],"sourcesContent":["/*\n * Copyright 2021 WPPConnect Team\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { initServer } from '@wppconnect/server';\nimport * as express from 'express';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport mergeDeep from 'merge-deep';\nimport { program } from './program';\n\nexport function run() {\n let serverOptions = {};\n\n program.parse();\n const commandOptions = program.opts();\n\n if (commandOptions.config) {\n try {\n const json = fs.readFileSync(commandOptions.config, { encoding: 'utf8' });\n const configOptions = JSON.parse(json);\n\n serverOptions = mergeDeep({}, serverOptions, configOptions);\n } catch (error) {\n console.log(error);\n process.exit(1);\n }\n\n delete commandOptions.config;\n }\n\n const subOptions = ['webhook', 'archive', 'log', 'createOptions'];\n\n for (const key in commandOptions) {\n const opt = subOptions.find((opt) => key.startsWith(opt));\n\n if (opt) {\n commandOptions[opt] = commandOptions[opt] || {};\n\n const name = key.substr(opt.length);\n const newName = name[0].toLowerCase() + name.slice(1);\n\n commandOptions[opt][newName] = commandOptions[key];\n delete commandOptions[key];\n }\n }\n\n serverOptions = mergeDeep({}, serverOptions, commandOptions);\n\n const { app } = initServer(serverOptions);\n\n if (commandOptions.frontend) {\n let frontendPath = commandOptions.frontendPath;\n\n if (!frontendPath) {\n try {\n const frontendPackage = require.resolve('@wppconnect/frontend/package.json');\n frontendPath = path.join(path.dirname(frontendPackage), 'build');\n } catch (error) {\n console.error(\n 'Não foi encontrado o caminho para o frontend, por favor defina com --frontend-path ou instale o pacote @wppconnect/frontend'\n );\n process.exit(1);\n }\n }\n\n if (frontendPath) {\n // Requisição de configuração do frontend\n app.use('/config.js', (req, res) => {\n res.set({\n 'Content-Type': 'application/javascript; charset=UTF-8',\n });\n res.send(`\n// Arquivo gerado automaticamente\nwindow.IP_SERVER = location.protocol + \"//\" + location.host + '/api/';\nwindow.IP_SOCKET_IO = ((location.protocol === 'https:') ? 'wss:' : 'ws:') + \"//\" + location.host;\n`);\n });\n\n app.use(express.static(frontendPath));\n\n app.get('*', function (req, res, next) {\n // Força a renderização do react para requisições do browser\n if (req.accepts('html')) {\n return res.sendfile(path.join(frontendPath, 'index.html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AAY,MAAZ,CAAJ,EAAyB;UACvB,OAAOP,GAAG,CAACQ,QAAJ,CAAab,IAAI,CAACC,IAAL,CAAUL,YAAV,EAAwB,YAAxB,CAAb,CAAP;QACD;QACDe,IAAI;MACL,CAND;IAOD;EACF;AACF;;AAED,IAAI9B,OAAO,CAACiC,GAAR,CAAY,YAAZ,CAAJ,EAA+B;EAC7BjD,GAAG;AACJ"}
1
+ {"version":3,"file":"index.js","names":["run","serverOptions","program","parse","commandOptions","opts","config","json","fs","readFileSync","encoding","configOptions","JSON","mergeDeep","error","console","log","process","exit","subOptions","key","opt","find","startsWith","name","substr","length","newName","toLowerCase","slice","app","initServer","frontend","frontendPath","frontendPackage","require","resolve","path","join","dirname","use","req","res","set","send","express","static","get","next","accepts","sendfile","env"],"sources":["../src/index.js"],"sourcesContent":["/*\n * Copyright 2021 WPPConnect Team\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { initServer } from '@wppconnect/server';\nimport * as express from 'express';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport mergeDeep from 'merge-deep';\nimport { program } from './program';\n\nexport function run() {\n let serverOptions = {};\n\n program.parse();\n const commandOptions = program.opts();\n\n if (commandOptions.config) {\n try {\n const json = fs.readFileSync(commandOptions.config, { encoding: 'utf8' });\n const configOptions = JSON.parse(json);\n\n serverOptions = mergeDeep({}, serverOptions, configOptions);\n } catch (error) {\n console.log(error);\n process.exit(1);\n }\n\n delete commandOptions.config;\n }\n\n const subOptions = ['webhook', 'archive', 'log', 'createOptions'];\n\n for (const key in commandOptions) {\n const opt = subOptions.find((opt) => key.startsWith(opt));\n\n if (opt) {\n commandOptions[opt] = commandOptions[opt] || {};\n\n const name = key.substr(opt.length);\n const newName = name[0].toLowerCase() + name.slice(1);\n\n commandOptions[opt][newName] = commandOptions[key];\n delete commandOptions[key];\n }\n }\n\n serverOptions = mergeDeep({}, serverOptions, commandOptions);\n\n const { app } = initServer(serverOptions);\n\n if (commandOptions.frontend) {\n let frontendPath = commandOptions.frontendPath;\n\n if (!frontendPath) {\n try {\n const frontendPackage = require.resolve('@wppconnect/frontend/package.json');\n frontendPath = path.join(path.dirname(frontendPackage), 'build');\n } catch (error) {\n console.error(\n 'Não foi encontrado o caminho para o frontend, por favor defina com --frontend-path ou instale o pacote @wppconnect/frontend'\n );\n process.exit(1);\n }\n }\n\n if (frontendPath) {\n // Requisição de configuração do frontend\n app.use('/config.js', (req, res) => {\n res.set({\n 'Content-Type': 'application/javascript; charset=UTF-8',\n });\n res.send(`\n// Arquivo gerado automaticamente\nwindow.IP_SERVER = location.protocol + \"//\" + location.host + '/api/';\nwindow.IP_SOCKET_IO = ((location.protocol === 'https:') ? 'wss:' : 'ws:') + \"//\" + location.host;\n`);\n });\n\n app.use(express.static(frontendPath));\n\n app.get('*', function (req, res, next) {\n // Força a renderização do react para requisições do browser\n if (req.accepts('html')) {\n return res.sendfile(path.join(frontendPath, 'index.html'));\n }\n next();\n });\n }\n }\n}\n\nif (process.env['RUN_SERVER']) {\n run();\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AACA;AACA,oC,yjCApBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAQO,SAASA,GAAT,GAAe,CACpB,IAAIC,aAAa,GAAG,EAApB,CAEAC,gBAAA,CAAQC,KAAR,GACA,MAAMC,cAAc,GAAGF,gBAAA,CAAQG,IAAR,EAAvB,CAEA,IAAID,cAAc,CAACE,MAAnB,EAA2B,CACzB,IAAI,CACF,MAAMC,IAAI,GAAGC,EAAE,CAACC,YAAH,CAAgBL,cAAc,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,QAAnB,EAA6B;IAC3B,IAAIC,YAAY,GAAG7B,cAAc,CAAC6B,YAAlC;;IAEA,IAAI,CAACA,YAAL,EAAmB;MACjB,IAAI;QACF,MAAMC,eAAe,GAAGC,OAAO,CAACC,OAAR,CAAgB,mCAAhB,CAAxB;QACAH,YAAY,GAAGI,IAAI,CAACC,IAAL,CAAUD,IAAI,CAACE,OAAL,CAAaL,eAAb,CAAV,EAAyC,OAAzC,CAAf;MACD,CAHD,CAGE,OAAOpB,KAAP,EAAc;QACdC,OAAO,CAACD,KAAR;QACE,6HADF;;QAGAG,OAAO,CAACC,IAAR,CAAa,CAAb;MACD;IACF;;IAED,IAAIe,YAAJ,EAAkB;MAChB;MACAH,GAAG,CAACU,GAAJ,CAAQ,YAAR,EAAsB,CAACC,GAAD,EAAMC,GAAN,KAAc;QAClCA,GAAG,CAACC,GAAJ,CAAQ;UACN,gBAAgB,uCADV,EAAR;;QAGAD,GAAG,CAACE,IAAJ,CAAU;AAClB;AACA;AACA;AACA,CAJQ;MAKD,CATD;;MAWAd,GAAG,CAACU,GAAJ,CAAQK,OAAO,CAACC,MAAR,CAAeb,YAAf,CAAR;;MAEAH,GAAG,CAACiB,GAAJ,CAAQ,GAAR,EAAa,UAAUN,GAAV,EAAeC,GAAf,EAAoBM,IAApB,EAA0B;QACrC;QACA,IAAIP,GAAG,CAACQ,OAAJ,CAAY,MAAZ,CAAJ,EAAyB;UACvB,OAAOP,GAAG,CAACQ,QAAJ,CAAab,IAAI,CAACC,IAAL,CAAUL,YAAV,EAAwB,YAAxB,CAAb,CAAP;QACD;QACDe,IAAI;MACL,CAND;IAOD;EACF;AACF;;AAED,IAAI/B,OAAO,CAACkC,GAAR,CAAY,YAAZ,CAAJ,EAA+B;EAC7BnD,GAAG;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect/server-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.3",
4
4
  "description": "Servidor de WPPConnect com frontend para ser executado a partir de uma linha de comando",
5
5
  "bin": {
6
6
  "wppserver": "./bin/wppserver.js"
@@ -28,35 +28,35 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@babel/runtime": "^7.14.6",
32
- "@wppconnect/server": "^1.3.0",
33
- "commander": "^9.0.0",
31
+ "@babel/runtime": "^7.18.9",
32
+ "@wppconnect/server": "^1.6.2",
33
+ "commander": "^9.4.0",
34
34
  "merge-deep": "^3.0.3"
35
35
  },
36
36
  "devDependencies": {
37
- "@babel/cli": "^7.14.5",
38
- "@babel/core": "^7.14.5",
39
- "@babel/eslint-parser": "^7.14.5",
40
- "@babel/eslint-plugin": "^7.14.5",
41
- "@babel/node": "^7.14.5",
42
- "@babel/plugin-transform-runtime": "^7.14.5",
43
- "@babel/preset-env": "^7.14.5",
44
- "@commitlint/cli": "^16.0.2",
45
- "@commitlint/config-conventional": "^16.0.0",
46
- "@commitlint/cz-commitlint": "^16.1.0",
47
- "@wppconnect/frontend": "^1.0.0",
48
- "commitizen": "^4.2.4",
49
- "conventional-changelog-cli": "^2.1.1",
37
+ "@babel/cli": "^7.18.10",
38
+ "@babel/core": "^7.18.10",
39
+ "@babel/eslint-parser": "^7.18.9",
40
+ "@babel/eslint-plugin": "^7.18.10",
41
+ "@babel/node": "^7.18.10",
42
+ "@babel/plugin-transform-runtime": "^7.18.10",
43
+ "@babel/preset-env": "^7.18.10",
44
+ "@commitlint/cli": "^17.0.3",
45
+ "@commitlint/config-conventional": "^17.0.3",
46
+ "@commitlint/cz-commitlint": "^17.0.3",
47
+ "@wppconnect/frontend": "^1.0.3",
48
+ "commitizen": "^4.2.5",
49
+ "conventional-changelog-cli": "^2.2.2",
50
50
  "cross-env": "^7.0.3",
51
- "eslint": "^8.0.0",
52
- "eslint-config-prettier": "^8.3.0",
53
- "eslint-plugin-prettier": "^4.0.0",
51
+ "eslint": "^8.21.0",
52
+ "eslint-config-prettier": "^8.5.0",
53
+ "eslint-plugin-prettier": "^4.2.1",
54
54
  "husky": "^8.0.1",
55
- "license-check-and-add": "^4.0.2",
56
- "nodemon": "^2.0.7",
57
- "prettier": "^2.3.1",
58
- "pretty-quick": "^3.1.0",
59
- "release-it": "^15.0.0",
55
+ "license-check-and-add": "^4.0.5",
56
+ "nodemon": "^2.0.19",
57
+ "prettier": "^2.7.1",
58
+ "pretty-quick": "^3.1.3",
59
+ "release-it": "^15.2.0",
60
60
  "rimraf": "^3.0.2"
61
61
  }
62
62
  }