const HasLog = require('./HasLog')
const Privatize = require('@stamp/privatize')
const FileStore = HasLog.compose(Privatize, {
S3: require('aws-sdk').S3
init({ bucket }, { stamp }) {
this.s3instance = new this.S3({
apiVersion: '2006-03-01',
params: { Bucket: bucket || stamp.compose.configuration.bucket }
upload({ fileName, stream }) {
this.log.info({ fileName }, 'Uploading file')
return this.s3instance.upload({ Key: fileName, Body: stream }).promise()
bucket: process.env.UPLOAD_BUCKET
setDefaultBucket(bucket) {
return this.conf({ bucket })