From 7c4fe15781b61f1ba62172c44c9d4c71bc40b83a Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Mon, 10 Jul 2023 16:12:19 +0100 Subject: [PATCH] Request / response renames --- packages/types/src/api/web/global/license.ts | 4 ++-- .../worker/src/api/controllers/global/license.ts | 12 ++++++------ packages/worker/src/api/routes/global/license.ts | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/types/src/api/web/global/license.ts b/packages/types/src/api/web/global/license.ts index 4a36c4f1d8..900a0db96d 100644 --- a/packages/types/src/api/web/global/license.ts +++ b/packages/types/src/api/web/global/license.ts @@ -10,11 +10,11 @@ export interface GetLicenseKeyResponse { // OFFLINE LICENSE -export interface ActivateOfflineLicenseRequest { +export interface ActivateOfflineLicenseTokenRequest { offlineLicenseToken: string } -export interface GetOfflineLicenseResponse { +export interface GetOfflineLicenseTokenResponse { offlineLicenseToken: string } diff --git a/packages/worker/src/api/controllers/global/license.ts b/packages/worker/src/api/controllers/global/license.ts index 73b3c72d1e..fa95eeee0d 100644 --- a/packages/worker/src/api/controllers/global/license.ts +++ b/packages/worker/src/api/controllers/global/license.ts @@ -1,10 +1,10 @@ import { licensing, quotas } from "@budibase/pro" import { ActivateLicenseKeyRequest, - ActivateOfflineLicenseRequest, + ActivateOfflineLicenseTokenRequest, GetLicenseKeyResponse, GetOfflineIdentifierResponse, - GetOfflineLicenseResponse, + GetOfflineLicenseTokenResponse, UserCtx, } from "@budibase/types" @@ -33,13 +33,13 @@ export async function deleteLicenseKey(ctx: UserCtx) { // OFFLINE LICENSE -export async function activateOfflineLicense(ctx: UserCtx) { +export async function activateOfflineLicenseToken(ctx: UserCtx) { const { offlineLicenseToken } = ctx.request.body - await licensing.offline.activateOfflineLicense(offlineLicenseToken) + await licensing.offline.activateOfflineLicenseToken(offlineLicenseToken) ctx.status = 200 } -export async function getOfflineLicense(ctx: UserCtx) { +export async function getOfflineLicenseToken(ctx: UserCtx) { const offlineLicenseToken = await licensing.offline.getOfflineLicenseToken() if (offlineLicenseToken) { ctx.body = { offlineLicenseToken: "*" } @@ -49,7 +49,7 @@ export async function getOfflineLicense(ctx: UserCtx) { +export async function deleteOfflineLicenseToken(ctx: UserCtx) { await licensing.offline.deleteOfflineLicenseToken() ctx.status = 204 } diff --git a/packages/worker/src/api/routes/global/license.ts b/packages/worker/src/api/routes/global/license.ts index 1d3d9c460b..199dbb3846 100644 --- a/packages/worker/src/api/routes/global/license.ts +++ b/packages/worker/src/api/routes/global/license.ts @@ -21,9 +21,9 @@ router .get("/api/global/license/key", controller.getLicenseKey) .delete("/api/global/license/key", controller.deleteLicenseKey) // OFFLINE LICENSE - .post("/api/global/license/offline", activateOfflineLicenseValidator, controller.activateOfflineLicense) - .get("/api/global/license/offline", controller.getOfflineLicense) - .delete("/api/global/license/offline", controller.deleteOfflineLicense) + .post("/api/global/license/offline", activateOfflineLicenseValidator, controller.activateOfflineLicenseToken) + .get("/api/global/license/offline", controller.getOfflineLicenseToken) + .delete("/api/global/license/offline", controller.deleteOfflineLicenseToken) .get("/api/global/license/offline/identifier", controller.getOfflineLicenseIdentifier) export default router