CognxSafeTrack commited on
Commit ·
0a5bf22
1
Parent(s): e289c5c
fix: worker dependencies and unused variables for railway build
Browse files- apps/whatsapp-worker/package.json +2 -1
- apps/whatsapp-worker/src/config.ts +1 -1
- apps/whatsapp-worker/src/handlers/AdminHandler.ts +0 -1
- apps/whatsapp-worker/src/handlers/EnrollHandler.ts +0 -1
- apps/whatsapp-worker/src/handlers/MediaHandler.ts +0 -1
- apps/whatsapp-worker/src/handlers/MessageHandler.ts +0 -1
apps/whatsapp-worker/package.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
| 19 |
"ioredis": "^5.9.3",
|
| 20 |
"node-cron": "^4.2.1",
|
| 21 |
"node-fetch": "^2.6.7",
|
| 22 |
-
"sharp": "^0.34.5"
|
|
|
|
| 23 |
},
|
| 24 |
"devDependencies": {
|
| 25 |
"@repo/tsconfig": "workspace:*",
|
|
|
|
| 19 |
"ioredis": "^5.9.3",
|
| 20 |
"node-cron": "^4.2.1",
|
| 21 |
"node-fetch": "^2.6.7",
|
| 22 |
+
"sharp": "^0.34.5",
|
| 23 |
+
"zod": "^3.22.0"
|
| 24 |
},
|
| 25 |
"devDependencies": {
|
| 26 |
"@repo/tsconfig": "workspace:*",
|
apps/whatsapp-worker/src/config.ts
CHANGED
|
@@ -29,4 +29,4 @@ export const config = result.data;
|
|
| 29 |
export function getApiUrl() { return config.API_URL; }
|
| 30 |
export function getAdminApiKey() { return config.ADMIN_API_KEY; }
|
| 31 |
export function validateEnvironment() { return true; } // Kept for compatibility
|
| 32 |
-
export function isFeatureEnabled(
|
|
|
|
| 29 |
export function getApiUrl() { return config.API_URL; }
|
| 30 |
export function getAdminApiKey() { return config.ADMIN_API_KEY; }
|
| 31 |
export function validateEnvironment() { return true; } // Kept for compatibility
|
| 32 |
+
export function isFeatureEnabled(_feature: string) { return true; } // Placeholder
|
apps/whatsapp-worker/src/handlers/AdminHandler.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Job, Queue } from 'bullmq';
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
| 5 |
-
import { logger } from '../logger';
|
| 6 |
import { sendTextMessage } from '../whatsapp-cloud';
|
| 7 |
|
| 8 |
interface TenantConfig {
|
|
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
|
|
|
| 5 |
import { sendTextMessage } from '../whatsapp-cloud';
|
| 6 |
|
| 7 |
interface TenantConfig {
|
apps/whatsapp-worker/src/handlers/EnrollHandler.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Job, Queue } from 'bullmq';
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
| 5 |
-
import { logger } from '../logger';
|
| 6 |
import { sendTextMessage } from '../whatsapp-cloud';
|
| 7 |
import { getApiUrl, getAdminApiKey } from '../config';
|
| 8 |
import fetch from 'node-fetch';
|
|
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
|
|
|
| 5 |
import { sendTextMessage } from '../whatsapp-cloud';
|
| 6 |
import { getApiUrl, getAdminApiKey } from '../config';
|
| 7 |
import fetch from 'node-fetch';
|
apps/whatsapp-worker/src/handlers/MediaHandler.ts
CHANGED
|
@@ -45,7 +45,6 @@ export class MediaHandler implements JobHandler {
|
|
| 45 |
}
|
| 46 |
|
| 47 |
const tenantConfig = await this.getTenantConfig(organizationId || '', connection);
|
| 48 |
-
const traceId = `[STT-FLOW-${phone.slice(-4)}]`;
|
| 49 |
const accessToken = process.env.WHATSAPP_ACCESS_TOKEN || tenantConfig?.accessToken;
|
| 50 |
|
| 51 |
if (!accessToken) {
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
const tenantConfig = await this.getTenantConfig(organizationId || '', connection);
|
|
|
|
| 48 |
const accessToken = process.env.WHATSAPP_ACCESS_TOKEN || tenantConfig?.accessToken;
|
| 49 |
|
| 50 |
if (!accessToken) {
|
apps/whatsapp-worker/src/handlers/MessageHandler.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Job } from 'bullmq';
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
| 5 |
-
import { logger } from '../logger';
|
| 6 |
import { sendTextMessage, sendImageMessage, sendInteractiveButtonMessage, sendInteractiveListMessage } from '../whatsapp-cloud';
|
| 7 |
|
| 8 |
interface TenantConfig {
|
|
|
|
| 2 |
import Redis from 'ioredis';
|
| 3 |
import { JobHandler, JobData } from './types';
|
| 4 |
import { prisma } from '../services/prisma';
|
|
|
|
| 5 |
import { sendTextMessage, sendImageMessage, sendInteractiveButtonMessage, sendInteractiveListMessage } from '../whatsapp-cloud';
|
| 6 |
|
| 7 |
interface TenantConfig {
|