minor renaming
This commit is contained in:
parent
79226777b1
commit
b230f16369
|
@ -34,13 +34,12 @@ describe("/rows", () => {
|
|||
.expect(status)
|
||||
|
||||
const getRowUsage = async () => {
|
||||
return config.doInContext(null, () =>
|
||||
quotas.getCurrentUsageValue(QuotaUsageType.STATIC, StaticQuotaName.ROWS)
|
||||
)
|
||||
const { total } = await config.doInContext(null, () => quotas.getCurrentUsageValues(QuotaUsageType.STATIC, StaticQuotaName.ROWS))
|
||||
return total
|
||||
}
|
||||
|
||||
const getQueryUsage = async () => {
|
||||
const { total } = await config.doInContext(null, () => quotas.getAllCurrentUsageValue(QuotaUsageType.MONTHLY, MonthlyQuotaName.QUERIES))
|
||||
const { total } = await config.doInContext(null, () => quotas.getCurrentUsageValues(QuotaUsageType.MONTHLY, MonthlyQuotaName.QUERIES))
|
||||
return total
|
||||
}
|
||||
|
||||
|
|
|
@ -6,52 +6,52 @@ export enum BreakdownQuotaName {
|
|||
AUTOMATIONS = "automations",
|
||||
}
|
||||
|
||||
export const StoredByAppQuotaNames = [
|
||||
export const APP_QUOTA_NAMES = [
|
||||
StaticQuotaName.ROWS,
|
||||
MonthlyQuotaName.QUERIES,
|
||||
MonthlyQuotaName.AUTOMATIONS,
|
||||
]
|
||||
|
||||
export const NamesToBreakdown = [
|
||||
export const BREAKDOWN_QUOTA_NAMES = [
|
||||
MonthlyQuotaName.QUERIES,
|
||||
MonthlyQuotaName.AUTOMATIONS,
|
||||
]
|
||||
|
||||
export interface Breakdown {
|
||||
export interface UsageBreakdown {
|
||||
parent: MonthlyQuotaName
|
||||
values: {
|
||||
[key: string]: number
|
||||
}
|
||||
}
|
||||
|
||||
export type Monthly = {
|
||||
export type MonthlyUsage = {
|
||||
[MonthlyQuotaName.QUERIES]: number
|
||||
[MonthlyQuotaName.AUTOMATIONS]: number
|
||||
[MonthlyQuotaName.DAY_PASSES]: number
|
||||
breakdown?: {
|
||||
[key in BreakdownQuotaName]?: Breakdown
|
||||
[key in BreakdownQuotaName]?: UsageBreakdown
|
||||
}
|
||||
}
|
||||
|
||||
export interface UsageInternal {
|
||||
export interface BaseQuotaUsage {
|
||||
usageQuota: {
|
||||
[key in StaticQuotaName]: number
|
||||
}
|
||||
monthly: {
|
||||
[key: string]: Monthly
|
||||
[key: string]: MonthlyUsage
|
||||
}
|
||||
}
|
||||
|
||||
export interface QuotaUsage extends UsageInternal {
|
||||
export interface QuotaUsage extends BaseQuotaUsage {
|
||||
_id: string
|
||||
_rev?: string
|
||||
quotaReset: string
|
||||
apps?: {
|
||||
[key: string]: UsageInternal
|
||||
[key: string]: BaseQuotaUsage
|
||||
}
|
||||
}
|
||||
|
||||
export type QuotaValues = {
|
||||
export type UsageValues = {
|
||||
total: number
|
||||
app?: number
|
||||
breakdown?: number
|
||||
|
|
Loading…
Reference in New Issue