Worker build updates

This commit is contained in:
Darren Clarke 2024-06-28 07:49:39 +02:00
parent 45c80ca98a
commit 0cf1c3b8fd
64 changed files with 4216 additions and 3450 deletions

View file

@ -0,0 +1 @@
*/1 * * * * fetch-signal-messages

View file

@ -14,7 +14,7 @@ const startWorker = async () => {
noHandleSignals: false,
pollInterval: 1000,
taskDirectory: `${__dirname}/tasks`,
// crontabFile: `${__dirname}/crontab`,
crontabFile: `${__dirname}/crontab`,
});
};

View file

@ -19,12 +19,13 @@ const notifyWebhooksTask = async (
for (const webhook of webhooks) {
const { endpointUrl, httpMethod, headers } = webhook;
const finalHeaders = { "Content-Type": "application/json", ...headers };
await fetch(endpointUrl, {
console.log({ endpointUrl, httpMethod, headers, finalHeaders });
const result = await fetch(endpointUrl, {
method: httpMethod,
headers: finalHeaders,
body: JSON.stringify(payload),
});
console.log(result);
}
};

View file

@ -1,5 +1,5 @@
{
"extends": "@link-stack/typescript-config/tsconfig.json",
"extends": "@link-stack/typescript-config/tsconfig.node.json",
"compilerOptions": {
"outDir": "build/main"
},

View file

@ -0,0 +1 @@
export { receiveMessage as POST } from "@link-stack/bridge-ui";

View file

@ -0,0 +1 @@
export { getBot as GET } from "@link-stack/bridge-ui";

View file

@ -0,0 +1 @@
export { sendMessage as POST } from "@link-stack/bridge-ui";

View file

@ -0,0 +1,3 @@
import { handleWebhook } from "@link-stack/bridge-ui";
export { handleWebhook as GET, handleWebhook as POST };

View file

@ -79,5 +79,7 @@ export default withAuth(checkRewrites, {
});
export const config = {
matcher: ["/((?!ws|wss|_next/static|_next/image|favicon.ico).*)"],
matcher: [
"/((?!ws|wss|api/signal|api/whatsapp|api/facebook|_next/static|_next/image|favicon.ico).*)",
],
};