Kind: Class
Source: atloria-monorepo/libs/parser-core/src/storage/file-system-storage.provider.ts
File system storage provider implementation
Implements: IStorageProvider
Methods
| Method | Signature | Returns |
|---|---|---|
getMode | getMode() | StorageMode |
initialize | initialize() | Promise<void> |
saveScreenshot | saveScreenshot(buffer: Buffer, metadata: ScreenshotMetadata) | Promise<ScreenshotSaveResult> |
findExistingScreenshot | findExistingScreenshot(metadata: Partial<ScreenshotMetadata>) | `Promise<ScreenshotSaveResult |
saveDocument | saveDocument(document: DocumentMetadata) | Promise<DocumentSaveResult> |
documentExists | documentExists(_projectId: string, categoryPath: string[], slug: string) | Promise<boolean> |
listDocuments | listDocuments(_projectId: string, categoryPath: string[]) | Promise<Array<{ id: string; title: string; slug: string; url: string }>> |
Where it refuses work
FileSystemStorageProviderstops the work with an early return whenexisting.FileSystemStorageProviderstops the work with an early return whenquery.projectId && stored.projectId !== query.projectId.FileSystemStorageProviderstops the work with an early return whenquery.url && stored.url !== query.url.FileSystemStorageProviderstops the work with an early return whenstored.viewport.width !== query.viewport.width || stored.viewport.height !== query.viewpo….FileSystemStorageProviderstops the work with an early return whenquery.stateType && stored.stateType !== query.stateType.FileSystemStorageProviderstops the work with an early return whenquery.flowStepId && stored.flowStepId !== query.flowStepId.
When something fails
FileSystemStorageProviderhandles failure in 5 places: it turns it into a return value in 3, and discards it silently in 2. A failure discarded silently leaves no trace for whoever debugs this later.
Was this page helpful?