There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
refactor(server): e2e utilities (#11000)
forehalof889886b31ed
diff --git a/.prettierignore b/.prettierignoreindex b0e1d1209e..99e291466b 100644--- a/.prettierignore+++ b/.prettierignore@@ -24,13 +24,13 @@ test-results**/*.gen.ts**/*.gql**/*.d.ts-packages/frontend/graphql/src/graphql/index.ts# per filestools/cli/src/webpack/error-handler.jspackages/backend/native/index.d.tspackages/backend/server/src/__tests__/__snapshots__packages/common/native/fixtures/**+packages/common/graphql/src/graphql/index.tspackages/frontend/native/index.d.tspackages/frontend/native/index.jspackages/frontend/apps/android/App/app/build/**diff --git a/oxlint.json b/oxlint.jsonindex cdee1d161b..f55ff3a5dc 100644--- a/oxlint.json+++ b/oxlint.json@@ -27,11 +27,11 @@"**/*.gen.ts","**/*.gql","**/*.d.ts",- "packages/frontend/graphql/src/graphql/index.ts","tools/cli/src/webpack/error-handler.js","packages/backend/native/index.d.ts","packages/backend/server/src/__tests__/__snapshots__","packages/common/native/fixtures/**",+ "packages/common/graphql/src/graphql/index.ts","packages/frontend/native/index.d.ts","packages/frontend/native/index.js","packages/frontend/apps/android/App/app/build/**",diff --git a/packages/backend/server/package.json b/packages/backend/server/package.jsonindex aa1ad3e183..d91a7fe887 100644--- a/packages/backend/server/package.json+++ b/packages/backend/server/package.json@@ -114,6 +114,7 @@"devDependencies": {"@affine-tools/cli": "workspace:*","@affine-tools/utils": "workspace:*",+ "@affine/graphql": "workspace:*","@affine/server-native": "workspace:*","@faker-js/faker": "^9.6.0","@nestjs/testing": "patch:@nestjs/testing@npm%3A10.4.15#~/.yarn/patches/@nestjs-testing-npm-10.4.15-d591a1705a.patch",diff --git a/packages/backend/server/src/__tests__/e2e/app.spec.ts b/packages/backend/server/src/__tests__/e2e/app.spec.tsindex 7c808c0b6f..6df243f1cc 100644--- a/packages/backend/server/src/__tests__/e2e/app.spec.ts+++ b/packages/backend/server/src/__tests__/e2e/app.spec.ts@@ -1,5 +1,18 @@+import { getCurrentUserQuery } from '@affine/graphql';+import { app, e2e } from './test';e2e('should create test app correctly', async t => {t.truthy(app);});++e2e('should handle http request', async t => {+ const res = await app.GET('/info');+ t.is(res.status, 200);+ t.is(res.body.compatibility, AFFiNE.version);+});++e2e('should handle gql request', async t => {+ const user = await app.gql({ query: getCurrentUserQuery });+ t.is(user.currentUser, null);+});diff --git a/packages/backend/server/src/__tests__/e2e/create-app.ts b/packages/backend/server/src/__tests__/e2e/create-app.tsindex b92ed3f43c..d1a0b39757 100644--- a/packages/backend/server/src/__tests__/e2e/create-app.ts+++ b/packages/backend/server/src/__tests__/e2e/create-app.ts@@ -1,8 +1,13 @@+import assert from 'node:assert';++import { gqlFetcherFactory } from '@affine/graphql';import { INestApplication } from '@nestjs/common';import { NestApplication } from '@nestjs/core';import { Test, TestingModuleBuilder } from '@nestjs/testing';+import { PrismaClient } from '@prisma/client';import cookieParser from 'cookie-parser';import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.mjs';+import supertest from 'supertest';import {AFFiNELogger,@@ -12,10 +17,16 @@ import {OneMB,} from '../../base';import { SocketIoAdapter } from '../../base/websocket';-import { AuthGuard } from '../../core/auth';+import { AuthGuard, AuthService } from '../../core/auth';import { Mailer } from '../../core/mail';-import { MockMailer } from '../mocks';-import { TEST_LOG_LEVEL } from '../utils';+import {+ createFactory,+ MockedUser,+ MockMailer,+ MockUser,+ MockUserInput,+} from '../mocks';+import { parseCookies, TEST_LOG_LEVEL } from '../utils';interface TestingAppMetadata {tapModule?(m: TestingModuleBuilder): void;@@ -23,18 +34,158 @@ interface TestingAppMetadata {}export class TestingApp extends NestApplication {- get mails() {- return this.get(Mailer, { strict: false }) as MockMailer;+ private sessionCookie: string | null = null;+ private currentUserCookie: string | null = null;+ private readonly userCookies: Set<string> = new Set();++ create = createFactory(this.get(PrismaClient, { strict: false }));+ mails = this.get(Mailer, { strict: false }) as MockMailer;++ get url() {+ const server = this.getHttpServer();+ if (!server.address()) {+ server.listen();+ }+ return `http://localhost:${server.address().port}`;}async [Symbol.asyncDispose]() {await this.close();}++ request(+ method: 'options' | 'get' | 'post' | 'put' | 'delete' | 'patch',+ path: string+ ): supertest.Test {+ return supertest(this.getHttpServer())+ [method](path)+ .set('Cookie', [+ `${AuthService.sessionCookieName}=${this.sessionCookie ?? ''}`,+ `${AuthService.userCookieName}=${this.currentUserCookie ?? ''}`,+ ]);+ }++ gql = gqlFetcherFactory('', async (_input, init) => {+ assert(init, 'no request content');+ assert(init.body, 'body is required for gql request');+ assert(init.headers, 'headers is required for gql request');++ const res = await this.request('post', '/graphql')+ .send(init?.body)+ .set('accept', 'application/json')+ .set(init.headers as Record<string, string>);++ return new Response(Buffer.from(JSON.stringify(res.body)), {+ status: res.status,+ headers: res.headers,+ });+ });++ OPTIONS(path: string): supertest.Test {+ return this.request('options', path);+ }++ GET(path: string): supertest.Test {+ return this.request('get', path);+ }++ POST(path: string): supertest.Test {+ return this.request('post', path).on(+ 'response',+ (res: supertest.Response) => {+ const cookies = parseCookies(res);++ if (AuthService.sessionCookieName in cookies) {+ if (this.sessionCookie !== cookies[AuthService.sessionCookieName]) {+ this.userCookies.clear();+ }++ this.sessionCookie = cookies[AuthService.sessionCookieName];+ this.currentUserCookie = cookies[AuthService.userCookieName];+ if (this.currentUserCookie) {+ this.userCookies.add(this.currentUserCookie);+ }+ }+ return res;+ }+ );+ }++ PUT(path: string): supertest.Test {+ return this.request('put', path);+ }++ DELETE(path: string): supertest.Test {+ return this.request('delete', path);+ }++ PATCH(path: string): supertest.Test {+ return this.request('patch', path);+ }++ async createUser(overrides?: Partial<MockUserInput>) {+ return await this.create(MockUser, overrides);+ }++ async signup(overrides?: Partial<MockUserInput>) {+ const user = await this.create(MockUser, overrides);+ await this.login(user);+ return user;+ }++ async login(user: MockedUser) {+ await this.POST('/api/auth/sign-in')+ .send({+ email: user.email,+ password: user.password,+ })+ .expect(200);+ }++ async switchUser(userOrId: string | { id: string }) {+ if (!this.sessionCookie) {+ throw new Error('No user is logged in.');+ }++ const userId = typeof userOrId === 'string' ? userOrId : userOrId.id;++ if (userId === this.currentUserCookie) {+ return;+ }++ if (this.userCookies.has(userId)) {+ this.currentUserCookie = userId;+ } else {+ throw new Error(`User [${userId}] is not logged in.`);+ }+ }++ async logout(userId?: string) {+ const res = await this.GET(+ '/api/auth/sign-out' + (userId ? `?user_id=${userId}` : '')+ ).expect(200);+ const cookies = parseCookies(res);+ this.sessionCookie = cookies[AuthService.sessionCookieName];+ if (!this.sessionCookie) {+ this.currentUserCookie = null;+ this.userCookies.clear();+ } else {+ this.currentUserCookie = cookies[AuthService.userCookieName];+ if (userId) {+ this.userCookies.delete(userId);+ }+ }+ }}+let GLOBAL_APP_INSTANCE: TestingApp | null = null;export async function createApp(metadata: TestingAppMetadata = {}): Promise<TestingApp> {+ if (GLOBAL_APP_INSTANCE) {+ return GLOBAL_APP_INSTANCE;+ }+const { buildAppModule } = await import('../../app.module');const { tapModule, tapApp } = metadata;@@ -81,5 +232,8 @@ export async function createApp(tapApp(app);}+ await app.init();++ GLOBAL_APP_INSTANCE = app;return app;}diff --git a/packages/backend/server/src/__tests__/e2e/prelude.ts b/packages/backend/server/src/__tests__/e2e/prelude.tsindex e63a0e5934..2cf31cef92 100644--- a/packages/backend/server/src/__tests__/e2e/prelude.ts+++ b/packages/backend/server/src/__tests__/e2e/prelude.ts@@ -1,4 +1,11 @@+import { getBuildConfig } from '@affine-tools/utils/build-config';+import { Package } from '@affine-tools/utils/workspace';+import { createApp } from './create-app';+globalThis.BUILD_CONFIG = getBuildConfig(new Package('@affine/web'), {+ mode: 'development',+ channel: 'canary',+});// @ts-expect-error testingglobalThis.app = await createApp();diff --git a/packages/backend/server/src/__tests__/e2e/test.ts b/packages/backend/server/src/__tests__/e2e/test.tsindex a35938c8e4..30ac3998ae 100644--- a/packages/backend/server/src/__tests__/e2e/test.ts+++ b/packages/backend/server/src/__tests__/e2e/test.ts@@ -1,8 +1,10 @@import test, { registerCompletionHandler } from 'ava';+import { type TestingApp } from './create-app';+export const e2e = test;// @ts-expect-error created in prelude.ts-export const app = globalThis.app;+export const app: TestingApp = globalThis.app;registerCompletionHandler(() => {app.close();diff --git a/packages/backend/server/tsconfig.json b/packages/backend/server/tsconfig.jsonindex 45ba2e7e23..26fc078e19 100644--- a/packages/backend/server/tsconfig.json+++ b/packages/backend/server/tsconfig.json@@ -14,6 +14,7 @@"references": [{ "path": "../../../tools/cli" },{ "path": "../../../tools/utils" },+ { "path": "../../common/graphql" },{ "path": "../native" }]}diff --git a/packages/common/debug/package.json b/packages/common/debug/package.jsonindex 2b466432e5..10c9c7b4dd 100644--- a/packages/common/debug/package.json+++ b/packages/common/debug/package.json@@ -1,6 +1,7 @@{"name": "@affine/debug","private": true,+ "type": "module","exports": {".": "./src/index.ts"},diff --git a/packages/common/error/package.json b/packages/common/error/package.jsonindex cb6a983dcd..1e2d7545f1 100644--- a/packages/common/error/package.json+++ b/packages/common/error/package.json@@ -2,6 +2,7 @@"name": "@affine/error","version": "0.20.0","private": true,+ "type": "module","exports": {".": "./src/index.ts"},diff --git a/packages/frontend/graphql/README.md b/packages/common/graphql/README.mdsimilarity index 100%rename from packages/frontend/graphql/README.mdrename to packages/common/graphql/README.mddiff --git a/packages/frontend/graphql/codegen.yml b/packages/common/graphql/codegen.ymlsimilarity index 100%rename from packages/frontend/graphql/codegen.ymlrename to packages/common/graphql/codegen.ymldiff --git a/packages/frontend/graphql/export-gql-plugin.cjs b/packages/common/graphql/export-gql-plugin.cjssimilarity index 100%rename from packages/frontend/graphql/export-gql-plugin.cjsrename to packages/common/graphql/export-gql-plugin.cjsdiff --git a/packages/frontend/graphql/package.json b/packages/common/graphql/package.jsonsimilarity index 100%rename from packages/frontend/graphql/package.jsonrename to packages/common/graphql/package.jsondiff --git a/packages/frontend/graphql/src/__tests__/fetcher.spec.ts b/packages/common/graphql/src/__tests__/fetcher.spec.tssimilarity index 100%rename from packages/frontend/graphql/src/__tests__/fetcher.spec.tsrename to packages/common/graphql/src/__tests__/fetcher.spec.tsdiff --git a/packages/frontend/graphql/src/fetcher.ts b/packages/common/graphql/src/fetcher.tssimilarity index 100%rename from packages/frontend/graphql/src/fetcher.tsrename to packages/common/graphql/src/fetcher.tsdiff --git a/packages/frontend/graphql/src/graphql/activate-license.gql b/packages/common/graphql/src/graphql/activate-license.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/activate-license.gqlrename to packages/common/graphql/src/graphql/activate-license.gqldiff --git a/packages/frontend/graphql/src/graphql/admin-server-config.gql b/packages/common/graphql/src/graphql/admin-server-config.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/admin-server-config.gqlrename to packages/common/graphql/src/graphql/admin-server-config.gqldiff --git a/packages/frontend/graphql/src/graphql/blob-delete.gql b/packages/common/graphql/src/graphql/blob-delete.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/blob-delete.gqlrename to packages/common/graphql/src/graphql/blob-delete.gqldiff --git a/packages/frontend/graphql/src/graphql/blob-list.gql b/packages/common/graphql/src/graphql/blob-list.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/blob-list.gqlrename to packages/common/graphql/src/graphql/blob-list.gqldiff --git a/packages/frontend/graphql/src/graphql/blob-release-deleted.gql b/packages/common/graphql/src/graphql/blob-release-deleted.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/blob-release-deleted.gqlrename to packages/common/graphql/src/graphql/blob-release-deleted.gqldiff --git a/packages/frontend/graphql/src/graphql/blob-set.gql b/packages/common/graphql/src/graphql/blob-set.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/blob-set.gqlrename to packages/common/graphql/src/graphql/blob-set.gqldiff --git a/packages/frontend/graphql/src/graphql/cancel-subscription.gql b/packages/common/graphql/src/graphql/cancel-subscription.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/cancel-subscription.gqlrename to packages/common/graphql/src/graphql/cancel-subscription.gqldiff --git a/packages/frontend/graphql/src/graphql/change-email.gql b/packages/common/graphql/src/graphql/change-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/change-email.gqlrename to packages/common/graphql/src/graphql/change-email.gqldiff --git a/packages/frontend/graphql/src/graphql/change-password-url.gql b/packages/common/graphql/src/graphql/change-password-url.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/change-password-url.gqlrename to packages/common/graphql/src/graphql/change-password-url.gqldiff --git a/packages/frontend/graphql/src/graphql/change-password.gql b/packages/common/graphql/src/graphql/change-password.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/change-password.gqlrename to packages/common/graphql/src/graphql/change-password.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-category-add.gql b/packages/common/graphql/src/graphql/copilot-context-category-add.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-category-add.gqlrename to packages/common/graphql/src/graphql/copilot-context-category-add.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-category-remove.gql b/packages/common/graphql/src/graphql/copilot-context-category-remove.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-category-remove.gqlrename to packages/common/graphql/src/graphql/copilot-context-category-remove.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-create.gql b/packages/common/graphql/src/graphql/copilot-context-create.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-create.gqlrename to packages/common/graphql/src/graphql/copilot-context-create.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-doc-add.gql b/packages/common/graphql/src/graphql/copilot-context-doc-add.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-doc-add.gqlrename to packages/common/graphql/src/graphql/copilot-context-doc-add.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gql b/packages/common/graphql/src/graphql/copilot-context-doc-remove.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-doc-remove.gqlrename to packages/common/graphql/src/graphql/copilot-context-doc-remove.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-file-add.gql b/packages/common/graphql/src/graphql/copilot-context-file-add.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-file-add.gqlrename to packages/common/graphql/src/graphql/copilot-context-file-add.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-file-match.gql b/packages/common/graphql/src/graphql/copilot-context-file-match.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-file-match.gqlrename to packages/common/graphql/src/graphql/copilot-context-file-match.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-file-remove.gql b/packages/common/graphql/src/graphql/copilot-context-file-remove.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-file-remove.gqlrename to packages/common/graphql/src/graphql/copilot-context-file-remove.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-list-object.gql b/packages/common/graphql/src/graphql/copilot-context-list-object.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-list-object.gqlrename to packages/common/graphql/src/graphql/copilot-context-list-object.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-list.gql b/packages/common/graphql/src/graphql/copilot-context-list.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-list.gqlrename to packages/common/graphql/src/graphql/copilot-context-list.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-workspace-match.gql b/packages/common/graphql/src/graphql/copilot-context-workspace-match.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-workspace-match.gqlrename to packages/common/graphql/src/graphql/copilot-context-workspace-match.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-workspace-query.gql b/packages/common/graphql/src/graphql/copilot-context-workspace-query.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-workspace-query.gqlrename to packages/common/graphql/src/graphql/copilot-context-workspace-query.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-context-workspace-queue.gql b/packages/common/graphql/src/graphql/copilot-context-workspace-queue.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-context-workspace-queue.gqlrename to packages/common/graphql/src/graphql/copilot-context-workspace-queue.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-history-get-ids.gql b/packages/common/graphql/src/graphql/copilot-history-get-ids.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-history-get-ids.gqlrename to packages/common/graphql/src/graphql/copilot-history-get-ids.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-history-list.gql b/packages/common/graphql/src/graphql/copilot-history-list.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-history-list.gqlrename to packages/common/graphql/src/graphql/copilot-history-list.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-message-create.gql b/packages/common/graphql/src/graphql/copilot-message-create.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-message-create.gqlrename to packages/common/graphql/src/graphql/copilot-message-create.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-prompt-list.gql b/packages/common/graphql/src/graphql/copilot-prompt-list.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-prompt-list.gqlrename to packages/common/graphql/src/graphql/copilot-prompt-list.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-prompt-update.gql b/packages/common/graphql/src/graphql/copilot-prompt-update.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-prompt-update.gqlrename to packages/common/graphql/src/graphql/copilot-prompt-update.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-quota.gql b/packages/common/graphql/src/graphql/copilot-quota.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-quota.gqlrename to packages/common/graphql/src/graphql/copilot-quota.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-session-cleanup.gql b/packages/common/graphql/src/graphql/copilot-session-cleanup.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-session-cleanup.gqlrename to packages/common/graphql/src/graphql/copilot-session-cleanup.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-session-create.gql b/packages/common/graphql/src/graphql/copilot-session-create.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-session-create.gqlrename to packages/common/graphql/src/graphql/copilot-session-create.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-session-fork.gql b/packages/common/graphql/src/graphql/copilot-session-fork.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-session-fork.gqlrename to packages/common/graphql/src/graphql/copilot-session-fork.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-session-update.gql b/packages/common/graphql/src/graphql/copilot-session-update.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-session-update.gqlrename to packages/common/graphql/src/graphql/copilot-session-update.gqldiff --git a/packages/frontend/graphql/src/graphql/copilot-sessions-get.gql b/packages/common/graphql/src/graphql/copilot-sessions-get.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/copilot-sessions-get.gqlrename to packages/common/graphql/src/graphql/copilot-sessions-get.gqldiff --git a/packages/frontend/graphql/src/graphql/create-checkout-link.gql b/packages/common/graphql/src/graphql/create-checkout-link.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/create-checkout-link.gqlrename to packages/common/graphql/src/graphql/create-checkout-link.gqldiff --git a/packages/frontend/graphql/src/graphql/create-customer-portal.gql b/packages/common/graphql/src/graphql/create-customer-portal.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/create-customer-portal.gqlrename to packages/common/graphql/src/graphql/create-customer-portal.gqldiff --git a/packages/frontend/graphql/src/graphql/create-self-host-customer-portal.gql b/packages/common/graphql/src/graphql/create-self-host-customer-portal.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/create-self-host-customer-portal.gqlrename to packages/common/graphql/src/graphql/create-self-host-customer-portal.gqldiff --git a/packages/frontend/graphql/src/graphql/create-user.gql b/packages/common/graphql/src/graphql/create-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/create-user.gqlrename to packages/common/graphql/src/graphql/create-user.gqldiff --git a/packages/frontend/graphql/src/graphql/create-workspace.gql b/packages/common/graphql/src/graphql/create-workspace.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/create-workspace.gqlrename to packages/common/graphql/src/graphql/create-workspace.gqldiff --git a/packages/frontend/graphql/src/graphql/deactivate-license.gql b/packages/common/graphql/src/graphql/deactivate-license.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/deactivate-license.gqlrename to packages/common/graphql/src/graphql/deactivate-license.gqldiff --git a/packages/frontend/graphql/src/graphql/delete-account.gql b/packages/common/graphql/src/graphql/delete-account.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/delete-account.gqlrename to packages/common/graphql/src/graphql/delete-account.gqldiff --git a/packages/frontend/graphql/src/graphql/delete-user.gql b/packages/common/graphql/src/graphql/delete-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/delete-user.gqlrename to packages/common/graphql/src/graphql/delete-user.gqldiff --git a/packages/frontend/graphql/src/graphql/delete-workspace.gql b/packages/common/graphql/src/graphql/delete-workspace.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/delete-workspace.gqlrename to packages/common/graphql/src/graphql/delete-workspace.gqldiff --git a/packages/frontend/graphql/src/graphql/disable-user.gql b/packages/common/graphql/src/graphql/disable-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/disable-user.gqlrename to packages/common/graphql/src/graphql/disable-user.gqldiff --git a/packages/frontend/graphql/src/graphql/doc-role-permissions.gql b/packages/common/graphql/src/graphql/doc-role-permissions.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/doc-role-permissions.gqlrename to packages/common/graphql/src/graphql/doc-role-permissions.gqldiff --git a/packages/frontend/graphql/src/graphql/enable-user.gql b/packages/common/graphql/src/graphql/enable-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/enable-user.gqlrename to packages/common/graphql/src/graphql/enable-user.gqldiff --git a/packages/frontend/graphql/src/graphql/fragments/credentials-requirement.gql b/packages/common/graphql/src/graphql/fragments/credentials-requirement.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/fragments/credentials-requirement.gqlrename to packages/common/graphql/src/graphql/fragments/credentials-requirement.gqldiff --git a/packages/frontend/graphql/src/graphql/fragments/password-limits.gql b/packages/common/graphql/src/graphql/fragments/password-limits.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/fragments/password-limits.gqlrename to packages/common/graphql/src/graphql/fragments/password-limits.gqldiff --git a/packages/frontend/graphql/src/graphql/generate-license-key.gql b/packages/common/graphql/src/graphql/generate-license-key.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/generate-license-key.gqlrename to packages/common/graphql/src/graphql/generate-license-key.gqldiff --git a/packages/frontend/graphql/src/graphql/get-current-user-features.gql b/packages/common/graphql/src/graphql/get-current-user-features.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-current-user-features.gqlrename to packages/common/graphql/src/graphql/get-current-user-features.gqldiff --git a/packages/frontend/graphql/src/graphql/get-current-user.gql b/packages/common/graphql/src/graphql/get-current-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-current-user.gqlrename to packages/common/graphql/src/graphql/get-current-user.gqldiff --git a/packages/frontend/graphql/src/graphql/get-doc-default-role.gql b/packages/common/graphql/src/graphql/get-doc-default-role.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-doc-default-role.gqlrename to packages/common/graphql/src/graphql/get-doc-default-role.gqldiff --git a/packages/frontend/graphql/src/graphql/get-invite-info.gql b/packages/common/graphql/src/graphql/get-invite-info.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-invite-info.gqlrename to packages/common/graphql/src/graphql/get-invite-info.gqldiff --git a/packages/frontend/graphql/src/graphql/get-is-admin.gql b/packages/common/graphql/src/graphql/get-is-admin.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-is-admin.gqlrename to packages/common/graphql/src/graphql/get-is-admin.gqldiff --git a/packages/frontend/graphql/src/graphql/get-is-owner.gql b/packages/common/graphql/src/graphql/get-is-owner.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-is-owner.gqlrename to packages/common/graphql/src/graphql/get-is-owner.gqldiff --git a/packages/frontend/graphql/src/graphql/get-license.gql b/packages/common/graphql/src/graphql/get-license.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-license.gqlrename to packages/common/graphql/src/graphql/get-license.gqldiff --git a/packages/frontend/graphql/src/graphql/get-member-count-by-workspace-id.gql b/packages/common/graphql/src/graphql/get-member-count-by-workspace-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-member-count-by-workspace-id.gqlrename to packages/common/graphql/src/graphql/get-member-count-by-workspace-id.gqldiff --git a/packages/frontend/graphql/src/graphql/get-members-by-workspace-id.gql b/packages/common/graphql/src/graphql/get-members-by-workspace-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-members-by-workspace-id.gqlrename to packages/common/graphql/src/graphql/get-members-by-workspace-id.gqldiff --git a/packages/frontend/graphql/src/graphql/get-oauth-providers.gql b/packages/common/graphql/src/graphql/get-oauth-providers.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-oauth-providers.gqlrename to packages/common/graphql/src/graphql/get-oauth-providers.gqldiff --git a/packages/frontend/graphql/src/graphql/get-page-granted-users-list.gql b/packages/common/graphql/src/graphql/get-page-granted-users-list.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-page-granted-users-list.gqlrename to packages/common/graphql/src/graphql/get-page-granted-users-list.gqldiff --git a/packages/frontend/graphql/src/graphql/get-public-user-by-id.gql b/packages/common/graphql/src/graphql/get-public-user-by-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-public-user-by-id.gqlrename to packages/common/graphql/src/graphql/get-public-user-by-id.gqldiff --git a/packages/frontend/graphql/src/graphql/get-server-runtime-config.gql b/packages/common/graphql/src/graphql/get-server-runtime-config.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-server-runtime-config.gqlrename to packages/common/graphql/src/graphql/get-server-runtime-config.gqldiff --git a/packages/frontend/graphql/src/graphql/get-server-service-configs.gql b/packages/common/graphql/src/graphql/get-server-service-configs.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-server-service-configs.gqlrename to packages/common/graphql/src/graphql/get-server-service-configs.gqldiff --git a/packages/frontend/graphql/src/graphql/get-user-by-email.gql b/packages/common/graphql/src/graphql/get-user-by-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-user-by-email.gqlrename to packages/common/graphql/src/graphql/get-user-by-email.gqldiff --git a/packages/frontend/graphql/src/graphql/get-user-features.gql b/packages/common/graphql/src/graphql/get-user-features.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-user-features.gqlrename to packages/common/graphql/src/graphql/get-user-features.gqldiff --git a/packages/frontend/graphql/src/graphql/get-user.gql b/packages/common/graphql/src/graphql/get-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-user.gqlrename to packages/common/graphql/src/graphql/get-user.gqldiff --git a/packages/frontend/graphql/src/graphql/get-users-count.gql b/packages/common/graphql/src/graphql/get-users-count.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-users-count.gqlrename to packages/common/graphql/src/graphql/get-users-count.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-info.gql b/packages/common/graphql/src/graphql/get-workspace-info.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-info.gqlrename to packages/common/graphql/src/graphql/get-workspace-info.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-page-by-id.gql b/packages/common/graphql/src/graphql/get-workspace-page-by-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-page-by-id.gqlrename to packages/common/graphql/src/graphql/get-workspace-page-by-id.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-page-meta.gql b/packages/common/graphql/src/graphql/get-workspace-page-meta.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-page-meta.gqlrename to packages/common/graphql/src/graphql/get-workspace-page-meta.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-public-by-id.gql b/packages/common/graphql/src/graphql/get-workspace-public-by-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-public-by-id.gqlrename to packages/common/graphql/src/graphql/get-workspace-public-by-id.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-public-pages.gql b/packages/common/graphql/src/graphql/get-workspace-public-pages.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-public-pages.gqlrename to packages/common/graphql/src/graphql/get-workspace-public-pages.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace-subscription.gql b/packages/common/graphql/src/graphql/get-workspace-subscription.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace-subscription.gqlrename to packages/common/graphql/src/graphql/get-workspace-subscription.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspace.gql b/packages/common/graphql/src/graphql/get-workspace.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspace.gqlrename to packages/common/graphql/src/graphql/get-workspace.gqldiff --git a/packages/frontend/graphql/src/graphql/get-workspaces.gql b/packages/common/graphql/src/graphql/get-workspaces.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/get-workspaces.gqlrename to packages/common/graphql/src/graphql/get-workspaces.gqldiff --git a/packages/frontend/graphql/src/graphql/grant-doc-user-roles.gql b/packages/common/graphql/src/graphql/grant-doc-user-roles.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/grant-doc-user-roles.gqlrename to packages/common/graphql/src/graphql/grant-doc-user-roles.gqldiff --git a/packages/frontend/graphql/src/graphql/histories.gql b/packages/common/graphql/src/graphql/histories.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/histories.gqlrename to packages/common/graphql/src/graphql/histories.gqldiff --git a/packages/frontend/graphql/src/graphql/import-users.gql b/packages/common/graphql/src/graphql/import-users.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/import-users.gqlrename to packages/common/graphql/src/graphql/import-users.gqldiff --git a/packages/frontend/graphql/src/graphql/index.ts b/packages/common/graphql/src/graphql/index.tssimilarity index 100%rename from packages/frontend/graphql/src/graphql/index.tsrename to packages/common/graphql/src/graphql/index.tsdiff --git a/packages/frontend/graphql/src/graphql/invoices-count.gql b/packages/common/graphql/src/graphql/invoices-count.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/invoices-count.gqlrename to packages/common/graphql/src/graphql/invoices-count.gqldiff --git a/packages/frontend/graphql/src/graphql/invoices.gql b/packages/common/graphql/src/graphql/invoices.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/invoices.gqlrename to packages/common/graphql/src/graphql/invoices.gqldiff --git a/packages/frontend/graphql/src/graphql/leave-workspace.gql b/packages/common/graphql/src/graphql/leave-workspace.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/leave-workspace.gqlrename to packages/common/graphql/src/graphql/leave-workspace.gqldiff --git a/packages/frontend/graphql/src/graphql/list-notifications.gql b/packages/common/graphql/src/graphql/list-notifications.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/list-notifications.gqlrename to packages/common/graphql/src/graphql/list-notifications.gqldiff --git a/packages/frontend/graphql/src/graphql/list-users.gql b/packages/common/graphql/src/graphql/list-users.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/list-users.gqlrename to packages/common/graphql/src/graphql/list-users.gqldiff --git a/packages/frontend/graphql/src/graphql/mention-user.gql b/packages/common/graphql/src/graphql/mention-user.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/mention-user.gqlrename to packages/common/graphql/src/graphql/mention-user.gqldiff --git a/packages/frontend/graphql/src/graphql/notification-count.gql b/packages/common/graphql/src/graphql/notification-count.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/notification-count.gqlrename to packages/common/graphql/src/graphql/notification-count.gqldiff --git a/packages/frontend/graphql/src/graphql/prices.gql b/packages/common/graphql/src/graphql/prices.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/prices.gqlrename to packages/common/graphql/src/graphql/prices.gqldiff --git a/packages/frontend/graphql/src/graphql/public-page.gql b/packages/common/graphql/src/graphql/public-page.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/public-page.gqlrename to packages/common/graphql/src/graphql/public-page.gqldiff --git a/packages/frontend/graphql/src/graphql/quota.gql b/packages/common/graphql/src/graphql/quota.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/quota.gqlrename to packages/common/graphql/src/graphql/quota.gqldiff --git a/packages/frontend/graphql/src/graphql/read-notification.gql b/packages/common/graphql/src/graphql/read-notification.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/read-notification.gqlrename to packages/common/graphql/src/graphql/read-notification.gqldiff --git a/packages/frontend/graphql/src/graphql/recover-doc.gql b/packages/common/graphql/src/graphql/recover-doc.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/recover-doc.gqlrename to packages/common/graphql/src/graphql/recover-doc.gqldiff --git a/packages/frontend/graphql/src/graphql/remove-avatar.gql b/packages/common/graphql/src/graphql/remove-avatar.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/remove-avatar.gqlrename to packages/common/graphql/src/graphql/remove-avatar.gqldiff --git a/packages/frontend/graphql/src/graphql/resume-subscription.gql b/packages/common/graphql/src/graphql/resume-subscription.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/resume-subscription.gqlrename to packages/common/graphql/src/graphql/resume-subscription.gqldiff --git a/packages/frontend/graphql/src/graphql/revoke-doc-user-roles.gql b/packages/common/graphql/src/graphql/revoke-doc-user-roles.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/revoke-doc-user-roles.gqlrename to packages/common/graphql/src/graphql/revoke-doc-user-roles.gqldiff --git a/packages/frontend/graphql/src/graphql/revoke-member-permission.gql b/packages/common/graphql/src/graphql/revoke-member-permission.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/revoke-member-permission.gqlrename to packages/common/graphql/src/graphql/revoke-member-permission.gqldiff --git a/packages/frontend/graphql/src/graphql/revoke-public-page.gql b/packages/common/graphql/src/graphql/revoke-public-page.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/revoke-public-page.gqlrename to packages/common/graphql/src/graphql/revoke-public-page.gqldiff --git a/packages/frontend/graphql/src/graphql/send-change-email.gql b/packages/common/graphql/src/graphql/send-change-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/send-change-email.gqlrename to packages/common/graphql/src/graphql/send-change-email.gqldiff --git a/packages/frontend/graphql/src/graphql/send-change-password-email.gql b/packages/common/graphql/src/graphql/send-change-password-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/send-change-password-email.gqlrename to packages/common/graphql/src/graphql/send-change-password-email.gqldiff --git a/packages/frontend/graphql/src/graphql/send-set-password-email.gql b/packages/common/graphql/src/graphql/send-set-password-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/send-set-password-email.gqlrename to packages/common/graphql/src/graphql/send-set-password-email.gqldiff --git a/packages/frontend/graphql/src/graphql/send-verify-change-email.gql b/packages/common/graphql/src/graphql/send-verify-change-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/send-verify-change-email.gqlrename to packages/common/graphql/src/graphql/send-verify-change-email.gqldiff --git a/packages/frontend/graphql/src/graphql/send-verify-email.gql b/packages/common/graphql/src/graphql/send-verify-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/send-verify-email.gqlrename to packages/common/graphql/src/graphql/send-verify-email.gqldiff --git a/packages/frontend/graphql/src/graphql/server-config.gql b/packages/common/graphql/src/graphql/server-config.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/server-config.gqlrename to packages/common/graphql/src/graphql/server-config.gqldiff --git a/packages/frontend/graphql/src/graphql/set-workspace-public-by-id.gql b/packages/common/graphql/src/graphql/set-workspace-public-by-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/set-workspace-public-by-id.gqlrename to packages/common/graphql/src/graphql/set-workspace-public-by-id.gqldiff --git a/packages/frontend/graphql/src/graphql/subscription.gql b/packages/common/graphql/src/graphql/subscription.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/subscription.gqlrename to packages/common/graphql/src/graphql/subscription.gqldiff --git a/packages/frontend/graphql/src/graphql/update-account-features.gql b/packages/common/graphql/src/graphql/update-account-features.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-account-features.gqlrename to packages/common/graphql/src/graphql/update-account-features.gqldiff --git a/packages/frontend/graphql/src/graphql/update-account.gql b/packages/common/graphql/src/graphql/update-account.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-account.gqlrename to packages/common/graphql/src/graphql/update-account.gqldiff --git a/packages/frontend/graphql/src/graphql/update-doc-default-role.gql b/packages/common/graphql/src/graphql/update-doc-default-role.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-doc-default-role.gqlrename to packages/common/graphql/src/graphql/update-doc-default-role.gqldiff --git a/packages/frontend/graphql/src/graphql/update-doc-user-role.gql b/packages/common/graphql/src/graphql/update-doc-user-role.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-doc-user-role.gqlrename to packages/common/graphql/src/graphql/update-doc-user-role.gqldiff --git a/packages/frontend/graphql/src/graphql/update-server-runtime-configs.gql b/packages/common/graphql/src/graphql/update-server-runtime-configs.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-server-runtime-configs.gqlrename to packages/common/graphql/src/graphql/update-server-runtime-configs.gqldiff --git a/packages/frontend/graphql/src/graphql/update-subscription-billing.gql b/packages/common/graphql/src/graphql/update-subscription-billing.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-subscription-billing.gqlrename to packages/common/graphql/src/graphql/update-subscription-billing.gqldiff --git a/packages/frontend/graphql/src/graphql/update-user-profile.gql b/packages/common/graphql/src/graphql/update-user-profile.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/update-user-profile.gqlrename to packages/common/graphql/src/graphql/update-user-profile.gqldiff --git a/packages/frontend/graphql/src/graphql/upload-avatar.gql b/packages/common/graphql/src/graphql/upload-avatar.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/upload-avatar.gqlrename to packages/common/graphql/src/graphql/upload-avatar.gqldiff --git a/packages/frontend/graphql/src/graphql/verify-email.gql b/packages/common/graphql/src/graphql/verify-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/verify-email.gqlrename to packages/common/graphql/src/graphql/verify-email.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-config.gql b/packages/common/graphql/src/graphql/workspace-config.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-config.gqlrename to packages/common/graphql/src/graphql/workspace-config.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-enable-ai.gql b/packages/common/graphql/src/graphql/workspace-enable-ai.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-enable-ai.gqlrename to packages/common/graphql/src/graphql/workspace-enable-ai.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-enable-url-preview.gql b/packages/common/graphql/src/graphql/workspace-enable-url-preview.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-enable-url-preview.gqlrename to packages/common/graphql/src/graphql/workspace-enable-url-preview.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-intive-by-email.gql b/packages/common/graphql/src/graphql/workspace-intive-by-email.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-intive-by-email.gqlrename to packages/common/graphql/src/graphql/workspace-intive-by-email.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-intive-by-emails.gql b/packages/common/graphql/src/graphql/workspace-intive-by-emails.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-intive-by-emails.gqlrename to packages/common/graphql/src/graphql/workspace-intive-by-emails.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-invite-accept-by-invite-id.gql b/packages/common/graphql/src/graphql/workspace-invite-accept-by-invite-id.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-invite-accept-by-invite-id.gqlrename to packages/common/graphql/src/graphql/workspace-invite-accept-by-invite-id.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-invite-batch.gql b/packages/common/graphql/src/graphql/workspace-invite-batch.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-invite-batch.gqlrename to packages/common/graphql/src/graphql/workspace-invite-batch.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-invite-link.gql b/packages/common/graphql/src/graphql/workspace-invite-link.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-invite-link.gqlrename to packages/common/graphql/src/graphql/workspace-invite-link.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-invite-revoke-link.gql b/packages/common/graphql/src/graphql/workspace-invite-revoke-link.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-invite-revoke-link.gqlrename to packages/common/graphql/src/graphql/workspace-invite-revoke-link.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-invoices.gql b/packages/common/graphql/src/graphql/workspace-invoices.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-invoices.gqlrename to packages/common/graphql/src/graphql/workspace-invoices.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-quota.gql b/packages/common/graphql/src/graphql/workspace-quota.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-quota.gqlrename to packages/common/graphql/src/graphql/workspace-quota.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-role-permissions.gql b/packages/common/graphql/src/graphql/workspace-role-permissions.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-role-permissions.gqlrename to packages/common/graphql/src/graphql/workspace-role-permissions.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-team-approve.gql b/packages/common/graphql/src/graphql/workspace-team-approve.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-team-approve.gqlrename to packages/common/graphql/src/graphql/workspace-team-approve.gqldiff --git a/packages/frontend/graphql/src/graphql/workspace-team-grant.gql b/packages/common/graphql/src/graphql/workspace-team-grant.gqlsimilarity index 100%rename from packages/frontend/graphql/src/graphql/workspace-team-grant.gqlrename to packages/common/graphql/src/graphql/workspace-team-grant.gqldiff --git a/packages/frontend/graphql/src/index.ts b/packages/common/graphql/src/index.tssimilarity index 100%rename from packages/frontend/graphql/src/index.tsrename to packages/common/graphql/src/index.tsdiff --git a/packages/frontend/graphql/src/schema.ts b/packages/common/graphql/src/schema.tssimilarity index 100%rename from packages/frontend/graphql/src/schema.tsrename to packages/common/graphql/src/schema.tsdiff --git a/packages/frontend/graphql/tsconfig.json b/packages/common/graphql/tsconfig.jsonsimilarity index 66%rename from packages/frontend/graphql/tsconfig.jsonrename to packages/common/graphql/tsconfig.jsonindex 98fa9f08b9..605949f390 100644--- a/packages/frontend/graphql/tsconfig.json+++ b/packages/common/graphql/tsconfig.json@@ -7,8 +7,8 @@"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"},"references": [- { "path": "../../common/debug" },- { "path": "../../common/env" },- { "path": "../../common/error" }+ { "path": "../debug" },+ { "path": "../env" },+ { "path": "../error" }]}diff --git a/packages/common/nbstore/tsconfig.json b/packages/common/nbstore/tsconfig.jsonindex 9586a8f303..67c938fb62 100644--- a/packages/common/nbstore/tsconfig.json+++ b/packages/common/nbstore/tsconfig.json@@ -9,6 +9,6 @@"references": [{ "path": "../infra" },{ "path": "../error" },- { "path": "../../frontend/graphql" }+ { "path": "../graphql" }]}diff --git a/packages/frontend/admin/tsconfig.json b/packages/frontend/admin/tsconfig.jsonindex 2f1a1405df..d92e6b6788 100644--- a/packages/frontend/admin/tsconfig.json+++ b/packages/frontend/admin/tsconfig.json@@ -9,7 +9,7 @@"references": [{ "path": "../component" },{ "path": "../core" },- { "path": "../graphql" },+ { "path": "../../common/graphql" },{ "path": "../../common/infra" }]}diff --git a/packages/frontend/component/tsconfig.json b/packages/frontend/component/tsconfig.jsonindex 7416b0faf4..cd67ccdb75 100644--- a/packages/frontend/component/tsconfig.json+++ b/packages/frontend/component/tsconfig.json@@ -15,7 +15,7 @@{ "path": "../../common/debug" },{ "path": "../electron-api" },{ "path": "../../common/error" },- { "path": "../graphql" },+ { "path": "../../common/graphql" },{ "path": "../i18n" },{ "path": "../../../tools/utils" },{ "path": "../../../blocksuite/affine/all" }diff --git a/packages/frontend/core/tsconfig.json b/packages/frontend/core/tsconfig.jsonindex d8e547789c..f3e56ca57f 100644--- a/packages/frontend/core/tsconfig.json+++ b/packages/frontend/core/tsconfig.json@@ -12,7 +12,7 @@{ "path": "../electron-api" },{ "path": "../../common/env" },{ "path": "../../common/error" },- { "path": "../graphql" },+ { "path": "../../common/graphql" },{ "path": "../i18n" },{ "path": "../../common/nbstore" },{ "path": "../track" },diff --git a/tools/utils/src/workspace.gen.ts b/tools/utils/src/workspace.gen.tsindex 15e610d466..cb6384eda1 100644--- a/tools/utils/src/workspace.gen.ts+++ b/tools/utils/src/workspace.gen.ts@@ -656,6 +656,7 @@ export const PackageList = [workspaceDependencies: ['tools/cli','tools/utils',+ 'packages/common/graphql','packages/backend/native',],},@@ -674,6 +675,15 @@ export const PackageList = [name: '@affine/error',workspaceDependencies: [],},+ {+ location: 'packages/common/graphql',+ name: '@affine/graphql',+ workspaceDependencies: [+ 'packages/common/debug',+ 'packages/common/env',+ 'packages/common/error',+ ],+ },{location: 'packages/common/infra',name: '@toeverything/infra',@@ -690,7 +700,7 @@ export const PackageList = [workspaceDependencies: ['packages/common/infra','packages/common/error',- 'packages/frontend/graphql',+ 'packages/common/graphql',],},{@@ -699,7 +709,7 @@ export const PackageList = [workspaceDependencies: ['packages/frontend/component','packages/frontend/core',- 'packages/frontend/graphql',+ 'packages/common/graphql','packages/common/infra',],},@@ -783,7 +793,7 @@ export const PackageList = ['packages/common/debug','packages/frontend/electron-api','packages/common/error',- 'packages/frontend/graphql',+ 'packages/common/graphql','packages/frontend/i18n','tools/utils','blocksuite/affine/all',@@ -798,7 +808,7 @@ export const PackageList = ['packages/frontend/electron-api','packages/common/env','packages/common/error',- 'packages/frontend/graphql',+ 'packages/common/graphql','packages/frontend/i18n','packages/common/nbstore','packages/frontend/templates',@@ -812,15 +822,6 @@ export const PackageList = [name: '@affine/electron-api',workspaceDependencies: ['packages/frontend/apps/electron'],},- {- location: 'packages/frontend/graphql',- name: '@affine/graphql',- workspaceDependencies: [- 'packages/common/debug',- 'packages/common/env',- 'packages/common/error',- ],- },{location: 'packages/frontend/i18n',name: '@affine/i18n',@@ -987,6 +988,7 @@ export type PackageName =| '@affine/debug'| '@affine/env'| '@affine/error'+ | '@affine/graphql'| '@toeverything/infra'| '@affine/nbstore'| '@affine/admin'@@ -999,7 +1001,6 @@ export type PackageName =| '@affine/component'| '@affine/core'| '@affine/electron-api'- | '@affine/graphql'| '@affine/i18n'| '@affine/media-capture-playground'| '@affine/native'diff --git a/tsconfig.json b/tsconfig.jsonindex c7816b55c0..5425687db7 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -100,6 +100,7 @@{ "path": "./packages/common/debug" },{ "path": "./packages/common/env" },{ "path": "./packages/common/error" },+ { "path": "./packages/common/graphql" },{ "path": "./packages/common/infra" },{ "path": "./packages/common/nbstore" },{ "path": "./packages/frontend/admin" },@@ -112,7 +113,6 @@{ "path": "./packages/frontend/component" },{ "path": "./packages/frontend/core" },{ "path": "./packages/frontend/electron-api" },- { "path": "./packages/frontend/graphql" },{ "path": "./packages/frontend/i18n" },{ "path": "./packages/frontend/media-capture-playground" },{ "path": "./packages/frontend/native" },diff --git a/yarn.lock b/yarn.lockindex 52aa1e4103..80f8a1210f 100644--- a/yarn.lock+++ b/yarn.lock@@ -596,9 +596,9 @@ __metadata:languageName: unknownlinkType: soft-"@affine/graphql@workspace:*, @affine/graphql@workspace:packages/frontend/graphql":+"@affine/graphql@workspace:*, @affine/graphql@workspace:packages/common/graphql":version: 0.0.0-use.local- resolution: "@affine/graphql@workspace:packages/frontend/graphql"+ resolution: "@affine/graphql@workspace:packages/common/graphql"dependencies:"@affine/debug": "workspace:*""@affine/env": "workspace:*"@@ -844,6 +844,7 @@ __metadata:dependencies:"@affine-tools/cli": "workspace:*""@affine-tools/utils": "workspace:*"+ "@affine/graphql": "workspace:*""@affine/server-native": "workspace:*""@ai-sdk/google": "npm:^1.1.19""@apollo/server": "npm:^4.11.2"