mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
feat: new free plan (#5604)
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
SessionService,
|
||||
} from '../../fundamentals';
|
||||
import { FeatureType } from '../features';
|
||||
import { Quota_FreePlanV1 } from '../quota';
|
||||
import { Quota_FreePlanV1_1 } from '../quota';
|
||||
import {
|
||||
decode,
|
||||
encode,
|
||||
@@ -52,7 +52,7 @@ export const NextAuthOptionsProvider: FactoryProvider<NextAuthOptions> = {
|
||||
activated: true,
|
||||
feature: {
|
||||
connect: {
|
||||
feature_version: Quota_FreePlanV1,
|
||||
feature_version: Quota_FreePlanV1_1,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
PrismaService,
|
||||
verifyChallengeResponse,
|
||||
} from '../../fundamentals';
|
||||
import { Quota_FreePlanV1 } from '../quota';
|
||||
import { Quota_FreePlanV1_1 } from '../quota';
|
||||
|
||||
export type UserClaim = Pick<
|
||||
User,
|
||||
@@ -201,7 +201,7 @@ export class AuthService {
|
||||
activated: true,
|
||||
feature: {
|
||||
connect: {
|
||||
feature_version: Quota_FreePlanV1,
|
||||
feature_version: Quota_FreePlanV1_1,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -231,7 +231,7 @@ export class AuthService {
|
||||
activated: true,
|
||||
feature: {
|
||||
connect: {
|
||||
feature_version: Quota_FreePlanV1,
|
||||
feature_version: Quota_FreePlanV1_1,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -20,5 +20,5 @@ import { QuotaManagementService } from './storage';
|
||||
export class QuotaModule {}
|
||||
|
||||
export { QuotaManagementService, QuotaService };
|
||||
export { Quota_FreePlanV1, Quota_ProPlanV1, Quotas } from './schema';
|
||||
export { Quota_FreePlanV1_1, Quota_ProPlanV1, Quotas } from './schema';
|
||||
export { QuotaQueryType, QuotaType } from './types';
|
||||
|
||||
@@ -44,6 +44,10 @@ export class QuotaConfig {
|
||||
}
|
||||
}
|
||||
|
||||
get version() {
|
||||
return this.config.version;
|
||||
}
|
||||
|
||||
/// feature name of quota
|
||||
get name() {
|
||||
return this.config.feature;
|
||||
|
||||
@@ -54,11 +54,28 @@ export const Quotas: Quota[] = [
|
||||
memberLimit: 10,
|
||||
},
|
||||
},
|
||||
{
|
||||
feature: QuotaType.FreePlanV1,
|
||||
type: FeatureKind.Quota,
|
||||
version: 2,
|
||||
configs: {
|
||||
// quota name
|
||||
name: 'Free',
|
||||
// single blob limit 10MB
|
||||
blobLimit: 100 * OneMB,
|
||||
// total blob limit 10GB
|
||||
storageQuota: 10 * OneGB,
|
||||
// history period of validity 7 days
|
||||
historyPeriod: 7 * OneDay,
|
||||
// member limit 3
|
||||
memberLimit: 3,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const Quota_FreePlanV1 = {
|
||||
feature: Quotas[0].feature,
|
||||
version: Quotas[0].version,
|
||||
export const Quota_FreePlanV1_1 = {
|
||||
feature: Quotas[3].feature,
|
||||
version: Quotas[3].version,
|
||||
};
|
||||
|
||||
export const Quota_ProPlanV1 = {
|
||||
|
||||
Reference in New Issue
Block a user