minio@1.0.0
- createBucket(bucketName, [region], [options])
- getObject(bucketName, objectName, [options])
- getObjectTags(bucketName, objectName)
- listObjects(bucketName, [options])
- putObject(bucketName, objectName, data, [options])
- setObjectTags(bucketName, objectName, tags, [putOpts])
This adaptor exports the following from common:
- as()
- combine()
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- lastReferenceValue()
- map()
- merge()
- parseCsv()
- scrubEmojis()
- sourceValue()
- util
Functions
createBucket
createBucket(bucketName, [region], [options]) ⇒ Operation
Create a new bucket
| Param | Type | Default | Description |
|---|---|---|---|
| bucketName | string | Name of the bucket to create | |
| [region] | string | ""us-east-1"" | Bucket region |
| [options] | object | {} | Options to create a bucket |
| [options.ObjectLocking] | boolean | false | Enable object locking on the bucket |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Create a bucket
createBucket("my-new-bucket");
Example: Create a bucket with object locking enabled
createBucket("my-new-bucket", "us-east-1", { ObjectLocking: true });
getObject
getObject(bucketName, objectName, [options]) ⇒ Operation
Get an object from a bucket
| Param | Type | Default | Description |
|---|---|---|---|
| bucketName | string | Bucket containing the object | |
| objectName | string | Name/path of the object to retrieve | |
| [options] | object | {} | Optional MinIO getObject options |
| [options.format] | string | ""raw"" | Format to parse the object as. One of "raw", "json", "ndjson", or "csv". "raw" will return a Buffer, while the others will return the parsed result. |
| [options.destination] | string | Path to write the parsed result to in the state object. If not provided, the parsed result will be written to state.data. |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Get an object and write to response
getObject("dlite",'f0dd6f01-a60c-5558-b53e-188eaf62a8de', { destination: 'response' });
Example: Get an object and parse it as JSON
getObject("dlite",'f0dd6f01-a60c-5558-b53e-188eaf62a8de', { format: 'json' });
getObjectTags
getObjectTags(bucketName, objectName) ⇒ Operation
Get tags on an existing object in a MinIO bucket
| Param | Type | Description |
|---|---|---|
| bucketName | string | Bucket containing the object |
| objectName | string | Name/path of the object |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example
getObjectTags("my-bucket", "records/patient-001.json");
listObjects
listObjects(bucketName, [options]) ⇒ Operation
List objects in a bucket
| Param | Type | Default | Description |
|---|---|---|---|
| bucketName | string | Bucket to list objects from | |
| [options] | object | {} | Optional list filters |
| [options.prefix] | string | """" | Prefix used to filter object names |
| [options.recursive] | boolean | true | Whether to list objects recursively. Defaults to true |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: List objects in a bucket
listObjects("my-bucket", { prefix: "openmrs/2025-04/", recursive: true });
putObject
putObject(bucketName, objectName, data, [options]) ⇒ Operation
Upload an object to a MinIO bucket
| Param | Type | Default | Description |
|---|---|---|---|
| bucketName | string | Destination bucket | |
| objectName | string | Name/path of the object to create or overwrite | |
| data | string | object | Buffer | Data to upload. Serialized according to options.format | |
| [options] | object | {} | Upload options |
| [options.format] | string | ""json"" | Serialization format: "json", "ndjson", "csv", or "raw" |
| [options.contentType] | string | MIME type. Auto-inferred from format if not provided | |
| [options.metadata] | object | {} | User-defined metadata headers (e.g. { "x-amz-meta-source": "openmrs" }) |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example: Upload a JSON object
putObject("my-bucket", "records/patient-001.json", state.data);
Example: Upload CSV data with custom metadata
putObject("my-bucket", "exports/report.csv", state.rows, { format: "csv", metadata: { "x-amz-meta-source": "openmrs" } });
setObjectTags
setObjectTags(bucketName, objectName, tags, [putOpts]) ⇒ Operation
Set tags on an existing object in a MinIO bucket
| Param | Type | Default | Description |
|---|---|---|---|
| bucketName | string | Bucket containing the object | |
| objectName | string | Name/path of the object to tag | |
| tags | object | Key-value pairs to apply as tags. Overwrites any existing tags. | |
| [putOpts] | object | {} | Extra put options (e.g. { versionId: "my-version-id" }) |
Example
setObjectTags("my-bucket", "records/patient-001.json", {
source: "openmrs",
status: "raw"
});
Example: Target a specific version
setObjectTags("my-bucket", "records/patient-001.json", { status: "processed" }, { versionId: "my-version-id" });
Interfaces
HttpState
State object
Properties
| Name | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |