mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 03:26:47 +08:00
chore: rename fundamentals to base (#9119)
This commit is contained in:
@@ -2,7 +2,7 @@ import {
|
||||
defineRuntimeConfig,
|
||||
defineStartupConfig,
|
||||
ModuleConfig,
|
||||
} from '../../fundamentals/config';
|
||||
} from '../../base/config';
|
||||
|
||||
export interface AuthStartupConfigurations {
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ export interface AuthRuntimeConfigurations {
|
||||
};
|
||||
}
|
||||
|
||||
declare module '../../fundamentals/config' {
|
||||
declare module '../../base/config' {
|
||||
interface AppConfig {
|
||||
auth: ModuleConfig<AuthStartupConfigurations, AuthRuntimeConfigurations>;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
Throttle,
|
||||
URLHelper,
|
||||
UseNamedGuard,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { UserService } from '../user';
|
||||
import { validators } from '../utils/validators';
|
||||
import { Public } from './guard';
|
||||
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
Config,
|
||||
getRequestResponseFromContext,
|
||||
parseCookies,
|
||||
} from '../../fundamentals';
|
||||
import { WEBSOCKET_OPTIONS } from '../../fundamentals/websocket';
|
||||
} from '../../base';
|
||||
import { WEBSOCKET_OPTIONS } from '../../base/websocket';
|
||||
import { AuthService } from './service';
|
||||
import { Session } from './session';
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
SkipThrottle,
|
||||
Throttle,
|
||||
URLHelper,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { Admin } from '../common';
|
||||
import { UserService } from '../user';
|
||||
import { UserType } from '../user/types';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { PrismaClient } from '@prisma/client';
|
||||
import type { CookieOptions, Request, Response } from 'express';
|
||||
import { assign, pick } from 'lodash-es';
|
||||
|
||||
import { Config, MailService, SignUpForbidden } from '../../fundamentals';
|
||||
import { Config, MailService, SignUpForbidden } from '../../base';
|
||||
import { FeatureManagementService } from '../features/management';
|
||||
import { QuotaService } from '../quota/service';
|
||||
import { QuotaType } from '../quota/types';
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ExecutionContext } from '@nestjs/common';
|
||||
import { createParamDecorator } from '@nestjs/common';
|
||||
import { User, UserSession } from '@prisma/client';
|
||||
|
||||
import { getRequestResponseFromContext } from '../../fundamentals';
|
||||
import { getRequestResponseFromContext } from '../../base';
|
||||
|
||||
/**
|
||||
* Used to fetch current user from the request context.
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Injectable } from '@nestjs/common';
|
||||
import { Cron, CronExpression } from '@nestjs/schedule';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
import { CryptoHelper } from '../../fundamentals/helpers';
|
||||
import { CryptoHelper } from '../../base/helpers';
|
||||
|
||||
export enum TokenType {
|
||||
SignIn,
|
||||
|
||||
@@ -6,10 +6,7 @@ import type {
|
||||
import { Injectable, UseGuards } from '@nestjs/common';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
|
||||
import {
|
||||
ActionForbidden,
|
||||
getRequestResponseFromContext,
|
||||
} from '../../fundamentals';
|
||||
import { ActionForbidden, getRequestResponseFromContext } from '../../base';
|
||||
import { FeatureManagementService } from '../features/management';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { defineRuntimeConfig, ModuleConfig } from '../../fundamentals/config';
|
||||
import { defineRuntimeConfig, ModuleConfig } from '../../base/config';
|
||||
|
||||
export interface ServerFlags {
|
||||
earlyAccessControl: boolean;
|
||||
syncClientVersionCheck: boolean;
|
||||
}
|
||||
|
||||
declare module '../../fundamentals/config' {
|
||||
declare module '../../base/config' {
|
||||
interface AppConfig {
|
||||
flags: ModuleConfig<never, ServerFlags>;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { RuntimeConfig, RuntimeConfigType } from '@prisma/client';
|
||||
import { GraphQLJSON, GraphQLJSONObject } from 'graphql-scalars';
|
||||
|
||||
import { Config, URLHelper } from '../../fundamentals';
|
||||
import { Config, URLHelper } from '../../base';
|
||||
import { Public } from '../auth';
|
||||
import { Admin } from '../common';
|
||||
import { FeatureType } from '../features';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
import { DeploymentType } from '../../fundamentals';
|
||||
import { DeploymentType } from '../../base';
|
||||
|
||||
export enum ServerFeature {
|
||||
Captcha = 'captcha',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Controller, Get, Logger, Req, Res } from '@nestjs/common';
|
||||
import type { Request, Response } from 'express';
|
||||
import isMobile from 'is-mobile';
|
||||
|
||||
import { Config, metrics, URLHelper } from '../../fundamentals';
|
||||
import { Config, metrics, URLHelper } from '../../base';
|
||||
import { htmlSanitize } from '../../native';
|
||||
import { Public } from '../auth';
|
||||
import { PermissionService } from '../permission';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { applyUpdate, Doc } from 'yjs';
|
||||
|
||||
import { Cache, type EventPayload, OnEvent } from '../../fundamentals';
|
||||
import { Cache, type EventPayload, OnEvent } from '../../base';
|
||||
import { PgWorkspaceDocStorageAdapter } from '../doc';
|
||||
import {
|
||||
type PageDocContent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
import { Mutex } from '../../../fundamentals';
|
||||
import { Mutex } from '../../../base';
|
||||
import { DocStorageOptions } from '../options';
|
||||
import { DocRecord, DocStorageAdapter } from '../storage';
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
FailedToUpsertSnapshot,
|
||||
metrics,
|
||||
Mutex,
|
||||
} from '../../../fundamentals';
|
||||
import { retryable } from '../../../fundamentals/utils/promise';
|
||||
} from '../../../base';
|
||||
import { retryable } from '../../../base/utils/promise';
|
||||
import { DocStorageOptions } from '../options';
|
||||
import {
|
||||
DocRecord,
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
defineRuntimeConfig,
|
||||
defineStartupConfig,
|
||||
ModuleConfig,
|
||||
} from '../../fundamentals/config';
|
||||
} from '../../base/config';
|
||||
|
||||
interface DocStartupConfigurations {
|
||||
manager: {
|
||||
@@ -46,7 +46,7 @@ interface DocRuntimeConfigurations {
|
||||
experimentalMergeWithYOcto: boolean;
|
||||
}
|
||||
|
||||
declare module '../../fundamentals/config' {
|
||||
declare module '../../base/config' {
|
||||
interface AppConfig {
|
||||
doc: ModuleConfig<DocStartupConfigurations, DocRuntimeConfigurations>;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
type EventPayload,
|
||||
metrics,
|
||||
OnEvent,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { PgWorkspaceDocStorageAdapter } from './adapters/workspace';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Config,
|
||||
mergeUpdatesInApplyWay as yotcoMergeUpdates,
|
||||
metrics,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { PermissionService } from '../permission';
|
||||
import { QuotaService } from '../quota';
|
||||
import { DocStorageOptions as IDocStorageOptions } from './storage';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
UndoManager,
|
||||
} from 'yjs';
|
||||
|
||||
import { CallMetric } from '../../../fundamentals';
|
||||
import { CallMetric } from '../../../base';
|
||||
import { Connection } from './connection';
|
||||
import { SingletonLocker } from './lock';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PrismaTransaction } from '../../fundamentals';
|
||||
import { PrismaTransaction } from '../../base';
|
||||
import { Feature, FeatureSchema, FeatureType } from './types';
|
||||
|
||||
class FeatureConfig<T extends FeatureType> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { Config, type EventPayload, OnEvent } from '../../fundamentals';
|
||||
import { Config, type EventPayload, OnEvent } from '../../base';
|
||||
import { UserService } from '../user/service';
|
||||
import { FeatureService } from './service';
|
||||
import { FeatureType } from './types';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from '@nestjs/graphql';
|
||||
import { difference } from 'lodash-es';
|
||||
|
||||
import { Config } from '../../fundamentals';
|
||||
import { Config } from '../../base';
|
||||
import { Admin } from '../common';
|
||||
import { UserType } from '../user/types';
|
||||
import { EarlyAccessType, FeatureManagementService } from './management';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
import { CannotDeleteAllAdminAccount } from '../../fundamentals';
|
||||
import { CannotDeleteAllAdminAccount } from '../../base';
|
||||
import { WorkspaceType } from '../workspaces/types';
|
||||
import { FeatureConfigType, getFeature } from './feature';
|
||||
import { FeatureKind, FeatureType } from './types';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
PrismaTransaction,
|
||||
SpaceAccessDenied,
|
||||
SpaceOwnerNotFound,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { FeatureKind } from '../features/types';
|
||||
import { QuotaType } from '../quota/types';
|
||||
import { Permission, PublicPageMode } from './types';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { pick } from 'lodash-es';
|
||||
|
||||
import { PrismaTransaction } from '../../fundamentals';
|
||||
import { PrismaTransaction } from '../../base';
|
||||
import { formatDate, formatSize, Quota, QuotaSchema } from './types';
|
||||
|
||||
const QuotaCache = new Map<number, QuotaConfig>();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
import type { EventPayload } from '../../fundamentals';
|
||||
import { OnEvent, PrismaTransaction } from '../../fundamentals';
|
||||
import type { EventPayload } from '../../base';
|
||||
import { OnEvent, PrismaTransaction } from '../../base';
|
||||
import { FeatureManagementService } from '../features/management';
|
||||
import { FeatureKind } from '../features/types';
|
||||
import { QuotaConfig } from './quota';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { MemberQuotaExceeded } from '../../fundamentals';
|
||||
import { MemberQuotaExceeded } from '../../base';
|
||||
import { FeatureService, FeatureType } from '../features';
|
||||
import { PermissionService } from '../permission';
|
||||
import { WorkspaceBlobStorage } from '../storage';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
InternalServerError,
|
||||
Mutex,
|
||||
PasswordRequired,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { AuthService, Public } from '../auth';
|
||||
import { ServerService } from '../config';
|
||||
import { UserService } from '../user/service';
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Application } from 'express';
|
||||
import { static as serveStatic } from 'express';
|
||||
import isMobile from 'is-mobile';
|
||||
|
||||
import { Config } from '../../fundamentals';
|
||||
import { Config } from '../../base';
|
||||
import { SetupMiddleware } from './setup';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineStartupConfig, ModuleConfig } from '../../fundamentals/config';
|
||||
import { StorageProviderType } from '../../fundamentals/storage';
|
||||
import { defineStartupConfig, ModuleConfig } from '../../base/config';
|
||||
import { StorageProviderType } from '../../base/storage';
|
||||
|
||||
export type StorageConfig<Ext = unknown> = {
|
||||
provider: StorageProviderType;
|
||||
@@ -14,7 +14,7 @@ export interface StorageStartupConfigurations {
|
||||
blob: StorageConfig;
|
||||
}
|
||||
|
||||
declare module '../../fundamentals/config' {
|
||||
declare module '../../base/config' {
|
||||
interface AppConfig {
|
||||
storages: ModuleConfig<StorageStartupConfigurations>;
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ import type {
|
||||
EventPayload,
|
||||
PutObjectMetadata,
|
||||
StorageProvider,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
import {
|
||||
Config,
|
||||
OnEvent,
|
||||
StorageProviderFactory,
|
||||
URLHelper,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
|
||||
@Injectable()
|
||||
export class AvatarStorage {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
PutObjectMetadata,
|
||||
type StorageProvider,
|
||||
StorageProviderFactory,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
|
||||
@Injectable()
|
||||
export class WorkspaceBlobStorage {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
NotInSpace,
|
||||
SpaceAccessDenied,
|
||||
VersionRejected,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { CurrentUser } from '../auth';
|
||||
import {
|
||||
DocStorageAdapter,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Controller, Get, Param, Res } from '@nestjs/common';
|
||||
import type { Response } from 'express';
|
||||
|
||||
import { ActionForbidden, UserAvatarNotFound } from '../../fundamentals';
|
||||
import { ActionForbidden, UserAvatarNotFound } from '../../base';
|
||||
import { Public } from '../auth/guard';
|
||||
import { AvatarStorage } from '../storage';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
type FileUpload,
|
||||
Throttle,
|
||||
UserNotFound,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { Public } from '../auth/guard';
|
||||
import { sessionUser } from '../auth/service';
|
||||
import { CurrentUser } from '../auth/session';
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
OnEvent,
|
||||
WrongSignInCredentials,
|
||||
WrongSignInMethod,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { PermissionService } from '../permission';
|
||||
import { Quota_FreePlanV1_1 } from '../quota/schema';
|
||||
import { validators } from '../utils/validators';
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@nestjs/graphql';
|
||||
import type { User } from '@prisma/client';
|
||||
|
||||
import type { Payload } from '../../fundamentals/event/def';
|
||||
import type { Payload } from '../../base/event/def';
|
||||
import { type CurrentUser } from '../auth/session';
|
||||
|
||||
@ObjectType()
|
||||
@@ -92,7 +92,7 @@ export class ManageUserInput {
|
||||
name?: string;
|
||||
}
|
||||
|
||||
declare module '../../fundamentals/event/def' {
|
||||
declare module '../../base/event/def' {
|
||||
interface UserEvents {
|
||||
admin: {
|
||||
created: Payload<{ id: string }>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import z from 'zod';
|
||||
|
||||
import { InvalidEmail, InvalidPasswordLength } from '../../fundamentals';
|
||||
import { InvalidEmail, InvalidPasswordLength } from '../../base';
|
||||
|
||||
export function assertValidEmail(email: string) {
|
||||
const result = z.string().email().safeParse(email);
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
DocHistoryNotFound,
|
||||
DocNotFound,
|
||||
InvalidHistoryTimestamp,
|
||||
} from '../../fundamentals';
|
||||
} from '../../base';
|
||||
import { CurrentUser, Public } from '../auth';
|
||||
import { PgWorkspaceDocStorageAdapter } from '../doc';
|
||||
import { Permission, PermissionService, PublicPageMode } from '../permission';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
Resolver,
|
||||
} from '@nestjs/graphql';
|
||||
|
||||
import { ActionForbidden } from '../../fundamentals';
|
||||
import { ActionForbidden } from '../../base';
|
||||
import { CurrentUser } from '../auth';
|
||||
import { Admin } from '../common';
|
||||
import { FeatureManagementService, FeatureType } from '../features';
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
} from '@nestjs/graphql';
|
||||
import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs';
|
||||
|
||||
import type { FileUpload } from '../../../fundamentals';
|
||||
import { BlobQuotaExceeded, CloudThrottlerGuard } from '../../../fundamentals';
|
||||
import type { FileUpload } from '../../../base';
|
||||
import { BlobQuotaExceeded, CloudThrottlerGuard } from '../../../base';
|
||||
import { CurrentUser } from '../../auth';
|
||||
import { Permission, PermissionService } from '../../permission';
|
||||
import { QuotaManagementService } from '../../quota';
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
ExpectToPublishPage,
|
||||
ExpectToRevokePublicPage,
|
||||
PageIsNotPublic,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
import { CurrentUser } from '../../auth';
|
||||
import {
|
||||
Permission,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Injectable, Logger } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { getStreamAsBuffer } from 'get-stream';
|
||||
|
||||
import { Cache, MailService } from '../../../fundamentals';
|
||||
import { Cache, MailService } from '../../../base';
|
||||
import { DocContentService } from '../../doc-renderer';
|
||||
import { PermissionService } from '../../permission';
|
||||
import { WorkspaceBlobStorage } from '../../storage';
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
RequestMutex,
|
||||
TooManyRequest,
|
||||
URLHelper,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
import { CurrentUser } from '../../auth';
|
||||
import { Permission, PermissionService } from '../../permission';
|
||||
import { QuotaManagementService } from '../../quota';
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { PrismaClient, WorkspaceMemberStatus } from '@prisma/client';
|
||||
import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs';
|
||||
|
||||
import type { FileUpload } from '../../../fundamentals';
|
||||
import type { FileUpload } from '../../../base';
|
||||
import {
|
||||
AlreadyInSpace,
|
||||
Cache,
|
||||
@@ -30,7 +30,7 @@ import {
|
||||
TooManyRequest,
|
||||
UserFriendlyError,
|
||||
UserNotFound,
|
||||
} from '../../../fundamentals';
|
||||
} from '../../../base';
|
||||
import { CurrentUser, Public } from '../../auth';
|
||||
import { type Editor, PgWorkspaceDocStorageAdapter } from '../../doc';
|
||||
import { Permission, PermissionService } from '../../permission';
|
||||
|
||||
Reference in New Issue
Block a user