mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 23:26:30 +08:00
dc7cd0487b
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added support for a new AES key for license management, improving license encryption and decryption processes. - **Bug Fixes** - Improved error messages and handling when activating expired or invalid licenses. - **Refactor** - Updated license decryption logic to use a fixed AES key instead of deriving one from the workspace ID. - Added validation for environment variable values to prevent invalid configurations. - **Tests** - Enhanced license-related tests to cover new key usage and updated error messages. - Updated environment variable validation tests with clearer error messages. - **Chores** - Updated environment variable handling for improved consistency. - Set production environment variable explicitly in build configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import serverNativeModule from '@affine/server-native';
|
|
|
|
export const mergeUpdatesInApplyWay = serverNativeModule.mergeUpdatesInApplyWay;
|
|
|
|
export const verifyChallengeResponse = async (
|
|
response: any,
|
|
bits: number,
|
|
resource: string
|
|
) => {
|
|
if (typeof response !== 'string' || !response || !resource) return false;
|
|
return serverNativeModule.verifyChallengeResponse(response, bits, resource);
|
|
};
|
|
|
|
export const mintChallengeResponse = async (resource: string, bits: number) => {
|
|
if (!resource) return null;
|
|
return serverNativeModule.mintChallengeResponse(resource, bits);
|
|
};
|
|
|
|
export const getMime = serverNativeModule.getMime;
|
|
export const parseDoc = serverNativeModule.parseDoc;
|
|
export const Tokenizer = serverNativeModule.Tokenizer;
|
|
export const fromModelName = serverNativeModule.fromModelName;
|
|
export const htmlSanitize = serverNativeModule.htmlSanitize;
|
|
export const AFFINE_PRO_PUBLIC_KEY = serverNativeModule.AFFINE_PRO_PUBLIC_KEY;
|
|
export const AFFINE_PRO_LICENSE_AES_KEY =
|
|
serverNativeModule.AFFINE_PRO_LICENSE_AES_KEY;
|