mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
refactor(server): config system (#11081)
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import './config';
|
||||
|
||||
import { ServerFeature } from '../../core/config';
|
||||
import { Module } from '@nestjs/common';
|
||||
|
||||
import { ServerConfigModule } from '../../core';
|
||||
import { FeatureModule } from '../../core/features';
|
||||
import { MailModule } from '../../core/mail';
|
||||
import { PermissionModule } from '../../core/permission';
|
||||
import { QuotaModule } from '../../core/quota';
|
||||
import { UserModule } from '../../core/user';
|
||||
import { WorkspaceModule } from '../../core/workspaces';
|
||||
import { Plugin } from '../registry';
|
||||
import { StripeWebhookController } from './controller';
|
||||
import { SubscriptionCronJobs } from './cron';
|
||||
import { LicenseController } from './license/controller';
|
||||
@@ -23,11 +24,10 @@ import {
|
||||
WorkspaceSubscriptionResolver,
|
||||
} from './resolver';
|
||||
import { SubscriptionService } from './service';
|
||||
import { StripeProvider } from './stripe';
|
||||
import { StripeFactory, StripeProvider } from './stripe';
|
||||
import { StripeWebhook } from './webhook';
|
||||
|
||||
@Plugin({
|
||||
name: 'payment',
|
||||
@Module({
|
||||
imports: [
|
||||
FeatureModule,
|
||||
QuotaModule,
|
||||
@@ -35,8 +35,10 @@ import { StripeWebhook } from './webhook';
|
||||
PermissionModule,
|
||||
WorkspaceModule,
|
||||
MailModule,
|
||||
ServerConfigModule,
|
||||
],
|
||||
providers: [
|
||||
StripeFactory,
|
||||
StripeProvider,
|
||||
SubscriptionService,
|
||||
SubscriptionResolver,
|
||||
@@ -50,11 +52,5 @@ import { StripeWebhook } from './webhook';
|
||||
QuotaOverride,
|
||||
],
|
||||
controllers: [StripeWebhookController, LicenseController],
|
||||
requires: [
|
||||
'plugins.payment.stripe.keys.APIKey',
|
||||
'plugins.payment.stripe.keys.webhookKey',
|
||||
],
|
||||
contributesTo: ServerFeature.Payment,
|
||||
if: config => config.flavor.graphql,
|
||||
})
|
||||
export class PaymentModule {}
|
||||
|
||||
Reference in New Issue
Block a user