MCPcopy Index your code
hub / github.com/simstudioai/sim / buildObjectPath

Function buildObjectPath

apps/sim/connectors/s3/s3.ts:237–240  ·  view source on GitHub ↗

* Builds the canonical URI for an object key. * * AWS (virtual-hosted-style): `/{key}` — the bucket lives in the host. * Custom endpoint (path-style): `/{bucket}/{key}` — the bucket is the first * path segment. Both the bucket and key are percent-encoded per AWS UriEncode * rules while preservi

(ctx: S3Context, key: string)

Source from the content-addressed store, hash-verified

235 * rules while preserving `/` separators via {@link encodeS3PathComponent}.
236 */
237function buildObjectPath(ctx: S3Context, key: string): string {
238 const encodedKey = encodeS3PathComponent(key)
239 return ctx.endpoint ? `/${encodeS3PathComponent(ctx.bucket)}/${encodedKey}` : `/${encodedKey}`
240}
241
242/**
243 * Builds the canonical URI for a bucket-level (ListObjectsV2) request.

Callers 2

objectToStubFunction · 0.85
s3.tsFile · 0.85

Calls 1

encodeS3PathComponentFunction · 0.90

Tested by

no test coverage detected