Request / response renames

This commit is contained in:
Rory Powell 2023-07-10 16:12:19 +01:00
parent d0d5a55047
commit 7c4fe15781
3 changed files with 11 additions and 11 deletions

View File

@ -10,11 +10,11 @@ export interface GetLicenseKeyResponse {
// OFFLINE LICENSE // OFFLINE LICENSE
export interface ActivateOfflineLicenseRequest { export interface ActivateOfflineLicenseTokenRequest {
offlineLicenseToken: string offlineLicenseToken: string
} }
export interface GetOfflineLicenseResponse { export interface GetOfflineLicenseTokenResponse {
offlineLicenseToken: string offlineLicenseToken: string
} }

View File

@ -1,10 +1,10 @@
import { licensing, quotas } from "@budibase/pro" import { licensing, quotas } from "@budibase/pro"
import { import {
ActivateLicenseKeyRequest, ActivateLicenseKeyRequest,
ActivateOfflineLicenseRequest, ActivateOfflineLicenseTokenRequest,
GetLicenseKeyResponse, GetLicenseKeyResponse,
GetOfflineIdentifierResponse, GetOfflineIdentifierResponse,
GetOfflineLicenseResponse, GetOfflineLicenseTokenResponse,
UserCtx, UserCtx,
} from "@budibase/types" } from "@budibase/types"
@ -33,13 +33,13 @@ export async function deleteLicenseKey(ctx: UserCtx<void, void>) {
// OFFLINE LICENSE // OFFLINE LICENSE
export async function activateOfflineLicense(ctx: UserCtx<ActivateOfflineLicenseRequest>) { export async function activateOfflineLicenseToken(ctx: UserCtx<ActivateOfflineLicenseTokenRequest>) {
const { offlineLicenseToken } = ctx.request.body const { offlineLicenseToken } = ctx.request.body
await licensing.offline.activateOfflineLicense(offlineLicenseToken) await licensing.offline.activateOfflineLicenseToken(offlineLicenseToken)
ctx.status = 200 ctx.status = 200
} }
export async function getOfflineLicense(ctx: UserCtx<void, GetOfflineLicenseResponse>) { export async function getOfflineLicenseToken(ctx: UserCtx<void, GetOfflineLicenseTokenResponse>) {
const offlineLicenseToken = await licensing.offline.getOfflineLicenseToken() const offlineLicenseToken = await licensing.offline.getOfflineLicenseToken()
if (offlineLicenseToken) { if (offlineLicenseToken) {
ctx.body = { offlineLicenseToken: "*" } ctx.body = { offlineLicenseToken: "*" }
@ -49,7 +49,7 @@ export async function getOfflineLicense(ctx: UserCtx<void, GetOfflineLicenseResp
} }
} }
export async function deleteOfflineLicense(ctx: UserCtx<void, void>) { export async function deleteOfflineLicenseToken(ctx: UserCtx<void, void>) {
await licensing.offline.deleteOfflineLicenseToken() await licensing.offline.deleteOfflineLicenseToken()
ctx.status = 204 ctx.status = 204
} }

View File

@ -21,9 +21,9 @@ router
.get("/api/global/license/key", controller.getLicenseKey) .get("/api/global/license/key", controller.getLicenseKey)
.delete("/api/global/license/key", controller.deleteLicenseKey) .delete("/api/global/license/key", controller.deleteLicenseKey)
// OFFLINE LICENSE // OFFLINE LICENSE
.post("/api/global/license/offline", activateOfflineLicenseValidator, controller.activateOfflineLicense) .post("/api/global/license/offline", activateOfflineLicenseValidator, controller.activateOfflineLicenseToken)
.get("/api/global/license/offline", controller.getOfflineLicense) .get("/api/global/license/offline", controller.getOfflineLicenseToken)
.delete("/api/global/license/offline", controller.deleteOfflineLicense) .delete("/api/global/license/offline", controller.deleteOfflineLicenseToken)
.get("/api/global/license/offline/identifier", controller.getOfflineLicenseIdentifier) .get("/api/global/license/offline/identifier", controller.getOfflineLicenseIdentifier)
export default router export default router