TypeScript function that aggregates channel connection status and last inbound timestamps for an org.
// Source: https://github.com/kevinrivm/vocero-crm | License: MIT | Copyright 2026 Kevin Belier
// Provided via justclaw.it.com; keep this notice with the code.
import { eq, max } from "drizzle-orm";
import { CHANNEL_ORDER, type Channel } from "@/lib/channels";
import { getDb, schema } from "@/lib/db";
import { scoped } from "@/lib/db/tenant";
import { enabledChannels } from "@/server/channels/enabled";
import { getInstagramCredentialsByOrg } from "@/server/instagram/credentials";
import { getMessengerCredentialsByOrg } from "@/server/messenger/credentials";
import { getCredentialsByOrg } from "@/server/whatsapp/credentials";
import { webhookVerifyToken } from "@/server/whatsapp/webhook-url";
import {
zernioConnectionsOfOrg,
type ZernioConnection,
} from "@/server/zernio/conexiones";
i
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key