ExtractionServiceDeps
@forge/monorepo / backend/src / ExtractionServiceDeps
Type Alias: ExtractionServiceDeps
ExtractionServiceDeps =
object
Defined in: backend/src/documents/extraction.ts:31
Properties
blobs
readonlyblobs:BlobStore
Defined in: backend/src/documents/extraction.ts:35
Where the extracted document goes. BlobStore stores JSON, which is what an ExtractedDocument is.
clock?
readonlyoptionalclock?: () =>string
Defined in: backend/src/documents/extraction.ts:59
Returns
string
content
readonlycontent:FileContentStore
Defined in: backend/src/documents/extraction.ts:33
dispatcher?
readonlyoptionaldispatcher?:ExtractionDispatcher
Defined in: backend/src/documents/extraction.ts:67
The queue. Optional, and its absence means extraction runs only when something calls extract directly.
Optional rather than required because a single-process deployment is a real configuration, and requiring a
queue there would mean standing up Redis to attach a text file. What is not optional is that upload
never blocks on extraction — that holds either way.
fallbackParsers?
readonlyoptionalfallbackParsers?: readonlyDocumentParser[]
Defined in: backend/src/documents/extraction.ts:46
Parsers to try when the primary one reports no-text-layer (#132).
Keyed by media type like parsers, and separate because the dispatch table holds one parser per type:
both the text-layer PDF parser and the OCR one claim application/pdf. This is where #131's insistence
that no-text-layer be its own reason becomes load-bearing — the fallback triggers on exactly that
answer and on nothing else. An encrypted or malformed document is not retried through OCR, because
OCR will not decrypt it and the second attempt would cost money to reach the same conclusion.
limits?
readonlyoptionallimits?:ExtractionLimits
Defined in: backend/src/documents/extraction.ts:58
log?
readonlyoptionallog?: (message,detail?) =>void
Defined in: backend/src/documents/extraction.ts:68
Parameters
message
string
detail?
Readonly<Record<string, unknown>>
Returns
void
metadata
readonlymetadata:FileMetadataStore
Defined in: backend/src/documents/extraction.ts:32
onPricedOperation?
readonlyoptionalonPricedOperation?: (input) =>Promise<void>
Defined in: backend/src/documents/extraction.ts:53
Bills a vision or OCR call (#132, AC-4).
A callback rather than a UsageRecorder, so documents does not depend on usage. The pipeline knows
when a priced operation happened; what it costs is the caller's pricing model.
Parameters
input
fileId
tenantId
usage
Returns
Promise<void>
parsers
readonlyparsers: readonlyDocumentParser[]
Defined in: backend/src/documents/extraction.ts:36