Adds tests for src/core/Utils
Ports translator tests to jest
Adds tests for core/index
Added code coverage report
Adds tests for core/UppySocket
Adds tests to src/core and cleanup of test directory
Switched from import to require as the project supports node v4
Runs tests using Babel for backwards compatibilty
Adds src/core state tests
Adds src/core reset & close tests
Updates stagnant snapshot
Adds tests for preprocessors and postprocessors in src/core/Core.js
Adds tests for uploaders and metadata in src/core/Core
Adds tests for adding and removing files in src/core/Core
Adds test for getFile
Each upload() now generates a unique ID and stores the relevant file IDs
in state. It now also keeps track of which `step` in the 'pipeline' the
upload is at.
Since uploads are now stored in state, I added two methods to manage
them:
- `createUpload(fileIDs)` to create a new upload. It returns the unique
ID for the upload.
- `removeUpload(uploadID)` to remove an upload, because it was
completed or canceled.
I split off the 'pipeline' logic from the `upload()` method, into a new
private method `runUpload(uploadID)`, and added a `restore(uploadID)`
method that can be used to continue a preexisting upload. `runUpload()`
continues at the `step` stored in state.
The Golden Retriever loops through the existing uploads from the
restored state and `restore(uploadID)`s each of them.
This speeds up the UI a ton by not reconciling every time if state
is updated frequently. For example, when adding 20 files at once,
previously the UI would reconcile after adding each file, which took
a few ms each time. Especially on a not-supercomputer that could
easily hang the UI for a second or more.
This way the UI reconciliation is sort of detached from the state
updates, and only reconciles up to 60 times per second. In the bulk file
adding case, it only reconciles once after all files have been added.
* transloadit: Add barebones base plugin.
* tus: Add `uninstall` method.
* transloadit: Implement creating assemblies and hacky tus-uploading.
* transloadit: Add test file (Just checking options errors for now)
* transloadit: Link to templates overview page in `templateId` error.
* transloadit: Use dynamic tus endpoint from assembly result.
* core: Implement uploader pre- and postprocessors and async flow.
* tus: Merge in tus options from `file` objects.
This will allow preprocessor plugins to configure tus uploads.
* transloadit: Implement as a `preprocessor` handler.
* transloadit: Add status socket connection.Add `wait` option to wait for assembly to finish before resolving.
* dashboard: Log errors to console if the upload fails at any point.
* transloadit: Add `waitForEncoding`, `waitForMetadata` options instead of just `wait`.
* transloadit: Merge in params from `params` option when creating an assembly.
* transloadit: Docc why we set the `file.meta` property.
* transloadit: Support the API key being passed in via `params.auth.key`.
This way developers can dump a JSON payload for transloadit into the
`params` option. That'd be especially useful for `signature`s.
* transloadit: Only add `template_id` param to assembly if a `templateId` option is given.
* transloadit: Add a `signature` pass-thru option.
* transloadit: Remove `key` and `templateId` options--use `params` instead.
* Transloadit: Throw a useful error when `params` is an invalid JSON string.
* Transloadit: Check for existence of `params` before validity.
* Transloadit: Fix adding post-processor.
* Transloadit: No need to get assembly status after creating one.
* Transloadit: Add logs in a few places
* Transloadit: Get assembly status after upload is complete.
It's unused for now, but we should use eg. the results status to
provide feedback, especially if the assembly failed. Maybe the
`uploads` key in the result will also contain useful data if the
uploads fail?
* Transloadit: Add a pass-thru `fields` option…
This one should be runtime-configurable in some other way too.
Maybe by passing a <form /> element, or with the MetaData plugin…
* Transloadit: Always connect to the assembly status socket.
* Transloadit: Emit a `transloadit:result` event for assembly results.
But only when `waitForEncoding` is true!
* transloadit: Some doc comments for the main classes