import { Bucket } from "@upstash/blob"; import type { Command } from "commander"; import type { Auth } from "../../auth.js"; import type { BlobBucket } from "../../types.js"; /** The bucket id a Blob token was issued for, read from the token itself. */ export declare function tokenBucketId(token: string): string | undefined; export declare function findAccountBucket(buckets: BlobBucket[], name: string): BlobBucket; /** * The id behind the bucket argument of get, delete and credentials. The hidden --bucket-id flag * they used to require is still accepted, and used as is. */ export declare function bucketIdArgument(command: Command, bucket: string | undefined, flags: { bucketId?: string; }): Promise; /** * Turns the bucket part of a blob:// URI into a Bucket. A Blob token is used only for the bucket it * was issued for, matched by id; anything else is looked up by name or id with account credentials, * so a stray UPSTASH_BLOB_TOKEN in .env never redirects a command to another bucket. */ export declare class BucketResolver { private readonly command; private readonly token?; private readonly buckets; private accountBuckets?; constructor(command: Command, token?: string | undefined); open(name: string): Promise; auth(): Auth; listAccountBuckets(): Promise; private resolve; private bucket; } export interface ListedObject { key: string; size: number; last_modified: string; etag: string; } export interface DirectoryPage { prefixes: string[]; objects: ListedObject[]; cursor?: string; } /** * One page of a delimiter listing: the keys directly under `prefix` and the "folders" below it. * The SDK's list() has no delimiter, so this signs its own ListObjectsV2 with the bucket's * refreshing S3 credentials. */ export declare function listDirectory(bucket: Bucket, prefix: string, cursor?: string): Promise; //# sourceMappingURL=buckets.d.ts.map