mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 18:26:05 +08:00
feat(admin): init project (#7197)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"sideEffects": "false",
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/add": "^5.0.2",
|
||||
"@graphql-codegen/cli": "5.0.2",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# for the admin panel only, do not use it in the app
|
||||
query getCurrentUserFeatures {
|
||||
currentUser {
|
||||
id
|
||||
name
|
||||
email
|
||||
emailVerified
|
||||
avatarUrl
|
||||
features
|
||||
}
|
||||
}
|
||||
@@ -283,6 +283,24 @@ query getCopilotSessions($workspaceId: String!) {
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getCurrentUserFeaturesQuery = {
|
||||
id: 'getCurrentUserFeaturesQuery' as const,
|
||||
operationName: 'getCurrentUserFeatures',
|
||||
definitionName: 'currentUser',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query getCurrentUserFeatures {
|
||||
currentUser {
|
||||
id
|
||||
name
|
||||
email
|
||||
emailVerified
|
||||
avatarUrl
|
||||
features
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const getCurrentUserQuery = {
|
||||
id: 'getCurrentUserQuery' as const,
|
||||
operationName: 'getCurrentUser',
|
||||
@@ -597,6 +615,34 @@ mutation leaveWorkspace($workspaceId: String!, $workspaceName: String!, $sendLea
|
||||
}`,
|
||||
};
|
||||
|
||||
export const listUsersQuery = {
|
||||
id: 'listUsersQuery' as const,
|
||||
operationName: 'listUsers',
|
||||
definitionName: 'users',
|
||||
containsFile: false,
|
||||
query: `
|
||||
query listUsers($filter: ListUserInput!) {
|
||||
users(filter: $filter) {
|
||||
id
|
||||
name
|
||||
email
|
||||
features
|
||||
hasPassword
|
||||
emailVerified
|
||||
avatarUrl
|
||||
quota {
|
||||
humanReadable {
|
||||
blobLimit
|
||||
historyPeriod
|
||||
memberLimit
|
||||
name
|
||||
storageQuota
|
||||
}
|
||||
}
|
||||
}
|
||||
}`,
|
||||
};
|
||||
|
||||
export const pricesQuery = {
|
||||
id: 'pricesQuery' as const,
|
||||
operationName: 'prices',
|
||||
|
||||
20
packages/frontend/graphql/src/graphql/list-users.gql
Normal file
20
packages/frontend/graphql/src/graphql/list-users.gql
Normal file
@@ -0,0 +1,20 @@
|
||||
query listUsers($filter: ListUserInput!) {
|
||||
users(filter: $filter) {
|
||||
id
|
||||
name
|
||||
email
|
||||
features
|
||||
hasPassword
|
||||
emailVerified
|
||||
avatarUrl
|
||||
quota {
|
||||
humanReadable {
|
||||
blobLimit
|
||||
historyPeriod
|
||||
memberLimit
|
||||
name
|
||||
storageQuota
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1391,6 +1391,23 @@ export type GetCopilotSessionsQuery = {
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type GetCurrentUserFeaturesQueryVariables = Exact<{
|
||||
[key: string]: never;
|
||||
}>;
|
||||
|
||||
export type GetCurrentUserFeaturesQuery = {
|
||||
__typename?: 'Query';
|
||||
currentUser: {
|
||||
__typename?: 'UserType';
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
emailVerified: boolean;
|
||||
avatarUrl: string | null;
|
||||
features: Array<FeatureType>;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type GetCurrentUserQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type GetCurrentUserQuery = {
|
||||
@@ -1664,6 +1681,35 @@ export type LeaveWorkspaceMutation = {
|
||||
leaveWorkspace: boolean;
|
||||
};
|
||||
|
||||
export type ListUsersQueryVariables = Exact<{
|
||||
filter: ListUserInput;
|
||||
}>;
|
||||
|
||||
export type ListUsersQuery = {
|
||||
__typename?: 'Query';
|
||||
users: Array<{
|
||||
__typename?: 'UserType';
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
features: Array<FeatureType>;
|
||||
hasPassword: boolean | null;
|
||||
emailVerified: boolean;
|
||||
avatarUrl: string | null;
|
||||
quota: {
|
||||
__typename?: 'UserQuota';
|
||||
humanReadable: {
|
||||
__typename?: 'UserQuotaHumanReadable';
|
||||
blobLimit: string;
|
||||
historyPeriod: string;
|
||||
memberLimit: string;
|
||||
name: string;
|
||||
storageQuota: string;
|
||||
};
|
||||
} | null;
|
||||
}>;
|
||||
};
|
||||
|
||||
export type PricesQueryVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type PricesQuery = {
|
||||
@@ -2086,6 +2132,11 @@ export type Queries =
|
||||
variables: GetCopilotSessionsQueryVariables;
|
||||
response: GetCopilotSessionsQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getCurrentUserFeaturesQuery';
|
||||
variables: GetCurrentUserFeaturesQueryVariables;
|
||||
response: GetCurrentUserFeaturesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'getCurrentUserQuery';
|
||||
variables: GetCurrentUserQueryVariables;
|
||||
@@ -2176,6 +2227,11 @@ export type Queries =
|
||||
variables: InvoicesQueryVariables;
|
||||
response: InvoicesQuery;
|
||||
}
|
||||
| {
|
||||
name: 'listUsersQuery';
|
||||
variables: ListUsersQueryVariables;
|
||||
response: ListUsersQuery;
|
||||
}
|
||||
| {
|
||||
name: 'pricesQuery';
|
||||
variables: PricesQueryVariables;
|
||||
|
||||
Reference in New Issue
Block a user