Fix frontend type imports

This commit is contained in:
Owen
2025-10-14 11:28:56 -07:00
parent a8d00a47cd
commit c0039190bd
15 changed files with 50 additions and 93 deletions

View File

@@ -560,39 +560,6 @@ function allowed(res: Response, userData?: BasicUserData) {
return response<VerifyUserResponse>(res, data);
}
async function createAccessTokenSession(
res: Response,
resource: Resource,
tokenItem: ResourceAccessToken
) {
const token = generateSessionToken();
const sess = await createResourceSession({
resourceId: resource.resourceId,
token,
accessTokenId: tokenItem.accessTokenId,
sessionLength: tokenItem.sessionLength,
expiresAt: tokenItem.expiresAt,
doNotExtend: tokenItem.expiresAt ? true : false
});
const cookieName = `${config.getRawConfig().server.session_cookie_name}`;
const cookie = serializeResourceSessionCookie(
cookieName,
resource.fullDomain!,
token,
!resource.ssl,
new Date(sess.expiresAt)
);
res.appendHeader("Set-Cookie", cookie);
logger.debug("Access token is valid, creating new session");
return response<VerifyUserResponse>(res, {
data: { valid: true },
success: true,
error: false,
message: "Access allowed",
status: HttpCode.OK
});
}
async function isUserAllowedToAccessResource(
userSessionId: string,
resource: Resource

View File

@@ -0,0 +1,30 @@
export type GeneratedLicenseKey = {
instanceName: string | null;
licenseKey: string;
expiresAt: string;
isValid: boolean;
createdAt: string;
tier: string;
type: string;
};
export type ListGeneratedLicenseKeysResponse = GeneratedLicenseKey[];
export type NewLicenseKey = {
licenseKey: {
id: number;
instanceName: string | null;
instanceId: string;
licenseKey: string;
tier: string;
type: string;
quantity: number;
isValid: boolean;
updatedAt: string;
createdAt: string;
expiresAt: string;
orgId: string;
};
};
export type GenerateNewLicenseResponse = NewLicenseKey;

View File

@@ -0,0 +1,11 @@
import { LicenseStatus, LicenseKeyCache } from "@server/license/license";
export type ActivateLicenseStatus = LicenseStatus;
export type DeleteLicenseKeyResponse = LicenseStatus;
export type GetLicenseStatusResponse = LicenseStatus;
export type ListLicenseKeysResponse = LicenseKeyCache[];
export type RecheckStatusResponse = LicenseStatus;