import { AddressCount } from '@payid-org/server-metrics' ; import knex from '../db/knex' ; returns export async function getAddressCounts ( ) { const addressCounts = await knex . select ( 'address.paymentNetwork' , 'address.environment' ) . count ( '* as count' ) . from < AddressCount > ( 'address' ) . groupBy ( 'address.paymentNetwork' , 'address.environment' ) . orderBy ( [ 'address.paymentNetwork' , 'address.environment' ] ) ; return addressCounts . map ( ( addressCount ) => ( { paymentNetwork : addressCount . paymentNetwork , environment : addressCount . environment , count : Number ( addressCount . count ) , } ) ) ; } returns export async function getPayIdCount ( ) { const payIdCount = await knex . count ( '* as count' ) . from < Account > ( 'account' ) . then ( ( record ) => { return Number ( record [ 0 ] . count ) ; } ) ; return payIdCount ; }