aws-s3@1.0.0
This adaptor exports the following from common:
- as()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- scrubEmojis()
- sourceValue()
- util
Functions
get
get(params) ⇒ Operation
Get an object from S3.
Attempts to parse JSON objects automatically into state.data. For binary
objects the adaptor returns base64 in state.data.base64.
Returns: Operation - - A function that takes the state and performs the get operation.
| Param | Type | Description |
|---|---|---|
| params | S3Params | The S3 operation parameters (bucket, key). |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| state | On success sets state.data to the parsed body (or { base64: '...' }) and state.response to the raw response metadata. |
Example
get({ bucket: 'my-bucket', key: 'path/to/file.txt' });
list
list(params) ⇒ Operation
List objects in a bucket (by prefix).
Returns: Operation - - A function that takes the state and performs the list operation.
| Param | Type | Description |
|---|---|---|
| params | S3Params | The S3 operation parameters (bucket, prefix, etc.) |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| state | On success sets state.data to the list of objects and state.response to the raw S3 response metadata. |
Example
list({ bucket: 'my-bucket', prefix: 'path/to/' });
put
put(params) ⇒ Operation
Put an object into S3.
Returns: Operation - - A function that takes the state and performs the put operation.
| Param | Type | Description |
|---|---|---|
| params | S3Params | The S3 operation parameters (bucket. key, body, contentType, etc.) |
Example
put({ bucket: 'my-bucket', key: 'path/to/file.txt', body: 'hello' });
Interfaces
S3Params
S3 operation input params used by put, get, and list.
Properties
| Name | Type | Description |
|---|---|---|
| key | string | Object key for put/get (required for those ops) |
| [body] | any | Body for put (string, Buffer, or stream) |
| [bucket] | string | S3 bucket name (overrides configuration value) |
| [contentType] | string | Optional content type for put |
| [prefix] | string | Prefix for list operation |
| [maxKeys] | number | Max keys for list |
| [continuationToken] | string | Continuation token for list pagination |