Kind: Class
Source: atloria-monorepo/libs/parser-core/src/storage/cloud-storage.provider.ts
Cloud storage provider implementation
Implements: IStorageProvider
Methods
| Method | Signature | Returns |
|---|---|---|
getMode | getMode() | StorageMode |
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
CloudStorageProviderstops the work withErrorwhen!config?.apiBaseUrl— “CloudStorageProvider requires a non-empty apiBaseUrl”.CloudStorageProviderstops the work withErrorwhen!config.projectId— “CloudStorageProvider requires a non-empty projectId”.CloudStorageProviderstops the work with an early return when!categoryId, in 2 places.CloudStorageProviderstops the work with an early return whenexisting.CloudStorageProviderstops the work with an early return when!category.
When something fails
CloudStorageProviderhandles failure in 5 places: it turns it into a return value in all 5.
Was this page helpful?