mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat(nbstore): add cloud implementation (#8810)
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
mutation deleteBlob($workspaceId: String!, $hash: String!) {
|
||||
deleteBlob(workspaceId: $workspaceId, hash: $hash)
|
||||
mutation deleteBlob(
|
||||
$workspaceId: String!
|
||||
$key: String!
|
||||
$permanently: Boolean
|
||||
) {
|
||||
deleteBlob(workspaceId: $workspaceId, key: $key, permanently: $permanently)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
query listBlobs($workspaceId: String!) {
|
||||
listBlobs(workspaceId: $workspaceId)
|
||||
workspace(id: $workspaceId) {
|
||||
blobs {
|
||||
key
|
||||
size
|
||||
mime
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
mutation releaseDeletedBlobs($workspaceId: String!) {
|
||||
releaseDeletedBlobs(workspaceId: $workspaceId)
|
||||
}
|
||||
@@ -47,19 +47,37 @@ export const deleteBlobMutation = {
|
||||
definitionName: 'deleteBlob',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation deleteBlob($workspaceId: String!, $hash: String!) {
|
||||
deleteBlob(workspaceId: $workspaceId, hash: $hash)
|
||||
mutation deleteBlob($workspaceId: String!, $key: String!, $permanently: Boolean) {
|
||||
deleteBlob(workspaceId: $workspaceId, key: $key, permanently: $permanently)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const listBlobsQuery = {
|
||||
id: 'listBlobsQuery' as const,
|
||||
operationName: 'listBlobs',
|
||||
definitionName: 'listBlobs',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query listBlobs($workspaceId: String!) {
|
||||
listBlobs(workspaceId: $workspaceId)
|
||||
workspace(id: $workspaceId) {
|
||||
blobs {
|
||||
key
|
||||
size
|
||||
mime
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const releaseDeletedBlobsMutation = {
|
||||
id: 'releaseDeletedBlobsMutation' as const,
|
||||
operationName: 'releaseDeletedBlobs',
|
||||
definitionName: 'releaseDeletedBlobs',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation releaseDeletedBlobs($workspaceId: String!) {
|
||||
releaseDeletedBlobs(workspaceId: $workspaceId)
|
||||
}`,
|
||||
};
|
||||
|
||||
@@ -885,7 +903,7 @@ mutation publishPage($workspaceId: String!, $pageId: String!, $mode: PublicPageM
|
||||
export const quotaQuery = {
|
||||
id: 'quotaQuery' as const,
|
||||
operationName: 'quota',
|
||||
definitionName: 'currentUser,collectAllBlobSizes',
|
||||
definitionName: 'currentUser',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query quota {
|
||||
@@ -905,9 +923,9 @@ query quota {
|
||||
memberLimit
|
||||
}
|
||||
}
|
||||
}
|
||||
collectAllBlobSizes {
|
||||
size
|
||||
quotaUsage {
|
||||
storageQuota
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
@@ -15,8 +15,8 @@ query quota {
|
||||
memberLimit
|
||||
}
|
||||
}
|
||||
}
|
||||
collectAllBlobSizes {
|
||||
size
|
||||
quotaUsage {
|
||||
storageQuota
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,6 +517,14 @@ export interface ListUserInput {
|
||||
skip?: InputMaybe<Scalars['Int']['input']>;
|
||||
}
|
||||
|
||||
export interface ListedBlob {
|
||||
__typename?: 'ListedBlob';
|
||||
createdAt: Scalars['String']['output'];
|
||||
key: Scalars['String']['output'];
|
||||
mime: Scalars['String']['output'];
|
||||
size: Scalars['Int']['output'];
|
||||
}
|
||||
|
||||
export interface ManageUserInput {
|
||||
/** User email */
|
||||
email?: InputMaybe<Scalars['String']['input']>;
|
||||
@@ -569,6 +577,7 @@ export interface Mutation {
|
||||
leaveWorkspace: Scalars['Boolean']['output'];
|
||||
publishPage: WorkspacePage;
|
||||
recoverDoc: Scalars['DateTime']['output'];
|
||||
releaseDeletedBlobs: Scalars['Boolean']['output'];
|
||||
/** Remove user avatar */
|
||||
removeAvatar: RemoveAvatar;
|
||||
removeWorkspaceFeature: Scalars['Int']['output'];
|
||||
@@ -673,7 +682,9 @@ export interface MutationCreateWorkspaceArgs {
|
||||
}
|
||||
|
||||
export interface MutationDeleteBlobArgs {
|
||||
hash: Scalars['String']['input'];
|
||||
hash?: InputMaybe<Scalars['String']['input']>;
|
||||
key?: InputMaybe<Scalars['String']['input']>;
|
||||
permanently?: Scalars['Boolean']['input'];
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
@@ -731,6 +742,10 @@ export interface MutationRecoverDocArgs {
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationReleaseDeletedBlobsArgs {
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface MutationRemoveWorkspaceFeatureArgs {
|
||||
feature: FeatureType;
|
||||
workspaceId: Scalars['String']['input'];
|
||||
@@ -882,9 +897,7 @@ export enum PublicPageMode {
|
||||
|
||||
export interface Query {
|
||||
__typename?: 'Query';
|
||||
/** @deprecated no more needed */
|
||||
checkBlobSize: WorkspaceBlobSizes;
|
||||
/** @deprecated use `user.storageUsage` instead */
|
||||
/** @deprecated use `user.quotaUsage` instead */
|
||||
collectAllBlobSizes: WorkspaceBlobSizes;
|
||||
/** Get current user */
|
||||
currentUser: Maybe<UserType>;
|
||||
@@ -925,11 +938,6 @@ export interface Query {
|
||||
workspaces: Array<WorkspaceType>;
|
||||
}
|
||||
|
||||
export interface QueryCheckBlobSizeArgs {
|
||||
size: Scalars['SafeInt']['input'];
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}
|
||||
|
||||
export interface QueryErrorArgs {
|
||||
name: ErrorNames;
|
||||
}
|
||||
@@ -1225,6 +1233,11 @@ export interface UserQuotaHumanReadable {
|
||||
storageQuota: Scalars['String']['output'];
|
||||
}
|
||||
|
||||
export interface UserQuotaUsage {
|
||||
__typename?: 'UserQuotaUsage';
|
||||
storageQuota: Scalars['SafeInt']['output'];
|
||||
}
|
||||
|
||||
export interface UserType {
|
||||
__typename?: 'UserType';
|
||||
/** User avatar url */
|
||||
@@ -1250,6 +1263,7 @@ export interface UserType {
|
||||
/** User name */
|
||||
name: Scalars['String']['output'];
|
||||
quota: Maybe<UserQuota>;
|
||||
quotaUsage: UserQuotaUsage;
|
||||
subscriptions: Array<SubscriptionType>;
|
||||
/** @deprecated use [/api/auth/sign-in?native=true] instead */
|
||||
token: TokenType;
|
||||
@@ -1313,7 +1327,7 @@ export interface WorkspaceType {
|
||||
/** Available features of workspace */
|
||||
availableFeatures: Array<FeatureType>;
|
||||
/** List blobs of workspace */
|
||||
blobs: Array<Scalars['String']['output']>;
|
||||
blobs: Array<ListedBlob>;
|
||||
/** Blobs size of workspace */
|
||||
blobsSize: Scalars['Int']['output'];
|
||||
/** Workspace created date */
|
||||
@@ -1417,7 +1431,8 @@ export type AdminServerConfigQuery = {
|
||||
|
||||
export type DeleteBlobMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
hash: Scalars['String']['input'];
|
||||
key: Scalars['String']['input'];
|
||||
permanently?: InputMaybe<Scalars['Boolean']['input']>;
|
||||
}>;
|
||||
|
||||
export type DeleteBlobMutation = {
|
||||
@@ -1429,7 +1444,28 @@ export type ListBlobsQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type ListBlobsQuery = { __typename?: 'Query'; listBlobs: Array<string> };
|
||||
export type ListBlobsQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
blobs: Array<{
|
||||
__typename?: 'ListedBlob';
|
||||
key: string;
|
||||
size: number;
|
||||
mime: string;
|
||||
createdAt: string;
|
||||
}>;
|
||||
};
|
||||
};
|
||||
|
||||
export type ReleaseDeletedBlobsMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type ReleaseDeletedBlobsMutation = {
|
||||
__typename?: 'Mutation';
|
||||
releaseDeletedBlobs: boolean;
|
||||
};
|
||||
|
||||
export type SetBlobMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
@@ -2196,8 +2232,8 @@ export type QuotaQuery = {
|
||||
memberLimit: string;
|
||||
};
|
||||
} | null;
|
||||
quotaUsage: { __typename?: 'UserQuotaUsage'; storageQuota: number };
|
||||
} | null;
|
||||
collectAllBlobSizes: { __typename?: 'WorkspaceBlobSizes'; size: number };
|
||||
};
|
||||
|
||||
export type RecoverDocMutationVariables = Exact<{
|
||||
@@ -2953,6 +2989,11 @@ export type Mutations =
|
||||
variables: DeleteBlobMutationVariables;
|
||||
response: DeleteBlobMutation;
|
||||
}
|
||||
| {
|
||||
name: 'releaseDeletedBlobsMutation';
|
||||
variables: ReleaseDeletedBlobsMutationVariables;
|
||||
response: ReleaseDeletedBlobsMutation;
|
||||
}
|
||||
| {
|
||||
name: 'setBlobMutation';
|
||||
variables: SetBlobMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user