Files
cypress/scripts/binary/s3-api-demo.ts
Ben Kucera fbd523615e [internal] Lint typescript, json, new eslint rules (#4449)
* temp 07/01/19 [skip ci] main lint files

* use lint-staged scripts

* fix all auto-fixable eslint errors

* manually fix lint issues in files

* temp 07/01/19 [skip ci]

* bump eslint plugin versions, update circle.yml

* [lint fix] remaining js files

* update vscode/settings.json

* add back stop-only

* use stop-only for linting .onlys

* fix verify_spec, build_spec

* update json plugin

* relint & apply corrections

* fix appveyor.yml not cleansing env vars (very bad)

* dont echo commit message in appveyor script

* retry build &

* re-add & upgrade lint-staged

* update contributing docs

* only let stop-only catch staged changes
2019-07-12 13:59:44 -04:00

22 lines
627 B
TypeScript

// ignore TS errors - we are importing from CoffeeScript files
// @ts-ignore
import uploadUtils from './util/upload'
import { s3helpers } from './s3-api'
const aws = uploadUtils.getS3Credentials()
const s3 = s3helpers.makeS3(aws)
const bucket = aws.bucket
const key = 'beta/binary/3.3.0/darwin-x64/circle-develop-455046b928c861d4457b2ec5426a51de1fda74fd-102212/cypress.zip'
/*
a little demo showing how user metadata can be set and read on a S3 object.
*/
s3helpers.setUserMetadata(bucket, key, {
user: 'bar',
}, s3)
.then(() => {
return s3helpers.getUserMetadata(bucket, key, s3)
}).then(console.log, console.error)