@open-wa/wa-automate 4.46.1 → 4.46.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.
@@ -108,7 +108,7 @@ const setupChatwootOutgoingMessageHandler = (cliConfig, client) => __awaiter(voi
|
|
108
108
|
const port = _u.port || 80;
|
109
109
|
const accountNumber = yield client.getHostNumber();
|
110
110
|
const proms = [];
|
111
|
-
let expectedSelfWebhookUrl = cliConfig.apiHost ? `${cliConfig.apiHost}/chatwoot ` : `${cliConfig.host.includes('http') ? '' :
|
111
|
+
let expectedSelfWebhookUrl = cliConfig.apiHost ? `${cliConfig.apiHost}/chatwoot ` : `${cliConfig.host.includes('http') ? '' : `http${cliConfig.https || (cliConfig.cert && cliConfig.privkey) ? 's' : ''}://`}${cliConfig.host}:${cliConfig.port}/chatwoot `;
|
112
112
|
expectedSelfWebhookUrl = expectedSelfWebhookUrl.trim();
|
113
113
|
if (cliConfig.key)
|
114
114
|
expectedSelfWebhookUrl = `${expectedSelfWebhookUrl}?api_key=${cliConfig.key}`;
|
package/dist/cli/server.d.ts
CHANGED
package/dist/cli/server.js
CHANGED
@@ -35,7 +35,7 @@ exports.setupSocketServer = exports.setupBotPressHandler = exports.setupChatwoot
|
|
35
35
|
//@ts-ignore
|
36
36
|
const express_1 = __importDefault(require("express"));
|
37
37
|
const https_1 = __importDefault(require("https"));
|
38
|
-
const
|
38
|
+
const http_1 = __importDefault(require("http"));
|
39
39
|
const collections_1 = require("./collections");
|
40
40
|
const express_robots_txt_1 = __importDefault(require("express-robots-txt"));
|
41
41
|
const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
|
@@ -49,7 +49,7 @@ const chatwoot_1 = require("./integrations/chatwoot");
|
|
49
49
|
const express_ipfilter_1 = require("express-ipfilter");
|
50
50
|
const helmet_1 = __importDefault(require("helmet"));
|
51
51
|
exports.app = (0, express_1.default)();
|
52
|
-
exports.server =
|
52
|
+
exports.server = http_1.default.createServer(exports.app);
|
53
53
|
const trimChatId = (chatId) => chatId.replace("@c.us", "").replace("@g.us", "");
|
54
54
|
const socketListenerCallbacks = {};
|
55
55
|
// const existingListeners = () => Object.keys(Object.keys(socketListenerCallbacks).flatMap(id=>Object.keys(socketListenerCallbacks[id])).reduce((acc,curr)=>{acc[curr]=true;return acc},{}))
|
@@ -100,10 +100,11 @@ const setupHttpServer = (cliConfig) => {
|
|
100
100
|
if (privContents && certContents) {
|
101
101
|
const options = { key: privContents, cert: certContents };
|
102
102
|
exports.server = https_1.default.createServer(options, exports.app);
|
103
|
+
cliConfig.https = true;
|
103
104
|
return;
|
104
105
|
}
|
105
106
|
}
|
106
|
-
exports.server =
|
107
|
+
exports.server = http_1.default.createServer(exports.app);
|
107
108
|
};
|
108
109
|
exports.setupHttpServer = setupHttpServer;
|
109
110
|
const setUpExpressApp = () => {
|
package/package.json
CHANGED