Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions adminforth/types/adapters/StorageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ export interface StorageAdapter {
* @returns A promise that resolves to a string containing the data URL
*/
getKeyAsDataURL(key: string): Promise<string>;

/**
* Determines whether the given URL points to a resource managed by this storage adapter.
* * This method is important for plugins (such as MarkdownPlugin) to distinguish between
* "own" resources (stored in your S3 bucket or local storage) and external links * (such as images from Unsplash or Google).
* * The implementation logic typically includes:
* 1. Checking whether the hostname of the URL matches the configured bucket domain or custom CDN.
* 2. Checking whether the URL path contains the adapter's specific download prefix.
* * @param url - The full URL string to check (can be a public URL or a pre-signed URL).
* @returns A promise that returns true if the URL belongs to this adapter, false otherwise.
*/
isInternalUrl (url: string): Promise<boolean>;
}