mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
fix: missing quota resolver (#7094)
This commit is contained in:
@@ -3,6 +3,7 @@ import { Module } from '@nestjs/common';
|
||||
import { FeatureModule } from '../features';
|
||||
import { StorageModule } from '../storage';
|
||||
import { PermissionService } from '../workspaces/permission';
|
||||
import { QuotaManagementResolver } from './resolver';
|
||||
import { QuotaService } from './service';
|
||||
import { QuotaManagementService } from './storage';
|
||||
|
||||
@@ -14,7 +15,12 @@ import { QuotaManagementService } from './storage';
|
||||
*/
|
||||
@Module({
|
||||
imports: [FeatureModule, StorageModule],
|
||||
providers: [PermissionService, QuotaService, QuotaManagementService],
|
||||
providers: [
|
||||
PermissionService,
|
||||
QuotaService,
|
||||
QuotaManagementResolver,
|
||||
QuotaManagementService,
|
||||
],
|
||||
exports: [QuotaService, QuotaManagementService],
|
||||
})
|
||||
export class QuotaModule {}
|
||||
|
||||
@@ -56,7 +56,7 @@ class UserQuotaType {
|
||||
}
|
||||
|
||||
@Resolver(() => UserType)
|
||||
export class FeatureManagementResolver {
|
||||
export class QuotaManagementResolver {
|
||||
constructor(private readonly quota: QuotaService) {}
|
||||
|
||||
@ResolveField(() => UserQuotaType, { name: 'quota', nullable: true })
|
||||
|
||||
@@ -470,6 +470,23 @@ type UserInvoice {
|
||||
|
||||
union UserOrLimitedUser = LimitedUserType | UserType
|
||||
|
||||
type UserQuota {
|
||||
blobLimit: SafeInt!
|
||||
historyPeriod: SafeInt!
|
||||
humanReadable: UserQuotaHumanReadable!
|
||||
memberLimit: Int!
|
||||
name: String!
|
||||
storageQuota: SafeInt!
|
||||
}
|
||||
|
||||
type UserQuotaHumanReadable {
|
||||
blobLimit: String!
|
||||
historyPeriod: String!
|
||||
memberLimit: String!
|
||||
name: String!
|
||||
storageQuota: String!
|
||||
}
|
||||
|
||||
type UserSubscription {
|
||||
canceledAt: DateTime
|
||||
createdAt: DateTime!
|
||||
@@ -517,6 +534,7 @@ type UserType {
|
||||
|
||||
"""User name"""
|
||||
name: String!
|
||||
quota: UserQuota
|
||||
subscription(plan: SubscriptionPlan = Pro): UserSubscription @deprecated(reason: "use `UserType.subscriptions`")
|
||||
subscriptions: [UserSubscription!]!
|
||||
token: tokenType! @deprecated(reason: "use [/api/auth/authorize]")
|
||||
|
||||
Reference in New Issue
Block a user