feat(server): user feature model (#9843)

close CLOUD-108
This commit is contained in:
forehalo
2025-01-22 10:38:04 +00:00
parent 994d758c07
commit f8a515e89a
7 changed files with 580 additions and 39 deletions
@@ -55,3 +55,24 @@ export const Features = {
restricted_plan_v1: quota(UserPlanQuotaConfig),
team_plan_v1: quota(WorkspaceQuotaConfig),
};
export type UserFeatureName = keyof Pick<
typeof Features,
| 'early_access'
| 'ai_early_access'
| 'unlimited_copilot'
| 'administrator'
| 'free_plan_v1'
| 'pro_plan_v1'
| 'lifetime_pro_plan_v1'
| 'restricted_plan_v1'
>;
export type WorkspaceFeatureName = keyof Pick<
typeof Features,
'unlimited_workspace' | 'team_plan_v1'
>;
export type FeatureName = UserFeatureName | WorkspaceFeatureName;
export type FeatureConfigs<T extends FeatureName> = z.infer<
(typeof Features)[T]['shape']['configs']
>;