mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-07 01:09:54 +08:00
feat: add workspace experimental features api (#5525)
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
query getUser($email: String!) {
|
||||
user(email: $email) {
|
||||
id
|
||||
name
|
||||
avatarUrl
|
||||
email
|
||||
hasPassword
|
||||
__typename
|
||||
... on UserType {
|
||||
id
|
||||
name
|
||||
avatarUrl
|
||||
email
|
||||
hasPassword
|
||||
}
|
||||
... on LimitedUserType {
|
||||
email
|
||||
hasPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,11 +345,31 @@ export const getUserQuery = {
|
||||
query: `
|
||||
query getUser($email: String!) {
|
||||
user(email: $email) {
|
||||
id
|
||||
name
|
||||
avatarUrl
|
||||
email
|
||||
hasPassword
|
||||
__typename
|
||||
... on UserType {
|
||||
id
|
||||
name
|
||||
avatarUrl
|
||||
email
|
||||
hasPassword
|
||||
}
|
||||
... on LimitedUserType {
|
||||
email
|
||||
hasPassword
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceFeaturesQuery = {
|
||||
id: 'getWorkspaceFeaturesQuery' as const,
|
||||
operationName: 'getWorkspaceFeatures',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspaceFeatures($workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
features
|
||||
}
|
||||
}`,
|
||||
};
|
||||
@@ -383,19 +403,6 @@ query getWorkspacePublicPages($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceFeaturesQuery = {
|
||||
id: 'getWorkspaceFeaturesQuery' as const,
|
||||
operationName: 'getWorkspaceFeatures',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getWorkspaceFeatures($workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
features
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getWorkspaceQuery = {
|
||||
id: 'getWorkspaceQuery' as const,
|
||||
operationName: 'getWorkspace',
|
||||
@@ -773,6 +780,34 @@ mutation uploadAvatar($avatar: Upload!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const availableFeaturesQuery = {
|
||||
id: 'availableFeaturesQuery' as const,
|
||||
operationName: 'availableFeatures',
|
||||
definitionName: 'workspace',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query availableFeatures($id: String!) {
|
||||
workspace(id: $id) {
|
||||
availableFeatures
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const setWorkspaceExperimentalFeatureMutation = {
|
||||
id: 'setWorkspaceExperimentalFeatureMutation' as const,
|
||||
operationName: 'setWorkspaceExperimentalFeature',
|
||||
definitionName: 'setWorkspaceExperimentalFeature',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation setWorkspaceExperimentalFeature($workspaceId: String!, $feature: FeatureType!, $enable: Boolean!) {
|
||||
setWorkspaceExperimentalFeature(
|
||||
workspaceId: $workspaceId
|
||||
feature: $feature
|
||||
enable: $enable
|
||||
)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const addWorkspaceFeatureMutation = {
|
||||
id: 'addWorkspaceFeatureMutation' as const,
|
||||
operationName: 'addWorkspaceFeature',
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
query availableFeatures($id: String!) {
|
||||
workspace(id: $id) {
|
||||
availableFeatures
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
mutation setWorkspaceExperimentalFeature(
|
||||
$workspaceId: String!
|
||||
$feature: FeatureType!
|
||||
$enable: Boolean!
|
||||
) {
|
||||
setWorkspaceExperimentalFeature(
|
||||
workspaceId: $workspaceId
|
||||
feature: $feature
|
||||
enable: $enable
|
||||
)
|
||||
}
|
||||
@@ -363,14 +363,30 @@ export type GetUserQueryVariables = Exact<{
|
||||
|
||||
export type GetUserQuery = {
|
||||
__typename?: 'Query';
|
||||
user: {
|
||||
__typename?: 'UserType';
|
||||
id: string;
|
||||
name: string;
|
||||
avatarUrl: string | null;
|
||||
email: string;
|
||||
hasPassword: boolean | null;
|
||||
} | null;
|
||||
user:
|
||||
| {
|
||||
__typename: 'LimitedUserType';
|
||||
email: string;
|
||||
hasPassword: boolean | null;
|
||||
}
|
||||
| {
|
||||
__typename: 'UserType';
|
||||
id: string;
|
||||
name: string;
|
||||
avatarUrl: string | null;
|
||||
email: string;
|
||||
hasPassword: boolean | null;
|
||||
}
|
||||
| null;
|
||||
};
|
||||
|
||||
export type GetWorkspaceFeaturesQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspaceFeaturesQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: { __typename?: 'WorkspaceType'; features: Array<FeatureType> };
|
||||
};
|
||||
|
||||
export type GetWorkspacePublicByIdQueryVariables = Exact<{
|
||||
@@ -398,15 +414,6 @@ export type GetWorkspacePublicPagesQuery = {
|
||||
};
|
||||
};
|
||||
|
||||
export type GetWorkspaceFeaturesQueryVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type GetWorkspaceFeaturesQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: { __typename?: 'WorkspaceType'; features: Array<FeatureType> };
|
||||
};
|
||||
|
||||
export type GetWorkspaceQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
@@ -739,6 +746,29 @@ export type UploadAvatarMutation = {
|
||||
};
|
||||
};
|
||||
|
||||
export type AvailableFeaturesQueryVariables = Exact<{
|
||||
id: Scalars['String']['input'];
|
||||
}>;
|
||||
|
||||
export type AvailableFeaturesQuery = {
|
||||
__typename?: 'Query';
|
||||
workspace: {
|
||||
__typename?: 'WorkspaceType';
|
||||
availableFeatures: Array<FeatureType>;
|
||||
};
|
||||
};
|
||||
|
||||
export type SetWorkspaceExperimentalFeatureMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
feature: FeatureType;
|
||||
enable: Scalars['Boolean']['input'];
|
||||
}>;
|
||||
|
||||
export type SetWorkspaceExperimentalFeatureMutation = {
|
||||
__typename?: 'Mutation';
|
||||
setWorkspaceExperimentalFeature: boolean;
|
||||
};
|
||||
|
||||
export type AddWorkspaceFeatureMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
feature: FeatureType;
|
||||
@@ -857,6 +887,11 @@ export type Queries =
|
||||
variables: GetUserQueryVariables;
|
||||
response: GetUserQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceFeaturesQuery';
|
||||
variables: GetWorkspaceFeaturesQueryVariables;
|
||||
response: GetWorkspaceFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspacePublicByIdQuery';
|
||||
variables: GetWorkspacePublicByIdQueryVariables;
|
||||
@@ -867,11 +902,6 @@ export type Queries =
|
||||
variables: GetWorkspacePublicPagesQueryVariables;
|
||||
response: GetWorkspacePublicPagesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceFeaturesQuery';
|
||||
variables: GetWorkspaceFeaturesQueryVariables;
|
||||
response: GetWorkspaceFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceQuery';
|
||||
variables: GetWorkspaceQueryVariables;
|
||||
@@ -917,6 +947,11 @@ export type Queries =
|
||||
variables: SubscriptionQueryVariables;
|
||||
response: SubscriptionQuery;
|
||||
}
|
||||
| {
|
||||
name: 'availableFeaturesQuery';
|
||||
variables: AvailableFeaturesQueryVariables;
|
||||
response: AvailableFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'listWorkspaceFeaturesQuery';
|
||||
variables: ListWorkspaceFeaturesQueryVariables;
|
||||
@@ -1064,6 +1099,11 @@ export type Mutations =
|
||||
variables: UploadAvatarMutationVariables;
|
||||
response: UploadAvatarMutation;
|
||||
}
|
||||
| {
|
||||
name: 'setWorkspaceExperimentalFeatureMutation';
|
||||
variables: SetWorkspaceExperimentalFeatureMutationVariables;
|
||||
response: SetWorkspaceExperimentalFeatureMutation;
|
||||
}
|
||||
| {
|
||||
name: 'addWorkspaceFeatureMutation';
|
||||
variables: AddWorkspaceFeatureMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user