Add relay activity
This commit is contained in:
@@ -115,6 +115,15 @@ export type Invoice = {
|
||||
period_end: number
|
||||
}
|
||||
|
||||
export type Activity = {
|
||||
id: string
|
||||
tenant: string
|
||||
created_at: number
|
||||
activity_type: string
|
||||
resource_type: string
|
||||
resource_id: string
|
||||
}
|
||||
|
||||
export type Identity = {
|
||||
pubkey: string
|
||||
is_admin: boolean
|
||||
@@ -229,6 +238,10 @@ export function getRelay(id: string) {
|
||||
return callApi<undefined, Relay>("GET", `/relays/${id}`)
|
||||
}
|
||||
|
||||
export function listRelayActivity(id: string) {
|
||||
return callApi<undefined, Activity[]>("GET", `/relays/${id}/activity`)
|
||||
}
|
||||
|
||||
export function createRelay(input: CreateRelayInput) {
|
||||
return callApi<CreateRelayInput, Relay>("POST", "/relays", input)
|
||||
}
|
||||
|
||||
@@ -9,12 +9,14 @@ import {
|
||||
deactivateRelay,
|
||||
getRelay,
|
||||
getTenant,
|
||||
listRelayActivity,
|
||||
listRelays,
|
||||
listTenantInvoices,
|
||||
listTenantRelays,
|
||||
listTenants,
|
||||
updateRelay,
|
||||
updateTenantBilling,
|
||||
type Activity,
|
||||
type CreateRelayInput,
|
||||
type Relay,
|
||||
type Tenant,
|
||||
@@ -88,6 +90,8 @@ export const useTenantInvoices = () => createResource(() => listTenantInvoices(a
|
||||
|
||||
export const useRelay = (relayId: () => string) => createResource(relayId, getRelay)
|
||||
|
||||
export const useRelayActivity = (relayId: () => string) => createResource(relayId, listRelayActivity)
|
||||
|
||||
export const useAdminTenants = () => createResource(listTenants)
|
||||
|
||||
export const useAdminRelays = () => createResource(listRelays)
|
||||
@@ -135,4 +139,4 @@ export async function getRelayMembers(url: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export type { Relay, Tenant }
|
||||
export type { Activity, Relay, Tenant }
|
||||
|
||||
Reference in New Issue
Block a user