S3 API reference
Exports of @anymux/s3. Back to the module
Classes
S3ObjectStorage
classclass S3ObjectStorage
constructor
constructorconstructor(config: S3Config): S3ObjectStorage
listBuckets
methodlistBuckets(): Promise<BucketInfo[]>
createBucket
methodcreateBucket(name: string): Promise<void>
deleteBucket
methoddeleteBucket(name: string): Promise<void>
bucketExists
methodbucketExists(name: string): Promise<boolean>
getObject
methodgetObject(bucket: string, key: string): Promise<Buffer>
putObject
methodputObject(bucket: string, key: string, data: Buffer | Uint8Array | string, options?: PutObjectOptions): Promise<void>
deleteObject
methoddeleteObject(bucket: string, key: string): Promise<void>
headObject
methodheadObject(bucket: string, key: string): Promise<ObjectMetadata>
copyObject
methodcopyObject(sourceBucket: string, sourceKey: string, destBucket: string, destKey: string): Promise<void>
listObjects
methodlistObjects(bucket: string, options?: ListObjectsOptions): Promise<ListObjectsResult>
getPresignedUrl
methodgetPresignedUrl(bucket: string, key: string, options?: PresignedUrlOptions): Promise<string>
objectExists
methodobjectExists(bucket: string, key: string): Promise<boolean>
S3Provider
classclass S3Provider
id
propertyid: string
name
propertyname: "Amazon S3"
capabilities
propertycapabilities: readonly CapabilityType[]
constructor
constructorconstructor(options: S3ProviderOptions): S3Provider
getCapability
method<T>(type: CapabilityType): T | undefined
hasCapability
methodhasCapability(type: CapabilityType): boolean
Types
S3Config
typetype S3Config = { region?: string; endpoint?: string; credentials?: { accessKeyId?: string; secretAccessKey?: string; }; forcePathStyle?: boolean; bucket?: string; }Interfaces
S3ProviderOptions
interfaceinterface S3ProviderOptions
id
propertyid: string
config
propertyconfig: { region?: string; endpoint?: string; credentials?: { accessKeyId?: string; secretAccessKey?: string; }; forcePathStyle?: boolean; bucket?: string; }Constants
S3ConfigSchema
constconst S3ConfigSchema: z.ZodObject<{ region: z.ZodString; endpoint: z.ZodOptional<z.ZodString>; credentials: z.ZodOptional<z.ZodObject<{ accessKeyId: z.ZodString; secretAccessKey: z.ZodString; }, "strip", z.ZodTypeAny, { accessKeyId?: string; secretAccessKey?: string; }, { accessKeyId?: string; secretAccessKey?: string; }>>; forcePathStyle: z.ZodOptional<z.ZodBoolean>; bucket: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { region?: string; endpoint?: string; credentials?: { accessKeyId?: string; secretAccessKey?: string; }; forcePathStyle?: boolean; bucket?: string; }, { region?: string; endpoint?: string; credentials?: { accessKeyId?: string; secretAccessKey?: string; }; forcePathStyle?: boolean; bucket?: string; }>