feat: integrate user usage into apis (#5075)

This commit is contained in:
DarkSky
2023-12-14 09:50:36 +00:00
parent 63de73a815
commit ad23ead5e4
36 changed files with 984 additions and 282 deletions

View File

@@ -324,7 +324,7 @@ async function listBlobs(
return res.body.data.listBlobs;
}
async function collectBlobSizes(
async function getWorkspaceBlobsSize(
app: INestApplication,
token: string,
workspaceId: string
@@ -335,14 +335,14 @@ async function collectBlobSizes(
.send({
query: `
query {
collectBlobSizes(workspaceId: "${workspaceId}") {
size
workspace(id: "${workspaceId}") {
blobsSize
}
}
`,
})
.expect(200);
return res.body.data.collectBlobSizes.size;
return res.body.data.workspace.blobsSize;
}
async function collectAllBlobSizes(
@@ -566,13 +566,13 @@ export {
changeEmail,
checkBlobSize,
collectAllBlobSizes,
collectBlobSizes,
createWorkspace,
currentUser,
flushDB,
getInviteInfo,
getPublicWorkspace,
getWorkspace,
getWorkspaceBlobsSize,
inviteUser,
leaveWorkspace,
listBlobs,