Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix(dashboard): migrate the API keys table to TanStack Table v9
Yudhi Armyndharis0b5f8bc39124
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bc1d119ce..4de50388d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0- Base image is digest-pinned (`node:22-slim`) with `npm@12` pinned, `@types/node` moved to `^22`, `whatsapp-web.js` pinned exactly, and the backup/restore scripts now ship in the image.- The session routes' path parameter is uniformly `{sessionId}` (22 routes previously mixed `{id}`). The URLs are unchanged — OpenAPI path templates, reference tables and Prometheus route labels respell only.- Major dependency bumps, each landed separately behind the full suite plus a live-Redis queue run: bullmq 6 (with `@nestjs/bullmq` 11.0.5), ioredis 6 (RESP3 connections by default — no configuration change required), better-sqlite3 13 (N-API prebuilds ship in the package), and https-proxy-agent 9 / socks-proxy-agent 10 for the Baileys proxy path.+- Dashboard: `@tanstack/react-table` moves to v9 — the API keys table migrates to the new `useTable`/`tableFeatures` registration model, registering only column visibility. No behavior change; the responsive column hiding works as before.- Internal reorganization behind unchanged public surfaces: the webhook delivery engine, the message send path, and the plugin loader's installer/sandbox each split into dedicated services; the engine interface is composed of fourteen capability slices; the wwebjs adapter delegates lifecycle, reconciliation, stuck-auth and call tracking; the engine capability matrix is derived from the interface with curated exceptions; plugin host services resolve core-defined ports instead of reaching into feature modules.### Documentationdiff --git a/dashboard/src/pages/ApiKeys.tsx b/dashboard/src/pages/ApiKeys.tsxindex 004dacf1b..ba11f71b9 100644--- a/dashboard/src/pages/ApiKeys.tsx+++ b/dashboard/src/pages/ApiKeys.tsx@@ -1,11 +1,13 @@import { useState, useEffect, useMemo } from 'react';import { Trans, useTranslation } from 'react-i18next';import {- useReactTable,- getCoreRowModel,- flexRender,+ useTable,+ tableFeatures,createColumnHelper,- type VisibilityState,+ createCoreRowModel,+ columnVisibilityFeature,+ flexRender,+ type ColumnVisibilityState,} from '@tanstack/react-table';import {Plus,@@ -46,7 +48,12 @@ function useWindowSize() {return width;}-const columnHelper = createColumnHelper<ApiKey>();+const features = tableFeatures({+ columnVisibilityFeature,+ coreRowModel: createCoreRowModel(),+});++const columnHelper = createColumnHelper<typeof features, ApiKey>();export function ApiKeys() {const { t } = useTranslation();@@ -68,7 +75,7 @@ export function ApiKeys() {const windowWidth = useWindowSize();const isMobile = windowWidth < 768;const isSmall = windowWidth < 640;- const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({});+ const [columnVisibility, setColumnVisibility] = useState<ColumnVisibilityState>({});useEffect(() => {setColumnVisibility({ key: !isSmall, lastUsed: !isMobile });@@ -128,90 +135,91 @@ export function ApiKeys() {};const columns = useMemo(- () => [- columnHelper.accessor('name', {- header: () => t('apiKeys.columns.name'),- cell: info => <span className="name-cell">{info.getValue()}</span>,- }),- columnHelper.accessor('keyPrefix', {- id: 'key',- header: () => t('apiKeys.columns.key'),- cell: info => {- const apiKey = info.row.original;- return (- <span className="key-cell">- <code>{visibleKeys.has(apiKey.id) ? apiKey.keyPrefix + '...' : apiKey.keyPrefix + '****'}</code>- <button- className="icon-btn-sm"- onClick={() => toggleKeyVisibility(apiKey.id)}- aria-label={visibleKeys.has(apiKey.id) ? t('common.hideApiKey') : t('common.showApiKey')}- >- {visibleKeys.has(apiKey.id) ? <EyeOff size={14} /> : <Eye size={14} />}- </button>- </span>- );- },- }),- columnHelper.accessor('role', {- header: () => t('apiKeys.columns.role'),- cell: info => <span className="permission-badge">{info.getValue()}</span>,- }),- columnHelper.accessor('isActive', {- header: () => t('apiKeys.columns.status'),- cell: info => (- <span className={`status-badge ${info.getValue() ? 'active' : 'inactive'}`}>- {info.getValue() ? t('apiKeys.statuses.active') : t('apiKeys.statuses.revoked')}- </span>- ),- }),- columnHelper.accessor('lastUsedAt', {- id: 'lastUsed',- header: () => t('apiKeys.columns.lastUsed'),- cell: info => (- <span className="last-used">- {info.getValue() ? new Date(info.getValue()!).toLocaleDateString() : t('common.never')}- </span>- ),- }),- columnHelper.display({- id: 'actions',- header: () => t('apiKeys.columns.actions'),- cell: info => {- const apiKey = info.row.original;- return (- <span className="actions-cell">- {/* No per-row copy: the full key only exists once (post-creation modal); the row- only has the prefix, so a copy button here could only copy a useless fragment. */}- {apiKey.isActive && (+ () =>+ columnHelper.columns([+ columnHelper.accessor('name', {+ header: () => t('apiKeys.columns.name'),+ cell: info => <span className="name-cell">{info.getValue()}</span>,+ }),+ columnHelper.accessor('keyPrefix', {+ id: 'key',+ header: () => t('apiKeys.columns.key'),+ cell: info => {+ const apiKey = info.row.original;+ return (+ <span className="key-cell">+ <code>{visibleKeys.has(apiKey.id) ? apiKey.keyPrefix + '...' : apiKey.keyPrefix + '****'}</code><button- className="icon-btn"- onClick={() => setConfirmAction({ type: 'revoke', id: apiKey.id, name: apiKey.name })}- title={t('apiKeys.actions.revoke')}+ className="icon-btn-sm"+ onClick={() => toggleKeyVisibility(apiKey.id)}+ aria-label={visibleKeys.has(apiKey.id) ? t('common.hideApiKey') : t('common.showApiKey')}>- <RefreshCw size={16} />+ {visibleKeys.has(apiKey.id) ? <EyeOff size={14} /> : <Eye size={14} />}</button>- )}- <button- className="icon-btn danger"- onClick={() => setConfirmAction({ type: 'delete', id: apiKey.id, name: apiKey.name })}- title={t('apiKeys.actions.delete')}- >- <Trash2 size={16} />- </button>+ </span>+ );+ },+ }),+ columnHelper.accessor('role', {+ header: () => t('apiKeys.columns.role'),+ cell: info => <span className="permission-badge">{info.getValue()}</span>,+ }),+ columnHelper.accessor('isActive', {+ header: () => t('apiKeys.columns.status'),+ cell: info => (+ <span className={`status-badge ${info.getValue() ? 'active' : 'inactive'}`}>+ {info.getValue() ? t('apiKeys.statuses.active') : t('apiKeys.statuses.revoked')}+ </span>+ ),+ }),+ columnHelper.accessor('lastUsedAt', {+ id: 'lastUsed',+ header: () => t('apiKeys.columns.lastUsed'),+ cell: info => (+ <span className="last-used">+ {info.getValue() ? new Date(info.getValue()!).toLocaleDateString() : t('common.never')}</span>- );- },- }),- ],+ ),+ }),+ columnHelper.display({+ id: 'actions',+ header: () => t('apiKeys.columns.actions'),+ cell: info => {+ const apiKey = info.row.original;+ return (+ <span className="actions-cell">+ {/* No per-row copy: the full key only exists once (post-creation modal); the row+ only has the prefix, so a copy button here could only copy a useless fragment. */}+ {apiKey.isActive && (+ <button+ className="icon-btn"+ onClick={() => setConfirmAction({ type: 'revoke', id: apiKey.id, name: apiKey.name })}+ title={t('apiKeys.actions.revoke')}+ >+ <RefreshCw size={16} />+ </button>+ )}+ <button+ className="icon-btn danger"+ onClick={() => setConfirmAction({ type: 'delete', id: apiKey.id, name: apiKey.name })}+ title={t('apiKeys.actions.delete')}+ >+ <Trash2 size={16} />+ </button>+ </span>+ );+ },+ }),+ ]),[visibleKeys, t],);- const table = useReactTable({+ const table = useTable({+ features,data: apiKeys,columns,state: { columnVisibility },onColumnVisibilityChange: setColumnVisibility,- getCoreRowModel: getCoreRowModel(),});if (loading) {