@open-wa/wa-automate 4.27.3 → 4.27.4

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/dist/cli/index.js CHANGED
@@ -113,12 +113,6 @@ function start() {
113
113
  process.exit();
114
114
  }
115
115
  }));
116
- if (cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.chatwootUrl) {
117
- spinner.info('Setting Up Chatwoot handler');
118
- spinner.info('Make sure to set up the Chatwoot inbox webhook to the following path on this process: /chatwoot');
119
- yield server_1.setupChatwoot(cliConfig, client);
120
- spinner.succeed('Chatwoot handler set up successfully');
121
- }
122
116
  if (cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.botPressUrl) {
123
117
  spinner.info('Setting Up Botpress handler');
124
118
  server_1.setupBotPressHandler(cliConfig, client);
@@ -150,6 +144,12 @@ function start() {
150
144
  console.log(`Please use the following api key for requests as a header:\napi_key: ${cliConfig.key}`);
151
145
  server_1.setupAuthenticationLayer(cliConfig);
152
146
  }
147
+ if (cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.chatwootUrl) {
148
+ spinner.info('Setting Up Chatwoot handler');
149
+ spinner.info(`Make sure to set up the Chatwoot inbox webhook to the following path on this process: /chatwoot${cliConfig.key ? `?api_key=YOUR-API-KEY` : ''}`);
150
+ yield server_1.setupChatwoot(cliConfig, client);
151
+ spinner.succeed('Chatwoot handler set up successfully');
152
+ }
153
153
  server_1.setupRefocusDisengageMiddleware(cliConfig);
154
154
  if (cliConfig && cliConfig.generateApiDocs && collections_1.collections["swagger"]) {
155
155
  spinner.info('Setting Up API Explorer');
@@ -71,7 +71,10 @@ const setupAuthenticationLayer = (cliConfig) => {
71
71
  return next();
72
72
  }
73
73
  const apiKey = req.get('key') || req.get('api_key');
74
- if (!apiKey || apiKey !== cliConfig.key) {
74
+ if (req.path.includes('chatwoot') && req.query['api_key'] && req.query['api_key'] == cliConfig.key) {
75
+ next();
76
+ }
77
+ else if (!apiKey || apiKey !== cliConfig.key) {
75
78
  res.status(401).json({ error: 'unauthorised' });
76
79
  }
77
80
  else {
@@ -290,6 +290,8 @@ function initBrowser(sessionId, config = {}) {
290
290
  if (!_savedPath) {
291
291
  const chromeLauncher = yield Promise.resolve().then(() => __importStar(require('chrome-launcher')));
292
292
  config.executablePath = chromeLauncher.Launcher.getInstallations()[0];
293
+ if (!config.executablePath)
294
+ delete config.executablePath;
293
295
  yield storage.setItem('executablePath', config.executablePath);
294
296
  }
295
297
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.27.3",
3
+ "version": "4.27.4",
4
4
  "licenseCheckUrl": "https://openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",