@jackdbd/r2-media-store
Version:
Store Micropub media in a Cloudflare R2 bucket.
58 lines • 1.52 kB
TypeScript
import { type Log } from './log.js';
export interface Credentials {
accessKeyId: string;
secretAccessKey: string;
}
export interface Config {
/**
* You Cloudflare account ID.
*/
account_id: string;
/**
* The name of your Cloudflare R2 bucket.
*/
bucket_name: string;
/**
* The base path on the bucket where you want to upload files to (e.g. media/).
*/
bucket_prefix?: string;
credentials: Credentials;
ignore_filename?: boolean;
log?: Log;
/**
* The base URL at which your files will be publicly accessible.
*
* @see https://developers.cloudflare.com/r2/buckets/public-buckets/
*/
public_base_url: string;
}
/**
* Allows to upload files to a Cloudflare R2 bucket (R2 implements the S3 API).
*
* @see [S3 API compatibility](https://developers.cloudflare.com/r2/api/s3/api/)
*/
export declare const defR2: (config: Config) => {
delete: (param_0: string) => Promise<{
details?: string[] | undefined;
summary: string;
}>;
info: {
account_id: string;
name: string;
bucket_name: string;
bucket_prefix: string;
endpoint: string;
ignore_filename: boolean;
public_base_url: string;
};
upload: (param_0: {
body: any;
contentType: string;
filename: string;
}) => Promise<{
details?: string[] | undefined;
summary: string;
url: string;
}>;
};
//# sourceMappingURL=client.d.ts.map