mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
chore: cleanup legacy logic (#15072)
This commit is contained in:
@@ -43,8 +43,6 @@ export enum FeatureType {
|
||||
export enum Feature {
|
||||
// user
|
||||
Admin = 'administrator',
|
||||
EarlyAccess = 'early_access',
|
||||
AIEarlyAccess = 'ai_early_access',
|
||||
UnlimitedCopilot = 'unlimited_copilot',
|
||||
FreePlan = 'free_plan_v1',
|
||||
ProPlan = 'pro_plan_v1',
|
||||
@@ -58,10 +56,8 @@ export enum Feature {
|
||||
|
||||
// TODO(@forehalo): may merge `FeatureShapes` and `FeatureConfigs`?
|
||||
export const FeaturesShapes = {
|
||||
early_access: z.object({ whitelist: z.array(z.string()).readonly() }),
|
||||
unlimited_workspace: EMPTY_CONFIG,
|
||||
unlimited_copilot: EMPTY_CONFIG,
|
||||
ai_early_access: EMPTY_CONFIG,
|
||||
administrator: EMPTY_CONFIG,
|
||||
free_plan_v1: UserPlanQuotaConfig,
|
||||
pro_plan_v1: UserPlanQuotaConfig,
|
||||
@@ -72,8 +68,6 @@ export const FeaturesShapes = {
|
||||
|
||||
export type UserFeatureName = keyof Pick<
|
||||
typeof FeaturesShapes,
|
||||
| 'early_access'
|
||||
| 'ai_early_access'
|
||||
| 'unlimited_copilot'
|
||||
| 'administrator'
|
||||
| 'free_plan_v1'
|
||||
@@ -142,11 +136,6 @@ const TeamFeature = {
|
||||
},
|
||||
} as const;
|
||||
|
||||
const WhitelistFeature = {
|
||||
type: FeatureType.Feature,
|
||||
configs: { whitelist: [] },
|
||||
} as const;
|
||||
|
||||
const EmptyFeature = {
|
||||
type: FeatureType.Feature,
|
||||
configs: {},
|
||||
@@ -164,10 +153,8 @@ export const FeatureConfigs: {
|
||||
pro_plan_v1: ProFeature,
|
||||
lifetime_pro_plan_v1: LifetimeProFeature,
|
||||
team_plan_v1: TeamFeature,
|
||||
early_access: WhitelistFeature,
|
||||
unlimited_workspace: EmptyFeature,
|
||||
quota_exceeded_readonly_workspace_v1: EmptyFeature,
|
||||
unlimited_copilot: EmptyFeature,
|
||||
ai_early_access: EmptyFeature,
|
||||
administrator: EmptyFeature,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user