CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-aws-sdk--client-sts

AWS SDK for JavaScript STS Client for Node.js, Browser and React Native, providing temporary security credentials and role assumption capabilities

92

1.05x

Evaluation92%

1.05x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-3/

Request Compression Utility

A utility module for uploading large data payloads to AWS services with automatic compression to reduce bandwidth usage and improve performance.

Capabilities

Upload large data with compression

  • When uploading data larger than 10KB to an S3 bucket, the request body is automatically compressed. @test
  • When uploading data smaller than 10KB to an S3 bucket, the request is sent without compression. @test

Configure compression threshold

  • The compression threshold can be customized to a different value than the default. @test

Verify compression headers

  • When compression is enabled and data exceeds the threshold, the appropriate content encoding header is set. @test

Implementation

@generates

Your implementation should:

  • Create an S3 client configured to use request compression
  • Provide a function to upload data to S3 with automatic compression based on payload size
  • Allow configuration of the compression threshold
  • Support uploading to a specified bucket and key

API

/**
 * Configuration options for the uploader
 */
export interface UploaderConfig {
  region: string;
  bucket: string;
  compressionThreshold?: number; // Size in bytes, defaults to 10240 (10KB)
}

/**
 * Creates an uploader instance with the specified configuration
 */
export function createUploader(config: UploaderConfig): Uploader;

/**
 * Uploader interface for uploading data to S3
 */
export interface Uploader {
  /**
   * Uploads data to S3 with automatic compression for large payloads
   * @param key - The S3 object key
   * @param data - The data to upload (string or Buffer)
   * @returns Promise that resolves when upload is complete
   */
  upload(key: string, data: string | Buffer): Promise<void>;
}

Dependencies { .dependencies }

@aws-sdk/client-s3 { .dependency }

AWS SDK S3 client for uploading data to S3 with request compression support.

Install with Tessl CLI

npx tessl i tessl/npm-aws-sdk--client-sts

tile.json