Addressingtypeno test imports ittype Addressing = "path" | "virtual";How a bucket is written in a URL.
The client of a bucket: it builds the URL of a request (path style, host/bucket/key, or virtual-hosted style, bucket.host/key, each key encoded as RFC 3986 says), signs it with Signature Version 4 of @intellectual-frontiers/crypto for the service s3 (the payload's SHA-256 is signed on a connection that is not encrypted, and not signed on one that is, where UNSIGNED-PAYLOAD is allowed), sends it through a transport, and gives the answer if its status is a success and the failure S3 describes if it is not. It holds no state but the keys, which it asks its source for each time (a source remembers them as long as they last), and it never writes a key, a signature or a header that carries one.
import { parseEndpoint } from "./client.ts";
const e = parseEndpoint("http://127.0.0.1:9000");
e.kind === "ok" && e.value.host; // "127.0.0.1"Addressingtypeno test imports ittype Addressing = "path" | "virtual";How a bucket is written in a URL.
awsEndpointconstno test imports itconst awsEndpoint: (region: string) => EndpointThe endpoint of Amazon S3 in a region.
CallErrortypeno test imports ittype CallError = { readonly kind: "transport"; readonly message: string } | { readonly kind: "credentials"; readonly message: string } | { readonly kind: "failure"; readonly failure: Failure };Why a call has no answer that succeeded.
Endpointtypeno test imports ittype Endpoint = { readonly scheme: "http" | "https"; readonly host: string; readonly port?: number };Where a service listens.
failureOffunctionno test imports itfunction failureOf(response: HttpResponse): FailureThe failure an answer that is not a success stands for.
makeClientfunctionfunction makeClient(options: ClientOptions): S3ClientThe client of a bucket.
parseEndpointfunctionfunction parseEndpoint(text: string): Result<Endpoint, string>An endpoint from a URL with no path, query or credentials.
PayloadSigningtypeno test imports ittype PayloadSigning = "auto" | "signed" | "unsigned";Whether the SHA-256 of a body is signed.
S3Clienttypeno test imports ittype S3Client = {
readonly bucket: BucketName;
readonly endpoint: Endpoint;
readonly addressing: Addressing;
/** The URL a call would be sent to, with nothing signed. */
readonly urlOf: (call: Call) => string;
/** The answer to a call if its status is 2xx, and the reason it is not one otherwise. */
readonly send: (call: Call) => Promise<Result<HttpResponse, CallError>>;
};The client of one bucket.