add workspace usage info

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2025-10-30 15:42:10 +07:00
parent 7f008ffa3e
commit 3f8497ee35
4 changed files with 40 additions and 2 deletions
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@hcengineering/account-client",
"comment": "add workspace usage info",
"type": "patch"
}
],
"packageName": "@hcengineering/account-client"
}
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@hcengineering/core",
"comment": "add workspace usae info",
"type": "patch"
}
],
"packageName": "@hcengineering/core"
}
+12 -1
View File
@@ -16,7 +16,7 @@ import {
type AccountInfo,
type AccountRole,
type AccountUuid,
BackupStatus,
type BackupStatus,
concatLink,
Data,
type Person,
@@ -25,6 +25,7 @@ import {
type PersonUuid,
type SocialIdType,
Version,
type UsageStatus,
type WorkspaceInfoWithStatus,
type WorkspaceMemberInfo,
WorkspaceMode,
@@ -182,6 +183,7 @@ export interface AccountClient {
) => Promise<boolean>
assignWorkspace: (email: string, workspaceUuid: string, role: AccountRole) => Promise<void>
updateBackupInfo: (info: BackupStatus) => Promise<void>
updateUsageInfo: (info: UsageStatus) => Promise<void>
updateWorkspaceRoleBySocialKey: (socialKey: string, targetRole: AccountRole) => Promise<void>
ensurePerson: (
socialType: SocialIdType,
@@ -846,6 +848,15 @@ class AccountClientImpl implements AccountClient {
await this.rpc(request)
}
async updateUsageInfo (usageInfo: UsageStatus): Promise<void> {
const request = {
method: 'updateUsageInfo' as const,
params: { usageInfo }
}
await this.rpc(request)
}
async assignWorkspace (email: string, workspaceUuid: string, role: AccountRole): Promise<void> {
const request = {
method: 'assignWorkspace' as const,
+8 -1
View File
@@ -1,6 +1,6 @@
//
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
// Copyright © 2021, 2025 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
@@ -873,6 +873,12 @@ export interface BackupStatus {
backups: number
}
export interface UsageStatus {
usage: Record<string, number>
startTime: Timestamp
updateTime: Timestamp
}
export interface WorkspaceInfoWithStatus extends WorkspaceInfo {
isDisabled?: boolean
versionMajor: number
@@ -882,6 +888,7 @@ export interface WorkspaceInfoWithStatus extends WorkspaceInfo {
mode: WorkspaceMode
processingProgress?: number
backupInfo?: BackupStatus
usageInfo?: UsageStatus
processingAttemps: number
}