mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
refactor(server): plugin modules (#5630)
- [x] separates modules into `fundamental`, `core`, `plugins`
- [x] optional modules with `@OptionalModule` decorator to install modules with requirements met(`requires`, `if`)
- [x] `module.contributesTo` defines optional features that will be enabled if module registered
- [x] `AFFiNE.plugins.use('payment', {})` to enable a optional/plugin module
- [x] `PaymentModule` is the first plugin module
- [x] GraphQLSchema will not be generated for non-included modules
- [x] Frontend can use `ServerConfigType` query to detect which features are enabled
- [x] override existing provider globally
This commit is contained in:
@@ -674,8 +674,10 @@ export const serverConfigQuery = {
|
||||
query serverConfig {
|
||||
serverConfig {
|
||||
version
|
||||
flavor
|
||||
baseUrl
|
||||
name
|
||||
features
|
||||
flavor
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
query serverConfig {
|
||||
serverConfig {
|
||||
version
|
||||
flavor
|
||||
baseUrl
|
||||
name
|
||||
features
|
||||
flavor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,10 @@ export enum PublicPageMode {
|
||||
Page = 'Page',
|
||||
}
|
||||
|
||||
export enum ServerFeature {
|
||||
Payment = 'Payment',
|
||||
}
|
||||
|
||||
export enum SubscriptionPlan {
|
||||
Enterprise = 'Enterprise',
|
||||
Free = 'Free',
|
||||
@@ -656,8 +660,10 @@ export type ServerConfigQuery = {
|
||||
serverConfig: {
|
||||
__typename?: 'ServerConfigType';
|
||||
version: string;
|
||||
flavor: string;
|
||||
baseUrl: string;
|
||||
name: string;
|
||||
features: Array<ServerFeature>;
|
||||
flavor: string;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user