fix: track live downstream cmpp connections
This commit is contained in:
+22
-8
@@ -264,7 +264,7 @@ export type ClientSmsApplication = {
|
||||
sentToday?: number;
|
||||
deliveryRate?: number;
|
||||
cmppStatus?: 'connected' | 'degraded' | 'disconnected' | 'inactive';
|
||||
cmppConnections?: CmppConnectionState[];
|
||||
cmppConnections?: CmppDownstreamConnection[];
|
||||
};
|
||||
|
||||
export type ClientSmsSignature = {
|
||||
@@ -634,7 +634,26 @@ export type EnterpriseApplication = {
|
||||
sentToday?: number;
|
||||
deliveryRate?: number;
|
||||
cmppStatus?: 'connected' | 'degraded' | 'disconnected' | 'inactive';
|
||||
cmppConnections?: CmppConnectionState[];
|
||||
cmppConnections?: CmppDownstreamConnection[];
|
||||
};
|
||||
|
||||
export type CmppDownstreamConnection = {
|
||||
id: string;
|
||||
tenantId: string;
|
||||
applicationId: string;
|
||||
account: string;
|
||||
enterpriseCode: string;
|
||||
connectionId: string;
|
||||
remoteIp?: string | null;
|
||||
protocol?: string | null;
|
||||
status: string;
|
||||
connectedAt: string;
|
||||
lastHeartbeatAt?: string | null;
|
||||
lastSubmitAt?: string | null;
|
||||
lastDeliverAt?: string | null;
|
||||
disconnectedAt?: string | null;
|
||||
lastError?: string | null;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type CmppConnectionState = {
|
||||
@@ -657,7 +676,7 @@ export type CmppConnectionState = {
|
||||
|
||||
export type ApplicationConnectionsResponse = {
|
||||
application: EnterpriseApplication;
|
||||
connections: CmppConnectionState[];
|
||||
connections: CmppDownstreamConnection[];
|
||||
summary: { desiredConnections: number; currentConnections: number; status: string };
|
||||
};
|
||||
|
||||
@@ -838,11 +857,6 @@ export const adminApi = {
|
||||
}),
|
||||
listApplicationConnections: (applicationId: string) =>
|
||||
request<ApplicationConnectionsResponse>(`/admin/enterprise-applications/${applicationId}/connections`),
|
||||
disconnectApplicationConnection: (applicationId: string, connectionId: string, reason?: string) =>
|
||||
request<CmppConnectionState>(`/admin/enterprise-applications/${applicationId}/connections/${connectionId}`, {
|
||||
method: 'DELETE',
|
||||
body: JSON.stringify({ reason }),
|
||||
}),
|
||||
getApplicationCmppParams: (applicationId: string) =>
|
||||
request<ApplicationCmppParams>(`/admin/enterprise-applications/${applicationId}/cmpp-params`),
|
||||
listChannels: () => request<AdminChannel[]>('/admin/channels'),
|
||||
|
||||
Reference in New Issue
Block a user