1
0
Fork 0
mirror of synced 2024-06-22 04:10:54 +12:00

Move trigger logic inside pro

This commit is contained in:
Rory Powell 2022-10-07 13:57:10 +01:00
parent af24f72166
commit ed948e6ae7
3 changed files with 24 additions and 24 deletions

View file

@ -3,3 +3,9 @@ import { QuotaUsage } from "../../documents"
export interface GetLicenseRequest { export interface GetLicenseRequest {
quotaUsage: QuotaUsage quotaUsage: QuotaUsage
} }
export interface QuotaTriggeredRequest {
percentage: number
name: string
resetDate?: string
}

View file

@ -50,7 +50,7 @@ export interface Account extends CreateAccount {
licenseKey?: string licenseKey?: string
licenseKeyActivatedAt?: number licenseKeyActivatedAt?: number
licenseOverrides?: LicenseOverrides licenseOverrides?: LicenseOverrides
quotaUsage?: AccountQuotaUsage quotaUsage?: QuotaUsage
} }
export interface PasswordAccount extends Account { export interface PasswordAccount extends Account {
@ -93,26 +93,3 @@ export interface OAuthTokens {
accessToken: string accessToken: string
refreshToken: string refreshToken: string
} }
export type QuotaTriggers = {
[key: string]: string | null
}
export interface AccountStaticUsage extends StaticUsage {
triggers?: {
[key in StaticQuotaName]?: QuotaTriggers
}
}
export interface AccountMonthlyUsage extends MonthlyUsage {
triggers?: {
[key in MonthlyQuotaName]?: QuotaTriggers
}
}
export interface AccountQuotaUsage extends QuotaUsage {
usageQuota: AccountStaticUsage
monthly: {
[key: string]: AccountMonthlyUsage
}
}

View file

@ -24,17 +24,27 @@ export interface UsageBreakdown {
} }
} }
export type QuotaTriggers = {
[key: string]: string | undefined
}
export interface StaticUsage { export interface StaticUsage {
[StaticQuotaName.APPS]: number [StaticQuotaName.APPS]: number
[StaticQuotaName.PLUGINS]: number [StaticQuotaName.PLUGINS]: number
[StaticQuotaName.USER_GROUPS]: number [StaticQuotaName.USER_GROUPS]: number
[StaticQuotaName.ROWS]: number [StaticQuotaName.ROWS]: number
triggers: {
[key in StaticQuotaName]?: QuotaTriggers
}
} }
export interface MonthlyUsage { export interface MonthlyUsage {
[MonthlyQuotaName.QUERIES]: number [MonthlyQuotaName.QUERIES]: number
[MonthlyQuotaName.AUTOMATIONS]: number [MonthlyQuotaName.AUTOMATIONS]: number
[MonthlyQuotaName.DAY_PASSES]: number [MonthlyQuotaName.DAY_PASSES]: number
triggers: {
[key in MonthlyQuotaName]?: QuotaTriggers
}
breakdown?: { breakdown?: {
[key in BreakdownQuotaName]?: UsageBreakdown [key in BreakdownQuotaName]?: UsageBreakdown
} }
@ -56,6 +66,13 @@ export interface QuotaUsage extends BaseQuotaUsage {
} }
} }
export type SetUsageValues = {
total: number
app?: number
breakdown?: number
triggers?: QuotaTriggers
}
export type UsageValues = { export type UsageValues = {
total: number total: number
app?: number app?: number