diff --git a/packages/@uppy/aws-s3/LICENSE b/packages/@uppy/aws-s3/LICENSE new file mode 100644 index 000000000..c23747330 --- /dev/null +++ b/packages/@uppy/aws-s3/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Transloadit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/@uppy/aws-s3/README.md b/packages/@uppy/aws-s3/README.md new file mode 100644 index 000000000..e491280cf --- /dev/null +++ b/packages/@uppy/aws-s3/README.md @@ -0,0 +1,42 @@ +# @uppy/aws-s3 + +Uppy logo: a superman puppy in a pink suit + + +Build Status + +The AwsS3 plugin can be used to upload files directly to an S3 bucket. Uploads can be signed using Uppy Server or a custom signing function. + +Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service. + +## Example + +```js +const Uppy = require('@uppy/core') +const AwsS3 = require('@uppy/aws-s3') + +const uppy = Uppy() +uppy.use(AwsS3, { + limit: 2, + timeout: ms('1 minute'), + serverUrl: 'https://uppy-server.myapp.com/' +}) +``` + +## Installation + +```bash +$ npm install @uppy/aws-s3 --save +``` + +We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/). + +Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions. + +## Documentation + +Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/aws-s3). + +## License + +[The MIT License](./LICENSE). diff --git a/packages/@uppy/aws-s3/package.json b/packages/@uppy/aws-s3/package.json new file mode 100644 index 000000000..99a8b6f88 --- /dev/null +++ b/packages/@uppy/aws-s3/package.json @@ -0,0 +1,32 @@ +{ + "name": "@uppy/aws-s3", + "description": "Upload to Amazon S3 with Uppy", + "version": "0.25.5", + "license": "MIT", + "main": "lib/index.js", + "jsnext:main": "src/index.js", + "types": "types/index.d.ts", + "keywords": [ + "file uploader", + "aws s3", + "amazon s3", + "s3", + "uppy", + "uppy-plugin" + ], + "homepage": "https://uppy.io", + "bugs": { + "url": "https://github.com/transloadit/uppy/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/transloadit/uppy.git" + }, + "dependencies": { + "@uppy/utils": "^0.25.5", + "resolve-url": "^0.2.1" + }, + "peerDependencies": { + "@uppy/core": "^0.25.5" + } +} diff --git a/src/plugins/AwsS3/Multipart.js b/packages/@uppy/aws-s3/src/Multipart.js similarity index 100% rename from src/plugins/AwsS3/Multipart.js rename to packages/@uppy/aws-s3/src/Multipart.js diff --git a/src/plugins/AwsS3/MultipartUploader.js b/packages/@uppy/aws-s3/src/MultipartUploader.js similarity index 100% rename from src/plugins/AwsS3/MultipartUploader.js rename to packages/@uppy/aws-s3/src/MultipartUploader.js diff --git a/src/plugins/AwsS3/index.js b/packages/@uppy/aws-s3/src/index.js similarity index 99% rename from src/plugins/AwsS3/index.js rename to packages/@uppy/aws-s3/src/index.js index 04bfe407d..63a569aff 100644 --- a/src/plugins/AwsS3/index.js +++ b/packages/@uppy/aws-s3/src/index.js @@ -2,7 +2,7 @@ const resolveUrl = require('resolve-url') const Plugin = require('@uppy/core/lib/Plugin') const Translator = require('@uppy/utils/lib/Translator') const limitPromises = require('@uppy/utils/lib/limitPromises') -const XHRUpload = require('../XHRUpload') +const XHRUpload = require('@uppy/xhrupload') function isXml (xhr) { const contentType = xhr.headers ? xhr.headers['content-type'] : xhr.getResponseHeader('Content-Type') diff --git a/packages/@uppy/aws-s3/types/index.d.ts b/packages/@uppy/aws-s3/types/index.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/index.js b/src/index.js index 61ea41d78..f162f15c0 100644 --- a/src/index.js +++ b/src/index.js @@ -28,7 +28,7 @@ const Informer = require('@uppy/informer') const Tus = require('@uppy/tus') const XHRUpload = require('./plugins/XHRUpload') const Transloadit = require('./plugins/Transloadit') -const AwsS3 = require('./plugins/AwsS3') +const AwsS3 = require('@uppy/aws-s3') // Helpers and utilities const Form = require('@uppy/form')