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
export interface ActivateOfflineLicenseRequest {
export interface ActivateOfflineLicenseTokenRequest {
offlineLicenseToken: string
}
export interface GetOfflineLicenseResponse {
export interface GetOfflineLicenseTokenResponse {
offlineLicenseToken: string
}

View File

@ -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<void, void>) {
// OFFLINE LICENSE
export async function activateOfflineLicense(ctx: UserCtx<ActivateOfflineLicenseRequest>) {
export async function activateOfflineLicenseToken(ctx: UserCtx<ActivateOfflineLicenseTokenRequest>) {
const { offlineLicenseToken } = ctx.request.body
await licensing.offline.activateOfflineLicense(offlineLicenseToken)
await licensing.offline.activateOfflineLicenseToken(offlineLicenseToken)
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()
if (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()
ctx.status = 204
}

View File

@ -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