feat(nbstore): add cloud implementation (#8810)

This commit is contained in:
forehalo
2024-12-10 10:48:27 +00:00
parent 1721875ab6
commit 2f80b4f822
32 changed files with 1030 additions and 315 deletions

View File

@@ -449,6 +449,13 @@ input ListUserInput {
skip: Int = 0
}
type ListedBlob {
createdAt: String!
key: String!
mime: String!
size: Int!
}
input ManageUserInput {
"""User email"""
email: String
@@ -496,7 +503,7 @@ type Mutation {
"""Create a new workspace"""
createWorkspace(init: Upload): WorkspaceType!
deleteAccount: DeleteAccount!
deleteBlob(hash: String!, workspaceId: String!): Boolean!
deleteBlob(hash: String @deprecated(reason: "use parameter [key]"), key: String, permanently: Boolean! = false, workspaceId: String!): Boolean!
"""Delete a user account"""
deleteUser(id: String!): DeleteAccount!
@@ -511,6 +518,7 @@ type Mutation {
leaveWorkspace(sendLeaveMail: Boolean, workspaceId: String!, workspaceName: String!): Boolean!
publishPage(mode: PublicPageMode = Page, pageId: String!, workspaceId: String!): WorkspacePage!
recoverDoc(guid: String!, timestamp: DateTime!, workspaceId: String!): DateTime!
releaseDeletedBlobs(workspaceId: String!): Boolean!
"""Remove user avatar"""
removeAvatar: RemoveAvatar!
@@ -584,8 +592,7 @@ enum PublicPageMode {
}
type Query {
checkBlobSize(size: SafeInt!, workspaceId: String!): WorkspaceBlobSizes! @deprecated(reason: "no more needed")
collectAllBlobSizes: WorkspaceBlobSizes! @deprecated(reason: "use `user.storageUsage` instead")
collectAllBlobSizes: WorkspaceBlobSizes! @deprecated(reason: "use `user.quotaUsage` instead")
"""Get current user"""
currentUser: UserType
@@ -885,6 +892,10 @@ type UserQuotaHumanReadable {
storageQuota: String!
}
type UserQuotaUsage {
storageQuota: SafeInt!
}
type UserType {
"""User avatar url"""
avatarUrl: String
@@ -913,6 +924,7 @@ type UserType {
"""User name"""
name: String!
quota: UserQuota
quotaUsage: UserQuotaUsage!
subscriptions: [SubscriptionType!]!
token: tokenType! @deprecated(reason: "use [/api/auth/sign-in?native=true] instead")
}
@@ -962,7 +974,7 @@ type WorkspaceType {
availableFeatures: [FeatureType!]!
"""List blobs of workspace"""
blobs: [String!]!
blobs: [ListedBlob!]!
"""Blobs size of workspace"""
blobsSize: Int!