Move trigger logic inside pro
This commit is contained in:
parent
af24f72166
commit
ed948e6ae7
|
@ -3,3 +3,9 @@ import { QuotaUsage } from "../../documents"
|
|||
export interface GetLicenseRequest {
|
||||
quotaUsage: QuotaUsage
|
||||
}
|
||||
|
||||
export interface QuotaTriggeredRequest {
|
||||
percentage: number
|
||||
name: string
|
||||
resetDate?: string
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ export interface Account extends CreateAccount {
|
|||
licenseKey?: string
|
||||
licenseKeyActivatedAt?: number
|
||||
licenseOverrides?: LicenseOverrides
|
||||
quotaUsage?: AccountQuotaUsage
|
||||
quotaUsage?: QuotaUsage
|
||||
}
|
||||
|
||||
export interface PasswordAccount extends Account {
|
||||
|
@ -93,26 +93,3 @@ export interface OAuthTokens {
|
|||
accessToken: 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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,17 +24,27 @@ export interface UsageBreakdown {
|
|||
}
|
||||
}
|
||||
|
||||
export type QuotaTriggers = {
|
||||
[key: string]: string | undefined
|
||||
}
|
||||
|
||||
export interface StaticUsage {
|
||||
[StaticQuotaName.APPS]: number
|
||||
[StaticQuotaName.PLUGINS]: number
|
||||
[StaticQuotaName.USER_GROUPS]: number
|
||||
[StaticQuotaName.ROWS]: number
|
||||
triggers: {
|
||||
[key in StaticQuotaName]?: QuotaTriggers
|
||||
}
|
||||
}
|
||||
|
||||
export interface MonthlyUsage {
|
||||
[MonthlyQuotaName.QUERIES]: number
|
||||
[MonthlyQuotaName.AUTOMATIONS]: number
|
||||
[MonthlyQuotaName.DAY_PASSES]: number
|
||||
triggers: {
|
||||
[key in MonthlyQuotaName]?: QuotaTriggers
|
||||
}
|
||||
breakdown?: {
|
||||
[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 = {
|
||||
total: number
|
||||
app?: number
|
||||
|
|
Loading…
Reference in New Issue