DocReader (doc/reader.ts)

AFFiNE · packages/backend/server/src/core/doc/reader.ts · typescript · MIT
database, tag:embed-classified

Abstract base for reading documents from storage, offering parsing, markdown conversion, canvas projection, and diffing.

// Source: https://github.com/toeverything/AFFiNE | License: MIT | Copyright 2022-present TOEVERYTHING PTE. LTD. and its affiliates
// Provided via justclaw.it.com; keep this notice with the code.
import { Injectable, Logger } from '@nestjs/common';
import { diffUpdate, encodeStateVectorFromUpdate } from 'yjs';

import { Cache } from '../../base';
import { Models } from '../../models';
import { WorkspaceBlobStorage } from '../storage';
import {
  type CanvasProjectionV1,
  type PageDocContent,
  parseDocToMarkdownFromDocSnapshot,
  parsePageDoc,
  parseWorkspaceDoc,
  projectDocCanvas,
  type WorkspaceDocContent,
} from '../utils/blocksuite';
import { PgWorkspaceDocStorageAdapter } from './adapters/workspace';
import { type DocDiff, type DocRecord } from './storage';

const DOC_CONTENT_CAC

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key