mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat: add workspace level feature apis (#5503)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
query getWorkspaceFeatures($workspaceId: String!) {
|
||||
workspace(id: $workspaceId) {
|
||||
features
|
||||
}
|
||||
}
|
||||
@@ -383,6 +383,19 @@ 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',
|
||||
@@ -760,6 +773,48 @@ mutation uploadAvatar($avatar: Upload!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const addWorkspaceFeatureMutation = {
|
||||
id: 'addWorkspaceFeatureMutation' as const,
|
||||
operationName: 'addWorkspaceFeature',
|
||||
definitionName: 'addWorkspaceFeature',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation addWorkspaceFeature($workspaceId: String!, $feature: FeatureType!) {
|
||||
addWorkspaceFeature(workspaceId: $workspaceId, feature: $feature)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const listWorkspaceFeaturesQuery = {
|
||||
id: 'listWorkspaceFeaturesQuery' as const,
|
||||
operationName: 'listWorkspaceFeatures',
|
||||
definitionName: 'listWorkspaceFeatures',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query listWorkspaceFeatures($feature: FeatureType!) {
|
||||
listWorkspaceFeatures(feature: $feature) {
|
||||
id
|
||||
public
|
||||
createdAt
|
||||
memberCount
|
||||
owner {
|
||||
id
|
||||
}
|
||||
features
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const removeWorkspaceFeatureMutation = {
|
||||
id: 'removeWorkspaceFeatureMutation' as const,
|
||||
operationName: 'removeWorkspaceFeature',
|
||||
definitionName: 'removeWorkspaceFeature',
|
||||
containsFile: false,
|
||||
query: `
|
||||
mutation removeWorkspaceFeature($workspaceId: String!, $feature: FeatureType!) {
|
||||
removeWorkspaceFeature(workspaceId: $workspaceId, feature: $feature)
|
||||
}`,
|
||||
};
|
||||
|
||||
export const inviteByEmailMutation = {
|
||||
id: 'inviteByEmailMutation' as const,
|
||||
operationName: 'inviteByEmail',
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
mutation addWorkspaceFeature($workspaceId: String!, $feature: FeatureType!) {
|
||||
addWorkspaceFeature(workspaceId: $workspaceId, feature: $feature)
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
query listWorkspaceFeatures($feature: FeatureType!) {
|
||||
listWorkspaceFeatures(feature: $feature) {
|
||||
id
|
||||
public
|
||||
createdAt
|
||||
memberCount
|
||||
owner {
|
||||
id
|
||||
}
|
||||
features
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
mutation removeWorkspaceFeature($workspaceId: String!, $feature: FeatureType!) {
|
||||
removeWorkspaceFeature(workspaceId: $workspaceId, feature: $feature)
|
||||
}
|
||||
@@ -32,6 +32,12 @@ export interface Scalars {
|
||||
Upload: { input: File; output: File };
|
||||
}
|
||||
|
||||
/** The type of workspace feature */
|
||||
export enum FeatureType {
|
||||
Copilot = 'Copilot',
|
||||
EarlyAccess = 'EarlyAccess',
|
||||
}
|
||||
|
||||
export enum InvoiceStatus {
|
||||
Draft = 'Draft',
|
||||
Open = 'Open',
|
||||
@@ -392,6 +398,15 @@ 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'];
|
||||
}>;
|
||||
@@ -724,6 +739,43 @@ export type UploadAvatarMutation = {
|
||||
};
|
||||
};
|
||||
|
||||
export type AddWorkspaceFeatureMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
feature: FeatureType;
|
||||
}>;
|
||||
|
||||
export type AddWorkspaceFeatureMutation = {
|
||||
__typename?: 'Mutation';
|
||||
addWorkspaceFeature: number;
|
||||
};
|
||||
|
||||
export type ListWorkspaceFeaturesQueryVariables = Exact<{
|
||||
feature: FeatureType;
|
||||
}>;
|
||||
|
||||
export type ListWorkspaceFeaturesQuery = {
|
||||
__typename?: 'Query';
|
||||
listWorkspaceFeatures: Array<{
|
||||
__typename?: 'WorkspaceType';
|
||||
id: string;
|
||||
public: boolean;
|
||||
createdAt: string;
|
||||
memberCount: number;
|
||||
features: Array<FeatureType>;
|
||||
owner: { __typename?: 'UserType'; id: string };
|
||||
}>;
|
||||
};
|
||||
|
||||
export type RemoveWorkspaceFeatureMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
feature: FeatureType;
|
||||
}>;
|
||||
|
||||
export type RemoveWorkspaceFeatureMutation = {
|
||||
__typename?: 'Mutation';
|
||||
removeWorkspaceFeature: number;
|
||||
};
|
||||
|
||||
export type InviteByEmailMutationVariables = Exact<{
|
||||
workspaceId: Scalars['String']['input'];
|
||||
email: Scalars['String']['input'];
|
||||
@@ -815,6 +867,11 @@ export type Queries =
|
||||
variables: GetWorkspacePublicPagesQueryVariables;
|
||||
response: GetWorkspacePublicPagesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceFeaturesQuery';
|
||||
variables: GetWorkspaceFeaturesQueryVariables;
|
||||
response: GetWorkspaceFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getWorkspaceQuery';
|
||||
variables: GetWorkspaceQueryVariables;
|
||||
@@ -859,6 +916,11 @@ export type Queries =
|
||||
name: 'subscriptionQuery';
|
||||
variables: SubscriptionQueryVariables;
|
||||
response: SubscriptionQuery;
|
||||
}
|
||||
| {
|
||||
name: 'listWorkspaceFeaturesQuery';
|
||||
variables: ListWorkspaceFeaturesQueryVariables;
|
||||
response: ListWorkspaceFeaturesQuery;
|
||||
};
|
||||
|
||||
export type Mutations =
|
||||
@@ -1002,6 +1064,16 @@ export type Mutations =
|
||||
variables: UploadAvatarMutationVariables;
|
||||
response: UploadAvatarMutation;
|
||||
}
|
||||
| {
|
||||
name: 'addWorkspaceFeatureMutation';
|
||||
variables: AddWorkspaceFeatureMutationVariables;
|
||||
response: AddWorkspaceFeatureMutation;
|
||||
}
|
||||
| {
|
||||
name: 'removeWorkspaceFeatureMutation';
|
||||
variables: RemoveWorkspaceFeatureMutationVariables;
|
||||
response: RemoveWorkspaceFeatureMutation;
|
||||
}
|
||||
| {
|
||||
name: 'inviteByEmailMutation';
|
||||
variables: InviteByEmailMutationVariables;
|
||||
|
||||
Reference in New Issue
Block a user