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