feat: add WeCom outbox management features including retry and ignore actions, permissions, and UI integration
This commit is contained in:
@@ -193,6 +193,23 @@ export type WxWorkKFAccount = {
|
||||
managePrivilege: boolean
|
||||
}
|
||||
|
||||
export type ChannelMessageOutbox = {
|
||||
id: number
|
||||
channelType: string
|
||||
conversationId: number
|
||||
messageId: number
|
||||
payload: string
|
||||
sendStatus: string
|
||||
retryCount: number
|
||||
nextRetryAt: string
|
||||
lastError: string
|
||||
sentAt: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
createUserName: string
|
||||
updateUserName: string
|
||||
}
|
||||
|
||||
export type CreateAdminChannelPayload = {
|
||||
channelType: string
|
||||
aiAgentId: number
|
||||
@@ -907,6 +924,28 @@ export function fetchWxWorkKFAccounts() {
|
||||
return request<WxWorkKFAccount[]>("/api/dashboard/channel/wxwork/kf/accounts")
|
||||
}
|
||||
|
||||
export function fetchWxWorkOutboxFailures(
|
||||
query?: Record<string, string | number | undefined>
|
||||
) {
|
||||
return request<PageResult<ChannelMessageOutbox>>(
|
||||
`/api/dashboard/channel/wxwork/outbox/failed/list${toQueryString(query)}`
|
||||
)
|
||||
}
|
||||
|
||||
export function retryWxWorkOutbox(id: number) {
|
||||
return request<void>("/api/dashboard/channel/wxwork/outbox/retry", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ id }),
|
||||
})
|
||||
}
|
||||
|
||||
export function ignoreWxWorkOutbox(id: number) {
|
||||
return request<void>("/api/dashboard/channel/wxwork/outbox/ignore", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ id }),
|
||||
})
|
||||
}
|
||||
|
||||
export function createChannel(payload: CreateAdminChannelPayload) {
|
||||
return request<AdminChannel>("/api/dashboard/channel/create", {
|
||||
method: "POST",
|
||||
|
||||
Reference in New Issue
Block a user