diff --git a/packages/types/src/api/web/global/license.ts b/packages/types/src/api/web/global/license.ts index 21d8876412..344ab829c2 100644 --- a/packages/types/src/api/web/global/license.ts +++ b/packages/types/src/api/web/global/license.ts @@ -1,5 +1,7 @@ // LICENSE KEY +import { QuotaUsage } from "../../../documents" + export interface ActivateLicenseKeyRequest { licenseKey: string } @@ -23,3 +25,5 @@ export interface GetOfflineLicenseTokenResponse { export interface GetOfflineIdentifierResponse { identifierBase64: string } + +export interface GetQuotaUsageResponse extends QuotaUsage {} diff --git a/packages/worker/src/api/controllers/global/license.ts b/packages/worker/src/api/controllers/global/license.ts index 111cb5cea3..04f76a6593 100644 --- a/packages/worker/src/api/controllers/global/license.ts +++ b/packages/worker/src/api/controllers/global/license.ts @@ -5,6 +5,7 @@ import { GetLicenseKeyResponse, GetOfflineIdentifierResponse, GetOfflineLicenseTokenResponse, + GetQuotaUsageResponse, UserCtx, } from "@budibase/types" @@ -36,7 +37,7 @@ export async function deleteLicenseKey(ctx: UserCtx) { // OFFLINE LICENSE export async function activateOfflineLicenseToken( - ctx: UserCtx + ctx: UserCtx ) { const { offlineLicenseToken } = ctx.request.body await licensing.offline.activateOfflineLicenseToken(offlineLicenseToken) @@ -70,14 +71,16 @@ export async function getOfflineLicenseIdentifier( // LICENSES -export const refresh = async (ctx: any) => { +export const refresh = async (ctx: UserCtx) => { await licensing.cache.refresh() ctx.status = 200 } // USAGE -export const getQuotaUsage = async (ctx: any) => { +export const getQuotaUsage = async ( + ctx: UserCtx +) => { ctx.body = await quotas.getQuotaUsage() ctx.status = 200 }