Remnawave_backend/libs/contract/api/controllers/bandwidth-stats.ts

29 lines
1.1 KiB
TypeScript

export const BANDWIDTH_STATS_CONTROLLER = 'bandwidth-stats' as const;
export const BANDWIDTH_STATS_NODES_ROUTE = 'nodes' as const;
export const BANDWIDTH_STATS_USERS_ROUTE = 'users' as const;
export const BANDWIDTH_STATS_INTERNAL_SQUADS_ROUTE = 'internal-squads' as const;
export const BANDWIDTH_STATS_NODES_CONTROLLER =
`${BANDWIDTH_STATS_CONTROLLER}/${BANDWIDTH_STATS_NODES_ROUTE}` as const;
export const BANDWIDTH_STATS_USERS_CONTROLLER =
`${BANDWIDTH_STATS_CONTROLLER}/${BANDWIDTH_STATS_USERS_ROUTE}` as const;
export const BANDWIDTH_STATS_INTERNAL_SQUADS_CONTROLLER =
`${BANDWIDTH_STATS_CONTROLLER}/${BANDWIDTH_STATS_INTERNAL_SQUADS_ROUTE}` as const;
export const BANDWIDTH_STATS_ROUTES = {
NODES: {
GET: '',
GET_REALTIME: 'realtime',
GET_USERS: (uuid: string) => `${uuid}/users`,
GET_USERS_BY_NODES: 'users',
GET_USAGE: 'usage',
},
USERS: {
GET_BY_ID: (userId: string) => `${userId}`,
},
INTERNAL_SQUADS: {
GET_USAGE: (uuid: string) => `${uuid}/usage`,
USER_USAGE: (squadUuid: string, userId: string) => `${squadUuid}/users/${userId}/usage`,
},
} as const;