@deckasoft/waify 0.4.2 → 0.4.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/dist/cli/index.js +12 -24
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -888,8 +888,7 @@ var init_start = __esm({
|
|
|
888
888
|
});
|
|
889
889
|
|
|
890
890
|
// src/cli/index.ts
|
|
891
|
-
|
|
892
|
-
import { config as dotenvConfig } from "dotenv";
|
|
891
|
+
import "dotenv/config";
|
|
893
892
|
import { Command } from "commander";
|
|
894
893
|
|
|
895
894
|
// src/cli/commands/init.ts
|
|
@@ -1301,28 +1300,18 @@ var registerSetup = (program2) => {
|
|
|
1301
1300
|
{ encoding: "utf-8" }
|
|
1302
1301
|
);
|
|
1303
1302
|
console.warn("Starting WhatsApp engine...");
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1303
|
+
const startRes = await fetchWithTimeout(
|
|
1304
|
+
`${baseUrl}/api/sessions/${sessionId}/start`,
|
|
1305
|
+
{
|
|
1306
|
+
method: "POST",
|
|
1307
|
+
headers: { "X-API-Key": openwaApiKey }
|
|
1308
|
+
},
|
|
1309
|
+
1e4
|
|
1310
|
+
);
|
|
1311
|
+
if (!startRes.ok && startRes.status !== 400) {
|
|
1312
|
+
throw new Error(
|
|
1313
|
+
`Failed to start session: ${startRes.status} ${startRes.statusText}`
|
|
1312
1314
|
);
|
|
1313
|
-
if (!startRes.ok && startRes.status !== 400) {
|
|
1314
|
-
throw new Error(
|
|
1315
|
-
`Failed to start session: ${startRes.status} ${startRes.statusText}`
|
|
1316
|
-
);
|
|
1317
|
-
}
|
|
1318
|
-
} catch (err) {
|
|
1319
|
-
if (err instanceof Error && err.name === "TimeoutError") {
|
|
1320
|
-
console.warn(
|
|
1321
|
-
" (Engine start is taking longer than expected \u2014 Chromium may still be loading, continuing\u2026)"
|
|
1322
|
-
);
|
|
1323
|
-
} else {
|
|
1324
|
-
throw err;
|
|
1325
|
-
}
|
|
1326
1315
|
}
|
|
1327
1316
|
try {
|
|
1328
1317
|
const preStatusRes = await fetchWithTimeout(
|
|
@@ -1651,7 +1640,6 @@ var registerTui = (program2) => {
|
|
|
1651
1640
|
};
|
|
1652
1641
|
|
|
1653
1642
|
// src/cli/index.ts
|
|
1654
|
-
dotenvConfig({ path: envPath() });
|
|
1655
1643
|
var program = new Command();
|
|
1656
1644
|
program.name("waify").description("AI-powered daily message sender for WhatsApp").version("0.1.0");
|
|
1657
1645
|
registerInit(program);
|