feat: add user level blob quota (#4114)
This commit is contained in:
@@ -339,7 +339,6 @@ async function collectBlobSizes(
|
||||
const res = await request(app.getHttpServer())
|
||||
.post(gql)
|
||||
.auth(token, { type: 'bearer' })
|
||||
.set({ 'x-request-id': 'test', 'x-operation-name': 'test' })
|
||||
.send({
|
||||
query: `
|
||||
query {
|
||||
@@ -353,6 +352,26 @@ async function collectBlobSizes(
|
||||
return res.body.data.collectBlobSizes.size;
|
||||
}
|
||||
|
||||
async function collectAllBlobSizes(
|
||||
app: INestApplication,
|
||||
token: string
|
||||
): Promise<number> {
|
||||
const res = await request(app.getHttpServer())
|
||||
.post(gql)
|
||||
.auth(token, { type: 'bearer' })
|
||||
.send({
|
||||
query: `
|
||||
query {
|
||||
collectAllBlobSizes {
|
||||
size
|
||||
}
|
||||
}
|
||||
`,
|
||||
})
|
||||
.expect(200);
|
||||
return res.body.data.collectAllBlobSizes.size;
|
||||
}
|
||||
|
||||
async function setBlob(
|
||||
app: INestApplication,
|
||||
token: string,
|
||||
@@ -447,6 +466,7 @@ async function getInviteInfo(
|
||||
export {
|
||||
acceptInvite,
|
||||
acceptInviteById,
|
||||
collectAllBlobSizes,
|
||||
collectBlobSizes,
|
||||
createTestApp,
|
||||
createWorkspace,
|
||||
|
||||
Reference in New Issue
Block a user