Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
refactor: delete unused code and dev dependencies
Yudhi Armyndharis3a8dc390b88e
diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.tsindex b7cce8b3d..bb46ff8d1 100644--- a/dashboard/src/services/api.ts+++ b/dashboard/src/services/api.ts@@ -547,12 +547,6 @@ export interface SaveConfigPayload {};}-export interface Settings {- general: { apiBaseUrl: string; autoReconnect: boolean; debugMode: boolean };- api: { rateLimit: number; rateLimitWindow: number; enableDocs: boolean };- notifications: { emailEnabled: boolean; notificationEmail: string; webhookAlerts: boolean };-}-// Global message search (mirrors the backend GET /search contract from #664).// `timestamp` is epoch-seconds (the messages column is seconds, not ms); `dateFrom`/`dateTo`// are epoch-ms on the wire — see `dateFrom`/`dateTo` JSDoc below.@@ -748,11 +742,6 @@ export const sessionApi = {method: 'POST',body: JSON.stringify({ chatId }),}),- markChatUnread: (id: string, chatId: string) =>- request<{ success: boolean }>(`/sessions/${id}/chats/unread`, {- method: 'POST',- body: JSON.stringify({ chatId }),- }),getChatMessages: (id: string, chatId: string, limit = 100) =>request<{ messages: ChatMessage[]; total: number }>(`/sessions/${id}/messages?chatId=${encodeURIComponent(chatId)}&limit=${limit}`,@@ -808,7 +797,6 @@ export const sessionApi = {export const webhookApi = {listBySession: (sessionId: string) => request<Webhook[]>(`/sessions/${sessionId}/webhooks`),listAll: () => request<Webhook[]>('/webhooks'),- get: (sessionId: string, id: string) => request<Webhook>(`/sessions/${sessionId}/webhooks/${id}`),create: (sessionId: string, data: { url: string; events: string[]; filters?: WebhookFilters | null }) =>request<Webhook>(`/sessions/${sessionId}/webhooks`, {method: 'POST',@@ -833,7 +821,6 @@ export const webhookApi = {export const templateApi = {list: (sessionId: string) => request<MessageTemplate[]>(`/sessions/${sessionId}/templates`),- get: (sessionId: string, id: string) => request<MessageTemplate>(`/sessions/${sessionId}/templates/${id}`),create: (sessionId: string, data: TemplatePayload) =>request<MessageTemplate>(`/sessions/${sessionId}/templates`, {method: 'POST',@@ -897,7 +884,6 @@ export const contactApi = {export const apiKeyApi = {list: () => request<ApiKey[]>('/auth/api-keys'),- get: (id: string) => request<ApiKey>(`/auth/api-keys/${id}`),create: (data: {name: string;role: string;@@ -909,11 +895,6 @@ export const apiKeyApi = {method: 'POST',body: JSON.stringify(data),}),- update: (id: string, data: Partial<ApiKey>) =>- request<ApiKey>(`/auth/api-keys/${id}`, {- method: 'PUT',- body: JSON.stringify(data),- }),delete: (id: string) => request<void>(`/auth/api-keys/${id}`, { method: 'DELETE' }),revoke: (id: string) => request<ApiKey>(`/auth/api-keys/${id}/revoke`, { method: 'POST' }),};@@ -944,26 +925,6 @@ export const messageApi = {method: 'POST',body: JSON.stringify({ chatId, text }),}),- sendImage: (sessionId: string, chatId: string, url: string, caption?: string) =>- request<MessageResponse>(`/sessions/${sessionId}/messages/send-image`, {- method: 'POST',- body: JSON.stringify({ chatId, url, caption }),- }),- sendVideo: (sessionId: string, chatId: string, url: string, caption?: string) =>- request<MessageResponse>(`/sessions/${sessionId}/messages/send-video`, {- method: 'POST',- body: JSON.stringify({ chatId, url, caption }),- }),- sendAudio: (sessionId: string, chatId: string, url: string) =>- request<MessageResponse>(`/sessions/${sessionId}/messages/send-audio`, {- method: 'POST',- body: JSON.stringify({ chatId, url }),- }),- sendDocument: (sessionId: string, chatId: string, url: string, filename?: string) =>- request<MessageResponse>(`/sessions/${sessionId}/messages/send-document`, {- method: 'POST',- body: JSON.stringify({ chatId, url, filename }),- }),sendMedia: (sessionId: string,chatId: string,@@ -1022,14 +983,6 @@ export const messageApi = {method: 'POST',body: JSON.stringify(data),}),- sendTemplate: (- sessionId: string,- data: { chatId: string; templateId?: string; templateName?: string; variables?: Record<string, string> },- ) =>- request<MessageResponse>(`/sessions/${sessionId}/messages/send-template`, {- method: 'POST',- body: JSON.stringify(data),- }),delete: (sessionId: string, data: { chatId: string; messageId: string; forEveryone?: boolean }) =>request<void>(`/sessions/${sessionId}/messages/delete`, {method: 'POST',@@ -1057,17 +1010,11 @@ export const searchApi = {export const healthApi = {check: () => request<HealthStatus>('/health'),- ready: () => request<HealthStatus>('/health/ready'),};export const infraApi = {getStatus: () => request<InfraStatus>('/infra/status'),getConfig: () => request<SavedConfig>('/infra/config'),- updateConfig: (config: Partial<InfraStatus>) =>- request<InfraStatus>('/infra/config', {- method: 'PUT',- body: JSON.stringify(config),- }),saveConfig: (config: SaveConfigPayload) =>request<{ message: string; saved: boolean; envPath: string; profiles: string[] }>('/infra/config', {method: 'PUT',diff --git a/docs/08-development-guidelines.md b/docs/08-development-guidelines.mdindex 348e7c481..09511df3d 100644--- a/docs/08-development-guidelines.md+++ b/docs/08-development-guidelines.md@@ -411,7 +411,7 @@ test/```typescript// src/modules/session/reconnect-config.spec.ts-import { resolveReconnectConfig } from './session.service';+import { resolveReconnectConfig } from './session-engine-lifecycle.service';describe('resolveReconnectConfig', () => {it('keeps reconnect settings finite and bounded', () => {diff --git a/package-lock.json b/package-lock.jsonindex f4c50c2d1..5950e7390 100644--- a/package-lock.json+++ b/package-lock.json@@ -53,7 +53,6 @@"zod": "^4.4.3"},"devDependencies": {- "@eslint/eslintrc": "^3.3.6","@eslint/js": "^10.0.1","@nestjs/cli": "^11.0.24","@nestjs/schematics": "^11.0.0",@@ -74,10 +73,8 @@"globals": "^17.9.0","jest": "^30.4.2","prettier": "^3.9.6",- "source-map-support": "^0.5.21","supertest": "^7.0.0","ts-jest": "^29.4.12",- "ts-loader": "^9.6.2","ts-node": "^10.9.2","tsconfig-paths": "^4.2.0","typescript": "~6.0.3",@@ -650,6 +647,7 @@"integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@babel/code-frame": "^7.29.7","@babel/generator": "^7.29.7",@@ -1155,6 +1153,7 @@"resolved": "https://registry.npmjs.org/@bull-board/api/-/api-8.6.0.tgz","integrity": "sha512-tJLkYszUJhvDzTexLT+6/OEUYCWrR5QBKXk+SNlNsxHw8WClSRFEirXMrKwrei3LlMVxPV5lvbBOC7LNNymibQ==","license": "MIT",+ "peer": true,"dependencies": {"redis-info": "^3.1.0"},@@ -1203,6 +1202,7 @@"resolved": "https://registry.npmjs.org/@bull-board/ui/-/ui-8.6.0.tgz","integrity": "sha512-Qb/HYNU2JhRYKoyeJhXgeu1ZL4VK5RANmLC/cpzbtZPz5b9b260d0J0Af0L0zGdP6ORYg2XpPQKwrIy7n96AwQ==","license": "MIT",+ "peer": true,"dependencies": {"@bull-board/api": "8.6.0"}@@ -1240,6 +1240,7 @@"resolved": "https://registry.npmjs.org/keyv/-/keyv-5.6.0.tgz","integrity": "sha512-CYDD3SOtsHtyXeEORYRx2qBtpDJFjRTGXUtmNEMGyzYOKj1TE3tycdlho7kA1Ufx9OYWZzg52QFBGALTirzDSw==","license": "MIT",+ "peer": true,"dependencies": {"@keyv/serialize": "^1.1.1"}@@ -1459,43 +1460,6 @@"node": "^20.19.0 || ^22.13.0 || >=24"}},- "node_modules/@eslint/eslintrc": {- "version": "3.3.6",- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.6.tgz",- "integrity": "sha512-l2Ul9PrHsPCKcEY/ac7VgFj9D80C7S68sOKc618SyHDPK36s1XcFebXY0iTzUVn4Yq+YbwvSnDmCz9yxjX+QrA==",- "dev": true,- "license": "MIT",- "dependencies": {- "ajv": "^6.14.0",- "debug": "^4.3.2",- "espree": "^10.0.1",- "globals": "^14.0.0",- "ignore": "^5.2.0",- "import-fresh": "^3.2.1",- "js-yaml": "^4.3.0",- "minimatch": "^3.1.5",- "strip-json-comments": "^3.1.1"- },- "engines": {- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"- },- "funding": {- "url": "https://opencollective.com/eslint"- }- },- "node_modules/@eslint/eslintrc/node_modules/globals": {- "version": "14.0.0",- "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",- "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",- "dev": true,- "license": "MIT",- "engines": {- "node": ">=18"- },- "funding": {- "url": "https://github.com/sponsors/sindresorhus"- }- },"node_modules/@eslint/js": {"version": "10.0.1","resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz",@@ -1794,9 +1758,6 @@"cpu": ["arm"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1813,9 +1774,6 @@"cpu": ["arm64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1832,9 +1790,6 @@"cpu": ["ppc64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1851,9 +1806,6 @@"cpu": ["riscv64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1870,9 +1822,6 @@"cpu": ["s390x"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1889,9 +1838,6 @@"cpu": ["x64"],- "libc": [- "glibc"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1908,9 +1854,6 @@"cpu": ["arm64"],- "libc": [- "musl"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1927,9 +1870,6 @@"cpu": ["x64"],- "libc": [- "musl"- ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -1946,9 +1886,6 @@"cpu": ["arm"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -1971,9 +1908,6 @@"cpu": ["arm64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -1996,9 +1930,6 @@"cpu": ["ppc64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -2021,9 +1952,6 @@"cpu": ["riscv64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -2046,9 +1974,6 @@"cpu": ["s390x"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -2071,9 +1996,6 @@"cpu": ["x64"],- "libc": [- "glibc"- ],"license": "Apache-2.0","optional": true,"os": [@@ -2096,9 +2018,6 @@"cpu": ["arm64"],- "libc": [- "musl"- ],"license": "Apache-2.0","optional": true,"os": [@@ -2121,9 +2040,6 @@"cpu": ["x64"],- "libc": [- "musl"- ],"license": "Apache-2.0","optional": true,"os": [@@ -3446,6 +3362,7 @@"resolved": "https://registry.npmjs.org/@nestjs/bull-shared/-/bull-shared-11.0.4.tgz","integrity": "sha512-VBJcDHSAzxQnpcDfA0kt9MTGUD1XZzfByV70su0W0eDCQ9aqIEBlzWRW21tv9FG9dIut22ysgDidshdjlnczLw==","license": "MIT",+ "peer": true,"dependencies": {"tslib": "2.8.1"},@@ -3614,6 +3531,7 @@"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.28.tgz","integrity": "sha512-bRImsxibie+AM7xjdwcrm/gr5YeacI65kSBNzTufa1Ib5iwziaY/lqMtRh9THq6pbV4e1HP9aI2ZxGUumnmaoQ==","license": "MIT",+ "peer": true,"dependencies": {"file-type": "21.3.4","iterare": "1.2.1",@@ -3660,6 +3578,7 @@"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.28.tgz","integrity": "sha512-06m63xIRj8+l8uOeh/8LnYupGubkyu4f+bPKIadaSui6vK9KpXgoz7HveT1yOVLcEt0M0oCOEW5EuEXZkEmBBQ==","license": "MIT",+ "peer": true,"dependencies": {"fast-safe-stringify": "2.1.1","iterare": "1.2.1",@@ -3719,6 +3638,7 @@"resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.28.tgz","integrity": "sha512-hU+9Sz4m+onHrR5AmelI59QKmY/Re546bPnygnpqqeQdHDiJpBgjWbL4t6Jr73CBpS60cpyng7WzjgphNB9iwA==","license": "MIT",+ "peer": true,"dependencies": {"cors": "2.8.6","express": "5.2.1",@@ -3740,6 +3660,7 @@"resolved": "https://registry.npmjs.org/@nestjs/platform-socket.io/-/platform-socket.io-11.1.28.tgz","integrity": "sha512-vY+GmU2jBcymvgm5rEnftUx4qNxK8cDJmXjl1/1NcpITTNJo0vg07xYR43MwXHcMqe7b0jwqt5+UCTzxqQFIqA==","license": "MIT",+ "peer": true,"dependencies": {"socket.io": "4.8.3","tslib": "2.8.1"@@ -3894,6 +3815,7 @@"resolved": "https://registry.npmjs.org/@nestjs/websockets/-/websockets-11.1.28.tgz","integrity": "sha512-jeyclAURCJTN8S8lctDhfLdiJeDKjZmYWWLav653Fb9hl9c+zx5jPhavI8Xk5++R8u+lX9qzaRxtsjEoxTtjyw==","license": "MIT",+ "peer": true,"dependencies": {"iterare": "1.2.1","object-hash": "3.0.0",@@ -3945,6 +3867,7 @@"version": "0.11.0","resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz","integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",+ "dev": true,"license": "MIT","optional": true,"engines": {@@ -4585,6 +4508,7 @@"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz","integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==","license": "MIT",+ "peer": true,"dependencies": {"undici-types": "~8.3.0"}@@ -4799,6 +4723,7 @@"integrity": "sha512-X6ypGChaWYk6PBtUg2BwuTZEFFcHJAtGTVJ9/lCTOufhZ4i9fNolQNnktq+kkMCwMj7V8Svsq7+TxSDslmhE0g==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@typescript-eslint/scope-manager": "8.66.0","@typescript-eslint/types": "8.66.0",@@ -5582,6 +5507,7 @@"integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==","devOptional": true,"license": "MIT",+ "peer": true,"bin": {"acorn": "bin/acorn"},@@ -5649,6 +5575,7 @@"integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"fast-deep-equal": "^3.1.1","fast-json-stable-stringify": "^2.0.0",@@ -6019,6 +5946,7 @@"integrity": "sha512-Z0lHvMayR/Pad9+O9ddzaBJE0DrhZkQlStrC1RwcAHF3AhQAsdwKHeLGK8fYKyp2DDU6xHxzGb4CLMui12yVrg==","deprecated": "Renamed to @audio/decode — same API; this name remains a thin alias. npm i @audio/decode","license": "MIT",+ "peer": true,"dependencies": {"@wasm-audio-decoders/flac": "^0.2.4","@wasm-audio-decoders/ogg-vorbis": "^0.1.15",@@ -6169,6 +6097,7 @@"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz","integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==","license": "Apache-2.0",+ "peer": true,"peerDependencies": {"bare-abort-controller": "*"},@@ -6321,6 +6250,7 @@"integrity": "sha512-dq9AtApgg5PGFtBzPFSBl3HZQjHok5gaQCM6zh2Yk0aSmDCs1CbnVI8/HgASQkNKsWFpseIO9beg5xxpYhbIfA==","hasInstallScript": true,"license": "MIT",+ "peer": true,"dependencies": {"bindings": "^1.5.0","prebuild-install": "^7.1.1"@@ -6445,6 +6375,7 @@}],"license": "MIT",+ "peer": true,"dependencies": {"baseline-browser-mapping": "^2.10.12","caniuse-lite": "^1.0.30001782",@@ -6535,6 +6466,7 @@"resolved": "https://registry.npmjs.org/bullmq/-/bullmq-5.81.2.tgz","integrity": "sha512-Hi9GaVCC6HE9bQP65j/FNv1aL1fcEukTF99ezS5pl1Ud+joCFpNWiPCV45mWdkEmpuacS0XJdMMFGKPIHCwoPg==","license": "MIT",+ "peer": true,"dependencies": {"cron-parser": "4.9.0","ioredis": "5.11.1",@@ -6709,6 +6641,7 @@"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"readdirp": "^4.0.1"},@@ -6778,13 +6711,15 @@"version": "0.5.1","resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz","integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==",- "license": "MIT"+ "license": "MIT",+ "peer": true},"node_modules/class-validator": {"version": "0.15.1","resolved": "https://registry.npmjs.org/class-validator/-/class-validator-0.15.1.tgz","integrity": "sha512-LqoS80HBBSCVhz/3KloUly0ovokxpdOLR++Al3J3+dHXWt9sTKlKd4eYtoxhxyUjoe5+UcIM+5k9MIxyBWnRTw==","license": "MIT",+ "peer": true,"dependencies": {"@types/validator": "^13.15.3","libphonenumber-js": "^1.11.1",@@ -7574,7 +7509,8 @@"version": "0.0.1581282","resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1581282.tgz","integrity": "sha512-nv7iKtNZQshSW2hKzYNr46nM/Cfh5SEvE2oV0/SEGgc9XupIY5ggf84Cz8eJIkBce7S3bmTAauFD6aysMpnqsQ==",- "license": "BSD-3-Clause"+ "license": "BSD-3-Clause",+ "peer": true},"node_modules/dezalgo": {"version": "1.0.4",@@ -8044,6 +7980,7 @@"integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==","dev": true,"license": "MIT",+ "peer": true,"workspaces": ["packages/*"],@@ -8103,6 +8040,7 @@"integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==","dev": true,"license": "MIT",+ "peer": true,"bin": {"eslint-config-prettier": "bin/cli.js"},@@ -8210,37 +8148,6 @@"url": "https://github.com/sponsors/isaacs"}},- "node_modules/espree": {- "version": "10.4.0",- "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",- "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",- "dev": true,- "license": "BSD-2-Clause",- "dependencies": {- "acorn": "^8.15.0",- "acorn-jsx": "^5.3.2",- "eslint-visitor-keys": "^4.2.1"- },- "engines": {- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"- },- "funding": {- "url": "https://opencollective.com/eslint"- }- },- "node_modules/espree/node_modules/eslint-visitor-keys": {- "version": "4.2.1",- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",- "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",- "dev": true,- "license": "Apache-2.0",- "engines": {- "node": "^18.18.0 || ^20.9.0 || >=21.1.0"- },- "funding": {- "url": "https://opencollective.com/eslint"- }- },"node_modules/esprima": {"version": "4.0.1","resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",@@ -8434,6 +8341,7 @@"resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz","integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==","license": "MIT",+ "peer": true,"dependencies": {"accepts": "^2.0.0","body-parser": "^2.2.1",@@ -9231,6 +9139,7 @@"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.0.tgz","integrity": "sha512-jhunvfHWxd7J5EFfSgH4xsYJzSe/lfqbUCxiyyeaQasUsXeEHXtzVid+7EOGByc5JnFa23SSFL3Y2RV/z1T+eQ==","license": "MIT",+ "peer": true,"engines": {"node": ">=16.9.0"}@@ -9645,6 +9554,7 @@"integrity": "sha512-Yi1jqNC/Oq0N4hBgNH/YvBpP1P57QqundgytzYqy3yqAa7NZPNjSoi4SGbRAXDMdBzNE6xBCi5U7RgfrvMEUVQ==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@jest/core": "30.4.2","@jest/types": "30.4.1",@@ -11641,6 +11551,7 @@"resolved": "https://registry.npmjs.org/pg/-/pg-8.22.0.tgz","integrity": "sha512-8wih1vVIBMxoUM2oB4soJsD9tDnDpLv4OXBJ+EJzFsvycD+lfyIreC2gGHq78f8jbLLt+bvlPTFdFZfJkOuzAA==","license": "MIT",+ "peer": true,"dependencies": {"pg-connection-string": "^2.14.0","pg-pool": "^3.14.0",@@ -11969,6 +11880,7 @@"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==","dev": true,"license": "MIT",+ "peer": true,"bin": {"prettier": "bin/prettier.cjs"},@@ -12615,7 +12527,8 @@"version": "0.2.2","resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz","integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==",- "license": "Apache-2.0"+ "license": "Apache-2.0",+ "peer": true},"node_modules/require-directory": {"version": "2.1.1",@@ -12715,6 +12628,7 @@"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz","integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==","license": "Apache-2.0",+ "peer": true,"dependencies": {"tslib": "^2.1.0"}@@ -12847,6 +12761,7 @@"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz","integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==","license": "Apache-2.0",+ "peer": true,"dependencies": {"@img/colour": "^1.1.0","detect-libc": "^2.1.2",@@ -13108,6 +13023,7 @@"resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.8.tgz","integrity": "sha512-6Oy52pbg+kvdCVvjcN+FnY7BvxZ7cIHNScbvztT/It5d0vbwoJoVZmF2gjJmnV0/4WlXRfG15zc45ySk9Ah8bw==","license": "MIT",+ "peer": true,"dependencies": {"debug": "~4.4.1","ws": "~8.21.0"@@ -13696,6 +13612,7 @@"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"fast-deep-equal": "^3.1.3","fast-uri": "^3.0.1",@@ -14003,37 +13920,13 @@"url": "https://github.com/sponsors/sindresorhus"}},- "node_modules/ts-loader": {- "version": "9.6.2",- "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.6.2.tgz",- "integrity": "sha512-R4iuczmtgxvtuI556s+hTZ6/7Ee03VCAk/l/M8LY1OAsUgB7YydsCxkgq9D9pKRaD7GJqUi2u8fp9zZP/ufjKA==",- "dev": true,- "license": "MIT",- "dependencies": {- "chalk": "^4.1.0",- "picomatch": "^4.0.0",- "source-map": "^0.7.4"- },- "engines": {- "node": ">=12.0.0"- },- "peerDependencies": {- "loader-utils": "*",- "typescript": "*",- "webpack": "^4.0.0 || ^5.0.0"- },- "peerDependenciesMeta": {- "loader-utils": {- "optional": true- }- }- },"node_modules/ts-node": {"version": "10.9.2","resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz","integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==","devOptional": true,"license": "MIT",+ "peer": true,"dependencies": {"@cspotcode/source-map-support": "^0.8.0","@tsconfig/node10": "^1.0.7",@@ -14208,6 +14101,7 @@"resolved": "https://registry.npmjs.org/typeorm/-/typeorm-1.1.0.tgz","integrity": "sha512-iX/kvsV42/htCNAQUyElGW87E4Z12neZc6YUFBTEu0BnLiREYDNT5Wfw3wRqZw9vyOEC36zUBAY6Qvywoig06Q==","license": "MIT",+ "peer": true,"dependencies": {"@sqltools/formatter": "^1.2.5","ansis": "^4.3.1",@@ -14430,6 +14324,7 @@"integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==","devOptional": true,"license": "Apache-2.0",+ "peer": true,"bin": {"tsc": "bin/tsc","tsserver": "bin/tsserver"@@ -14746,6 +14641,7 @@"integrity": "sha512-wGN3qcrBQIFmQ/c0AiOAQBvrZ5lmY8vbbMv4Mxfgzqd/B6+9pXtLo73WuS1dSGXM5QYY3hZnIbvx+K1xxe6FyA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"@types/eslint-scope": "^3.7.7","@types/estree": "^1.0.8",@@ -14814,6 +14710,7 @@"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==","dev": true,"license": "MIT",+ "peer": true,"dependencies": {"fast-deep-equal": "^3.1.3","fast-uri": "^3.0.1",@@ -15303,6 +15200,7 @@"resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz","integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==","license": "MIT",+ "peer": true,"funding": {"url": "https://github.com/sponsors/colinhacks"}diff --git a/package.json b/package.jsonindex 3576975ce..f17d7527a 100644--- a/package.json+++ b/package.json@@ -108,7 +108,6 @@"zod": "^4.4.3"},"devDependencies": {- "@eslint/eslintrc": "^3.3.6","@eslint/js": "^10.0.1","@nestjs/cli": "^11.0.24","@nestjs/schematics": "^11.0.0",@@ -129,10 +128,8 @@"globals": "^17.9.0","jest": "^30.4.2","prettier": "^3.9.6",- "source-map-support": "^0.5.21","supertest": "^7.0.0","ts-jest": "^29.4.12",- "ts-loader": "^9.6.2","ts-node": "^10.9.2","tsconfig-paths": "^4.2.0","typescript": "~6.0.3",diff --git a/src/engine/types/whatsapp-web-js.types.ts b/src/engine/types/whatsapp-web-js.types.tsindex 21eaee3c5..f9811e07b 100644--- a/src/engine/types/whatsapp-web-js.types.ts+++ b/src/engine/types/whatsapp-web-js.types.ts@@ -180,10 +180,3 @@ export interface WwjsChannelMessage {hasMedia?: boolean;mediaUrl?: string;}--/**- * Group creation result.- */-export interface GroupCreateResult {- gid: { _serialized: string };-}diff --git a/src/modules/events/dto/ws-messages.dto.ts b/src/modules/events/dto/ws-messages.dto.tsindex 1e6194c59..cbe142251 100644--- a/src/modules/events/dto/ws-messages.dto.ts+++ b/src/modules/events/dto/ws-messages.dto.ts@@ -4,12 +4,6 @@* WebSocket message types for subscription protocol*/-// Client -> Server message types-export type WSClientMessageType = 'subscribe' | 'unsubscribe' | 'ping';--// Server -> Client message types-export type WSServerMessageType = 'subscribed' | 'unsubscribed' | 'event' | 'error' | 'pong';-// Valid event types that can be subscribed to over the socket. Every entry here MUST have a// matching EventsGateway.emit* producer — the drift guard in events.gateway.spec asserts this.export const SUBSCRIBABLE_EVENTS = [@@ -36,8 +30,6 @@ export const SUBSCRIBABLE_EVENTS = ['call.missed',] as const;-export type SubscribableEvent = (typeof SUBSCRIBABLE_EVENTS)[number] | '*';-// Client -> Server: Subscribe requestexport interface WSSubscribeRequest {type: 'subscribe';@@ -106,18 +98,7 @@ export interface WSPongResponse {timestamp: string;}-// Union type for all server messages-export type WSServerMessage =- WSSubscribedResponse | WSUnsubscribedResponse | WSEventMessage | WSErrorResponse | WSPongResponse;-// Room name builderexport function buildRoomName(sessionId: string, event: string): string {return `session:${sessionId}:${event}`;}--// Parse room name back to components-export function parseRoomName(room: string): { sessionId: string; event: string } | null {- const match = room.match(/^session:([^:]+):(.+)$/);- if (!match) return null;- return { sessionId: match[1], event: match[2] };-}diff --git a/src/modules/integration/dto/instance.dto.ts b/src/modules/integration/dto/instance.dto.tsindex 74f775973..e084c948a 100644--- a/src/modules/integration/dto/instance.dto.ts+++ b/src/modules/integration/dto/instance.dto.ts@@ -139,5 +139,3 @@ export class InstanceView {})ingressUrls!: IngressUrl[];}--export type MintedInstance = InstanceView; // identical shape; `secret` carries the plaintext oncediff --git a/src/modules/integration/integration.constants.ts b/src/modules/integration/integration.constants.tsindex 5ca53ef3f..b49e0754d 100644--- a/src/modules/integration/integration.constants.ts+++ b/src/modules/integration/integration.constants.ts@@ -1,3 +1 @@-export const INGRESS_MAX_BODY_BYTES_DEFAULT = 262144; // 256 KiB, matches the spec's per-route default-export const INGRESS_REPLAY_TOLERANCE_SEC_DEFAULT = 300;export const INGRESS_DISPATCH_TIMEOUT_MS = 5000; // mirrors SANDBOX_HOOK_TIMEOUT_MSdiff --git a/src/modules/session/reconnect-config.spec.ts b/src/modules/session/reconnect-config.spec.tsindex 213681509..3354b3bfa 100644--- a/src/modules/session/reconnect-config.spec.ts+++ b/src/modules/session/reconnect-config.spec.ts@@ -1,4 +1,5 @@-import { resolveReconnectConfig, clampReconnectDelay } from './session.service';+import { clampReconnectDelay } from './reconnect-policy';+import { resolveReconnectConfig } from './session-engine-lifecycle.service';// an OPERATOR-supplied session.config flows into the reconnect backoff math unchecked.// config:{reconnectBaseDelay:'x'} makes the delay NaN -> setTimeout(fn, NaN) fires at 0 (relaunchdiff --git a/src/modules/session/session.service.spec.ts b/src/modules/session/session.service.spec.tsindex f482a97a8..985fe9bb3 100644--- a/src/modules/session/session.service.spec.ts+++ b/src/modules/session/session.service.spec.ts@@ -13,13 +13,8 @@ import {HttpStatus,} from '@nestjs/common';import { ConfigService } from '@nestjs/config';-import {- SessionService,- ACK_RECONCILE_DELAY_MS,- SESSION_WATCHDOG_INTERVAL_MS,- SESSION_WATCHDOG_MAX_FAILURES,- SESSION_WATCHDOG_PROBE_TIMEOUT_MS,-} from './session.service';+import { SessionService } from './session.service';+import { ACK_RECONCILE_DELAY_MS } from './message-projector.service';import { SessionEngineLifecycle } from './session-engine-lifecycle.service';import { Session, SessionStatus } from './entities/session.entity';import { Message, MessageDirection, MessageStatus } from '../message/entities/message.entity';@@ -31,7 +26,12 @@ import { EngineFactory } from '../../engine/engine.factory';import { EngineRegistry } from '../../engine/engine-registry.service';import type { KeyedMutationQueue } from '../../common/utils/keyed-mutation-queue';import { SessionLidResolver } from './session-lid-resolver.service';-import { SessionLivenessWatchdog } from './session-liveness-watchdog.service';+import {+ SessionLivenessWatchdog,+ SESSION_WATCHDOG_INTERVAL_MS,+ SESSION_WATCHDOG_MAX_FAILURES,+ SESSION_WATCHDOG_PROBE_TIMEOUT_MS,+} from './session-liveness-watchdog.service';import { MessageProjector } from './message-projector.service';import { LidMappingStoreService } from '../../engine/identity/lid-mapping-store.service';import { EventsGateway } from '../events/events.gateway';diff --git a/src/modules/session/session.service.ts b/src/modules/session/session.service.tsindex 13734d6fb..0ea59adc7 100644--- a/src/modules/session/session.service.ts+++ b/src/modules/session/session.service.ts@@ -28,20 +28,6 @@ import { IWhatsAppEngine, ChatSummary, ChatState } from '../../engine/interfacesimport { createLogger } from '../../common/services/logger.service';import { HookManager } from '../../core/hooks';-// Re-exported so the existing spec import paths keep working after these moved out.-export { clampReconnectDelay } from './reconnect-policy';-export { ACK_RECONCILE_DELAY_MS } from './message-projector.service';-export {- SESSION_WATCHDOG_INTERVAL_MS,- SESSION_WATCHDOG_PROBE_TIMEOUT_MS,- SESSION_WATCHDOG_MAX_FAILURES,-} from './session-liveness-watchdog.service';-export {- resolveReconnectConfig,- resolveMaxConcurrentSessions,- EngineInitTimeoutError,-} from './session-engine-lifecycle.service';-/*** The session-record API: CRUD over the sessions table, aggregate stats, and the thin engine query* proxies (QR/pairing/chats/groups/chat-state) behind the controller routes. Every engine LIFECYCLEdiff --git a/src/modules/webhook/dto/webhook.dto.ts b/src/modules/webhook/dto/webhook.dto.tsindex a44977421..d44b6fd1a 100644--- a/src/modules/webhook/dto/webhook.dto.ts+++ b/src/modules/webhook/dto/webhook.dto.ts@@ -61,8 +61,6 @@ export const WEBHOOK_EVENTS = [...WEBHOOK_RESERVED_EVENTS,] as const;-export type WebhookEventType = (typeof WEBHOOK_EVENTS)[number];-export class CreateWebhookDto {@ApiProperty({description: 'Webhook URL to receive events',