From 34c78e909399a6268e7218d21c2955d1d11cf8d1 Mon Sep 17 00:00:00 2001
From: Antoine du Hamel
Date: Fri, 29 Sep 2023 10:11:28 +0100
Subject: [PATCH] meta: run Prettier on existing files (#4713)
---
.github/ISSUE_TEMPLATE/1-bug.yml | 13 +-
.github/ISSUE_TEMPLATE/2-feature.yml | 13 +-
.github/stale.yml | 4 +-
.github/workflows/bundlers.yml | 50 +-
.github/workflows/ci.yml | 20 +-
.github/workflows/companion-deploy.yml | 12 +-
.github/workflows/companion.yml | 8 +-
.github/workflows/e2e.yml | 36 +-
.github/workflows/linters.yml | 14 +-
.github/workflows/lockile_check.yml | 7 +-
.github/workflows/manual-cdn.yml | 7 +-
.github/workflows/release-candidate.yml | 20 +-
.github/workflows/release.yml | 49 +-
.stylelintrc.json | 2 +-
.yarnrc.yml | 4 +-
docker-compose-dev.yml | 6 +-
docker-compose.yml | 4 +-
.../dashboard-aws-multipart/index.html | 2 +-
e2e/clients/dashboard-aws/index.html | 2 +-
e2e/clients/dashboard-compressor/index.html | 2 +-
e2e/clients/dashboard-transloadit/index.html | 2 +-
e2e/clients/dashboard-tus/index.html | 2 +-
e2e/clients/dashboard-ui/index.html | 2 +-
e2e/clients/dashboard-vue/App.vue | 6 +-
e2e/clients/dashboard-vue/index.html | 2 +-
e2e/clients/dashboard-xhr/index.html | 2 +-
e2e/clients/react/index.html | 2 +-
.../dashboard-aws-multipart.spec.ts | 188 ++++--
e2e/cypress/integration/dashboard-aws.spec.ts | 4 +-
.../integration/dashboard-compressor.spec.ts | 10 +-
.../integration/dashboard-transloadit.spec.ts | 405 ++++++++-----
e2e/cypress/integration/dashboard-tus.spec.ts | 8 +-
e2e/cypress/integration/dashboard-ui.spec.ts | 38 +-
e2e/cypress/integration/dashboard-vue.spec.ts | 8 +-
e2e/cypress/integration/dashboard-xhr.spec.ts | 15 +-
e2e/cypress/integration/react.spec.ts | 24 +-
e2e/cypress/integration/reusable-tests.ts | 14 +-
e2e/cypress/support/createFakeFile.ts | 17 +-
e2e/cypress/support/e2e.ts | 2 +-
examples/angular-example/.eslintrc.json | 12 +-
examples/angular-example/angular.json | 36 +-
.../src/app/app.component.html | 533 +++++++++++++++---
.../angular-example/src/app/app.component.ts | 69 ++-
.../angular-example/src/app/app.module.ts | 2 +-
examples/angular-example/src/index.html | 20 +-
examples/angular-example/src/main.ts | 5 +-
examples/angular-example/tsconfig.app.json | 8 +-
examples/angular-example/tsconfig.json | 5 +-
examples/angular-example/tsconfig.spec.json | 9 +-
examples/aws-companion/index.html | 6 +-
examples/aws-nodejs/public/drag.html | 93 +--
examples/aws-nodejs/public/index.html | 184 ++++--
examples/aws-php/composer.json | 10 +-
examples/aws-php/index.html | 8 +-
examples/bundled/index.html | 8 +-
examples/cdn-example/index.html | 36 +-
examples/custom-provider/index.html | 6 +-
examples/digitalocean-spaces/index.html | 9 +-
examples/multiple-instances/index.html | 10 +-
examples/node-xhr/index.html | 6 +-
examples/php-xhr/index.html | 6 +-
examples/python-xhr/index.html | 6 +-
examples/react-example/index.html | 8 +-
examples/react-native-expo/app.json | 4 +-
examples/redux/index.html | 6 +-
examples/svelte-example/public/global.css | 5 +-
examples/svelte-example/public/index.html | 23 +-
examples/svelte-example/tsconfig.json | 5 +-
examples/transloadit-markdown-bin/index.html | 61 +-
examples/transloadit/index.html | 112 ++--
.../uppy-with-companion/client/index.html | 31 +-
examples/vue/index.html | 2 +-
examples/vue/src/App.vue | 68 ++-
examples/vue3/index.html | 2 +-
examples/vue3/src/App.vue | 68 ++-
examples/xhr-bundle/index.html | 10 +-
packages/@uppy/angular/.eslintrc.json | 13 +-
packages/@uppy/angular/angular.json | 5 +-
.../projects/uppy/angular/.eslintrc.json | 12 +-
.../projects/uppy/angular/ng-package.json | 2 +-
.../projects/uppy/angular/src/public-api.ts | 20 +-
.../projects/uppy/angular/tsconfig.lib.json | 4 +-
.../projects/uppy/angular/tsconfig.spec.json | 9 +-
packages/@uppy/angular/tsconfig.json | 9 +-
packages/@uppy/audio/src/style.scss | 20 +-
.../@uppy/aws-s3-multipart/types/chunk.d.ts | 10 +-
.../@uppy/aws-s3-multipart/types/index.d.ts | 184 +++---
.../aws-s3-multipart/types/index.test-d.ts | 22 +-
packages/@uppy/aws-s3/types/index.d.ts | 52 +-
packages/@uppy/aws-s3/types/index.test-d.ts | 48 +-
packages/@uppy/box/types/index.d.ts | 11 +-
.../@uppy/companion-client/types/index.d.ts | 68 ++-
.../infra/kube/companion/companion-kube.yaml | 86 +--
packages/@uppy/companion/nodemon.json | 24 +-
.../companion/src/server/provider/error.d.ts | 5 +-
packages/@uppy/companion/tsconfig.json | 4 +-
packages/@uppy/compressor/types/index.d.ts | 4 +-
packages/@uppy/core/src/_common.scss | 20 +-
packages/@uppy/core/src/_utils.scss | 2 +-
packages/@uppy/core/src/_variables.scss | 7 +-
packages/@uppy/core/types/index.d.ts | 197 ++++---
packages/@uppy/core/types/index.test-d.ts | 36 +-
.../src/components/FileCard/index.scss | 8 +-
.../components/FileItem/Buttons/index.scss | 12 +-
.../components/FileItem/FileInfo/index.scss | 5 +-
.../FileItem/FilePreviewAndLink/index.scss | 2 +-
.../src/components/FileItem/index.scss | 2 +-
packages/@uppy/dashboard/src/style.scss | 133 +++--
packages/@uppy/dashboard/types/index.d.ts | 44 +-
.../@uppy/dashboard/types/index.test-d.ts | 30 +-
packages/@uppy/drop-target/types/index.d.ts | 8 +-
packages/@uppy/dropbox/types/index.d.ts | 11 +-
packages/@uppy/facebook/types/index.d.ts | 17 +-
packages/@uppy/file-input/types/index.d.ts | 8 +-
packages/@uppy/form/types/index.d.ts | 12 +-
.../@uppy/golden-retriever/types/index.d.ts | 6 +-
packages/@uppy/google-drive/types/index.d.ts | 17 +-
.../@uppy/google-drive/types/index.test-d.ts | 5 +-
packages/@uppy/image-editor/src/cropper.scss | 6 +-
.../@uppy/image-editor/src/inputrange.scss | 37 +-
packages/@uppy/image-editor/types/index.d.ts | 22 +-
packages/@uppy/informer/src/style.scss | 2 +-
packages/@uppy/instagram/types/index.d.ts | 15 +-
packages/@uppy/onedrive/types/index.d.ts | 15 +-
packages/@uppy/progress-bar/src/style.scss | 2 +-
packages/@uppy/provider-views/src/style.scss | 30 +-
.../uppy-ProviderBrowser-viewType--grid.scss | 6 +-
.../uppy-ProviderBrowser-viewType--list.scss | 6 +-
.../uppy-ProviderBrowserItem-checkbox.scss | 4 +-
.../src/style/uppy-SearchProvider-input.scss | 5 +-
.../@uppy/provider-views/types/index.d.ts | 14 +-
packages/@uppy/react/src/DashboardModal.d.ts | 3 +-
packages/@uppy/react/src/DragDrop.d.ts | 3 +-
packages/@uppy/react/src/ProgressBar.d.ts | 3 +-
packages/@uppy/react/src/StatusBar.d.ts | 3 +-
packages/@uppy/react/types/index.test-d.tsx | 16 +-
packages/@uppy/screen-capture/src/style.scss | 19 +-
.../@uppy/screen-capture/types/index.d.ts | 32 +-
.../screen-capture/types/index.test-d.ts | 12 +-
packages/@uppy/status-bar/src/style.scss | 68 ++-
packages/@uppy/status-bar/types/index.d.ts | 8 +-
packages/@uppy/store-default/types/index.d.ts | 14 +-
packages/@uppy/store-redux/types/index.d.ts | 14 +-
packages/@uppy/svelte/tsconfig.json | 8 +-
.../thumbnail-generator/types/index.d.ts | 9 +-
packages/@uppy/transloadit/types/index.d.ts | 15 +-
.../@uppy/transloadit/types/index.test-d.ts | 14 +-
packages/@uppy/tus/types/index.d.ts | 53 +-
packages/@uppy/unsplash/types/index.d.ts | 4 +-
packages/@uppy/url/src/style.scss | 2 +-
packages/@uppy/url/types/index.d.ts | 18 +-
packages/@uppy/url/types/index.test-d.ts | 30 +-
packages/@uppy/utils/src/microtip.scss | 100 ++--
packages/@uppy/utils/types/index.d.ts | 139 ++---
packages/@uppy/vue/types/dashboard-modal.d.ts | 22 +-
packages/@uppy/vue/types/dashboard.d.ts | 20 +-
packages/@uppy/vue/types/drag-drop.d.ts | 18 +-
packages/@uppy/vue/types/file-input.d.ts | 18 +-
packages/@uppy/vue/types/progress-bar.d.ts | 18 +-
packages/@uppy/vue/types/status-bar.d.ts | 18 +-
packages/@uppy/webcam/src/style.scss | 15 +-
packages/@uppy/webcam/types/index.d.ts | 40 +-
packages/@uppy/webcam/types/index.test-d.ts | 14 +-
packages/@uppy/xhr-upload/types/index.d.ts | 38 +-
packages/@uppy/zoom/types/index.d.ts | 11 +-
packages/uppy/types/index.test-d.ts | 26 +-
private/dev/dragdrop.html | 10 +-
private/dev/index.html | 15 +-
private/release/package.json | 28 +-
private/vue-template-compiler/package.json | 8 +-
tsconfig.json | 9 +-
vitest.config.ts | 4 +-
172 files changed, 3024 insertions(+), 1771 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/1-bug.yml b/.github/ISSUE_TEMPLATE/1-bug.yml
index 5e21abb62b..f18c15617f 100644
--- a/.github/ISSUE_TEMPLATE/1-bug.yml
+++ b/.github/ISSUE_TEMPLATE/1-bug.yml
@@ -7,9 +7,14 @@ body:
attributes:
label: Initial checklist
options:
- - label: I understand this is a bug report and questions should be posted in the [Community Forum](https://community.transloadit.com/)
+ - label:
+ I understand this is a bug report and questions should be posted in
+ the [Community Forum](https://community.transloadit.com/)
required: true
- - label: I searched [issues](https://github.com/transloadit/uppy/issues?q=is%3Aissue) and couldn’t find anything (or linked relevant results below)
+ - label:
+ I searched
+ [issues](https://github.com/transloadit/uppy/issues?q=is%3Aissue)
+ and couldn’t find anything (or linked relevant results below)
required: true
- type: input
id: runnable-example
@@ -28,7 +33,9 @@ body:
id: steps-to-reproduce
attributes:
label: Steps to reproduce
- description: How did this happen? Please provide a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
+ description:
+ How did this happen? Please provide a [minimal, reproducible
+ example](https://stackoverflow.com/help/minimal-reproducible-example).
validations:
required: true
- type: textarea
diff --git a/.github/ISSUE_TEMPLATE/2-feature.yml b/.github/ISSUE_TEMPLATE/2-feature.yml
index d1cb06a3f4..b8f3d1b512 100644
--- a/.github/ISSUE_TEMPLATE/2-feature.yml
+++ b/.github/ISSUE_TEMPLATE/2-feature.yml
@@ -7,9 +7,14 @@ body:
attributes:
label: Initial checklist
options:
- - label: I understand this is a feature request and questions should be posted in the [Community Forum](https://community.transloadit.com/)
+ - label:
+ I understand this is a feature request and questions should be
+ posted in the [Community Forum](https://community.transloadit.com/)
required: true
- - label: I searched [issues](https://github.com/transloadit/uppy/issues?q=is%3Aissue) and couldn’t find anything (or linked relevant results below)
+ - label:
+ I searched
+ [issues](https://github.com/transloadit/uppy/issues?q=is%3Aissue)
+ and couldn’t find anything (or linked relevant results below)
required: true
- type: textarea
id: problem
@@ -29,6 +34,8 @@ body:
id: alternatives
attributes:
label: Alternatives
- description: What are the alternative solutions? Can this be solved in a different way?
+ description:
+ What are the alternative solutions? Can this be solved in a different
+ way?
validations:
required: true
diff --git a/.github/stale.yml b/.github/stale.yml
index b99cf78c7c..2eac2d3952 100644
--- a/.github/stale.yml
+++ b/.github/stale.yml
@@ -11,7 +11,7 @@ staleLabel: Stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
- recent activity. If the issue is still relevant, please upvote or leave a comment.
- Thank you for your contribution!
+ recent activity. If the issue is still relevant, please upvote or leave a
+ comment. Thank you for your contribution!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
diff --git a/.github/workflows/bundlers.yml b/.github/workflows/bundlers.yml
index dc23bc7b42..bb1500f46d 100644
--- a/.github/workflows/bundlers.yml
+++ b/.github/workflows/bundlers.yml
@@ -2,10 +2,10 @@ name: Test different bundlers with Uppy
on:
push:
- branches: [ main ]
+ branches: [main]
pull_request:
# We want all branches so we configure types to be the GH default again
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- '**.d.ts'
@@ -27,7 +27,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
@@ -40,7 +41,10 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
- run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
+ run:
+ corepack yarn workspaces focus $(corepack yarn workspaces list --json
+ | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io")
+ print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
@@ -64,7 +68,9 @@ jobs:
})();
EOF
- name: Eject public packages from repo
- run: mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
+ run:
+ mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private
+ pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
- name: Upload artifact
if: success()
uses: actions/upload-artifact@v3
@@ -85,18 +91,17 @@ jobs:
with:
path: /tmp/
- name: Extract tarball
- run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
+ run:
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Rollup as a dev dependency
run: >-
- npm i --save-dev
- @rollup/plugin-commonjs @rollup/plugin-node-resolve
+ npm i --save-dev @rollup/plugin-commonjs @rollup/plugin-node-resolve
rollup@${{matrix.bundler-version}}
- run: npx rollup --version
- name: Create Rollup config file
run: >-
- echo '
- import cjs from "@rollup/plugin-commonjs";
- import { nodeResolve } from "@rollup/plugin-node-resolve";
+ echo ' import cjs from "@rollup/plugin-commonjs"; import { nodeResolve
+ } from "@rollup/plugin-node-resolve";
export default {
input: "./index.mjs",
@@ -124,12 +129,16 @@ jobs:
with:
path: /tmp/
- name: Extract tarball
- run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
+ run:
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Webpack as a dev dependency
run: npm i --save-dev webpack-cli webpack@${{matrix.bundler-version}}
- run: npx webpack --version
- name: Create Webpack config file
- run: echo 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}' > webpack.config.js
+ run:
+ echo
+ 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}'
+ > webpack.config.js
- name: Bundle
run: npx webpack
@@ -146,7 +155,8 @@ jobs:
with:
path: /tmp/
- name: Extract tarball
- run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
+ run:
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Fix package.json to work with Parcel
run: |
node <<'EOF'
@@ -175,12 +185,15 @@ jobs:
with:
path: /tmp/
- name: Extract tarball
- run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
+ run:
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Vite as a dev dependency
run: npm i --save-dev vite@${{matrix.bundler-version}}
- run: npx vite --version
- name: Create index.html
- run: echo '' > index.html
+ run:
+ echo '' > index.html
- name: Bundle
run: npx vite build
@@ -197,11 +210,12 @@ jobs:
with:
path: /tmp/
- name: Extract tarball
- run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
+ run:
+ tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add ESBuild as a dev dependency
run: npm i --save-dev esbuild@${{matrix.bundler-version}}
- run: npx esbuild --version
- name: Bundle
run: npx esbuild index.mjs --bundle --outfile=/dev/null
-
+
# Browserify: doesn't support ESM.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9b25e74b53..fbb46ee309 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,7 +2,7 @@ name: CI
on:
push:
- branches: [ main ]
+ branches: [main]
paths-ignore:
- '**.md'
- 'assets/**'
@@ -14,7 +14,7 @@ on:
- '!.github/workflows/ci.yml'
pull_request:
# We want all branches so we configure types to be the GH default again
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- 'assets/**'
@@ -41,7 +41,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -55,7 +56,10 @@ jobs:
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
- run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
+ run:
+ corepack yarn workspaces focus $(corepack yarn workspaces list --json
+ | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io")
+ print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
@@ -70,7 +74,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -84,7 +89,10 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
- run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
+ run:
+ corepack yarn workspaces focus $(corepack yarn workspaces list --json
+ | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io")
+ print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
diff --git a/.github/workflows/companion-deploy.yml b/.github/workflows/companion-deploy.yml
index a8c06b6d5b..49b0bb0327 100644
--- a/.github/workflows/companion-deploy.yml
+++ b/.github/workflows/companion-deploy.yml
@@ -5,7 +5,7 @@ name: Companion Edge Deploy
on:
push:
- branches: [ 'main' ]
+ branches: ['main']
paths:
- yarn.lock
- 'packages/@uppy/companion/**'
@@ -22,9 +22,15 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set SHA commit in version
- run: (cd packages/@uppy/companion && node -e 'const pkg=require("./package.json");pkg.version+="+${{ github.sha }}";fs.writeFileSync("package.json",JSON.stringify(pkg, undefined, 2)+"\n")')
+ run:
+ (cd packages/@uppy/companion && node -e 'const
+ pkg=require("./package.json");pkg.version+="+${{ github.sha
+ }}";fs.writeFileSync("package.json",JSON.stringify(pkg, undefined,
+ 2)+"\n")')
- name: Create Companion tarball
- run: corepack yarn workspace @uppy/companion pack --install-if-needed -o /tmp/companion-${{ github.sha }}.tar.gz
+ run:
+ corepack yarn workspace @uppy/companion pack --install-if-needed -o
+ /tmp/companion-${{ github.sha }}.tar.gz
- name: Upload artifact
if: success()
uses: actions/upload-artifact@v3
diff --git a/.github/workflows/companion.yml b/.github/workflows/companion.yml
index 94e6841877..58834603a4 100644
--- a/.github/workflows/companion.yml
+++ b/.github/workflows/companion.yml
@@ -1,14 +1,14 @@
name: Companion
on:
push:
- branches: [ main ]
+ branches: [main]
paths:
- yarn.lock
- 'packages/@uppy/companion/**'
- '.github/workflows/companion.yml'
pull_request:
# We want all branches so we configure types to be the GH default again
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths:
- yarn.lock
- 'packages/@uppy/companion/**'
@@ -29,7 +29,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -48,4 +49,3 @@ jobs:
run: corepack yarn run test:companion
- name: Run type checks in focused workspace
run: corepack yarn run build:companion
-
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml
index d7103de1f8..4ead483a4e 100644
--- a/.github/workflows/e2e.yml
+++ b/.github/workflows/e2e.yml
@@ -1,7 +1,7 @@
name: End-to-end tests
on:
push:
- branches: [ main ]
+ branches: [main]
paths-ignore:
- '**.md'
- '**.d.ts'
@@ -11,7 +11,7 @@ on:
- '.github/**'
- '!.github/workflows/e2e.yml'
pull_request_target:
- types: [ opened, synchronize, reopened, labeled ]
+ types: [opened, synchronize, reopened, labeled]
paths-ignore:
- '**.md'
- '**.d.ts'
@@ -20,7 +20,7 @@ on:
- 'website/**'
- '.github/**'
pull_request:
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths:
- .github/workflows/e2e.yml
@@ -31,7 +31,12 @@ env:
jobs:
e2e:
- if: ${{ !github.event.pull_request || (contains(github.event.pull_request.labels.*.name, 'safe to test') && github.event.pull_request.state == 'open') || (github.event.pull_request.head.repo.full_name == github.repository && github.event.event_name != 'labeled') }}
+ if:
+ ${{ !github.event.pull_request ||
+ (contains(github.event.pull_request.labels.*.name, 'safe to test') &&
+ github.event.pull_request.state == 'open') ||
+ (github.event.pull_request.head.repo.full_name == github.repository &&
+ github.event.event_name != 'labeled') }}
name: Browser tests
runs-on: ubuntu-latest
steps:
@@ -41,7 +46,8 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -105,14 +111,19 @@ jobs:
e2e/cypress/screenshots/
- name: Remove 'pending end-to-end tests' label
# Remove the 'pending end-to-end tests' label if tests ran successfully
- if: github.event.pull_request && contains(github.event.pull_request.labels.*.name, 'pending end-to-end tests')
+ if:
+ github.event.pull_request &&
+ contains(github.event.pull_request.labels.*.name, 'pending end-to-end
+ tests')
run: gh pr edit "$NUMBER" --remove-label 'pending end-to-end tests'
env:
NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove 'safe to test' label
# Remove the 'safe to test' label to ensure next commit needs approval before re-running this.
- if: always() && github.event.pull_request && contains(github.event.pull_request.labels.*.name, 'safe to test')
+ if:
+ always() && github.event.pull_request &&
+ contains(github.event.pull_request.labels.*.name, 'safe to test')
run: gh pr edit "$NUMBER" --remove-label 'safe to test'
env:
NUMBER: ${{ github.event.pull_request.number }}
@@ -121,11 +132,18 @@ jobs:
# Add the 'pending end-to-end tests' label for PRs that come from forks.
# For those PRs, we want to review the code before running e2e tests.
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
- if: github.event.pull_request.state == 'open' && github.event.pull_request.head.repo.full_name != github.repository && !contains(github.event.pull_request.labels.*.name, 'safe to test') && !contains(github.event.pull_request.labels.*.name, 'pending end-to-end tests')
+ if:
+ github.event.pull_request.state == 'open' &&
+ github.event.pull_request.head.repo.full_name != github.repository &&
+ !contains(github.event.pull_request.labels.*.name, 'safe to test') &&
+ !contains(github.event.pull_request.labels.*.name, 'pending end-to-end
+ tests')
runs-on: ubuntu-latest
steps:
- name: Add label
env:
NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: gh pr edit "$NUMBER" --repo ${{ github.repository }} --add-label 'pending end-to-end tests'
+ run:
+ gh pr edit "$NUMBER" --repo ${{ github.repository }} --add-label
+ 'pending end-to-end tests'
diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml
index 885cd17eb9..aa4cfad83c 100644
--- a/.github/workflows/linters.yml
+++ b/.github/workflows/linters.yml
@@ -2,14 +2,14 @@ name: Linters
on:
push:
- branches: [ main ]
+ branches: [main]
paths-ignore:
- '.github/**'
- '!.github/workflows/linters.yml'
- '!.github/CONTRIBUTING.md'
pull_request:
# We want all branches so we configure types to be the GH default again
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths-ignore:
- '.github/**'
- '!.github/workflows/linters.yml'
@@ -27,7 +27,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -42,7 +43,9 @@ jobs:
node-version: lts/*
- name: Install dependencies
# List all projects that use a custom ESLint config:
- run: corepack yarn workspaces focus @uppy/angular @uppy-example/angular @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
+ run:
+ corepack yarn workspaces focus @uppy/angular @uppy-example/angular
+ @uppy-example/react-native-expo @uppy/react-native @uppy-dev/build
- name: Run linter
run: corepack yarn run lint
@@ -54,7 +57,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
diff --git a/.github/workflows/lockile_check.yml b/.github/workflows/lockile_check.yml
index af5c94d9f4..32ea46745f 100644
--- a/.github/workflows/lockile_check.yml
+++ b/.github/workflows/lockile_check.yml
@@ -2,12 +2,12 @@ name: Lockfile checks
on:
push:
- branches: [ main ]
+ branches: [main]
paths:
- yarn.lock
pull_request:
# We want all branches so we configure types to be the GH default again
- types: [ opened, synchronize, reopened ]
+ types: [opened, synchronize, reopened]
paths:
- yarn.lock
@@ -23,7 +23,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
diff --git a/.github/workflows/manual-cdn.yml b/.github/workflows/manual-cdn.yml
index c95ab5718b..f0977f8508 100644
--- a/.github/workflows/manual-cdn.yml
+++ b/.github/workflows/manual-cdn.yml
@@ -3,9 +3,9 @@ on:
workflow_dispatch:
inputs:
name:
- description: "Package to upload"
+ description: 'Package to upload'
required: true
- default: "uppy"
+ default: 'uppy'
env:
YARN_ENABLE_GLOBAL_CACHE: false
@@ -18,7 +18,8 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml
index d5f2bfa2b9..832765f8da 100644
--- a/.github/workflows/release-candidate.yml
+++ b/.github/workflows/release-candidate.yml
@@ -23,7 +23,8 @@ jobs:
git rebase FETCH_HEAD
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -44,11 +45,17 @@ jobs:
- name: Bump candidate packages version
run: corepack yarn version apply --all --json | jq -s > releases.json
- name: Prepare changelog
- run: corepack yarn workspace @uppy-dev/release update-changelogs releases.json | xargs git add
+ run:
+ corepack yarn workspace @uppy-dev/release update-changelogs
+ releases.json | xargs git add
- name: Update contributors table
- run: corepack yarn contributors:save && corepack yarn remark -foq README.md && git add README.md
+ run:
+ corepack yarn contributors:save && corepack yarn remark -foq README.md
+ && git add README.md
- name: Update CDN URLs
- run: corepack yarn workspace @uppy-dev/release update-version-URLs | xargs git add
+ run:
+ corepack yarn workspace @uppy-dev/release update-version-URLs | xargs
+ git add
- name: Stage changes and remove temp files
run: |
git rm -rf .yarn/versions
@@ -75,7 +82,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Assign to the releaser
- run: echo '{"assignees":[${{ toJSON(github.actor) }}]}' | gh api repos/${{ github.repository }}/issues/${{ steps.pr_opening.outputs.pr_number }}/assignees --input -
+ run:
+ echo '{"assignees":[${{ toJSON(github.actor) }}]}' | gh api repos/${{
+ github.repository }}/issues/${{ steps.pr_opening.outputs.pr_number
+ }}/assignees --input -
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable Release workflow
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3f3d25d963..31e872b231 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,9 +9,13 @@ env:
jobs:
release:
name: Publish releases
- if: ${{ github.event.review.state == 'approved' && github.event.sender.login == github.event.pull_request.assignee.login && github.event.pull_request.head.ref == 'release-candidate' }}
+ if:
+ ${{ github.event.review.state == 'approved' && github.event.sender.login
+ == github.event.pull_request.assignee.login &&
+ github.event.pull_request.head.ref == 'release-candidate' }}
outputs:
- companionWasReleased: ${{ steps.checkIfCompanionWasReleased.outputs.version }}
+ companionWasReleased:
+ ${{ steps.checkIfCompanionWasReleased.outputs.version }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
@@ -20,7 +24,8 @@ jobs:
fetch-depth: 2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
- run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
+ run:
+ echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -39,7 +44,10 @@ jobs:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Get CHANGELOG diff
- run: git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1) == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print substr($0,2) } }' > CHANGELOG.diff.md
+ run:
+ git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1)
+ == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print
+ substr($0,2) } }' > CHANGELOG.diff.md
- name: Copy README for `uppy` package
run: cp README.md packages/uppy/.
- name: Build before publishing
@@ -47,7 +55,9 @@ jobs:
- name: Hack to allow the publish of the Angular package
run: corepack yarn workspace @uppy/angular prepublishOnly
- name: Publish to the npm registry
- run: corepack yarn workspaces foreach --no-private npm publish --access public --tolerate-republish
+ run:
+ corepack yarn workspaces foreach --no-private npm publish --access
+ public --tolerate-republish
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Merge PR
@@ -68,9 +78,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Uppy version number
id: uppyVersion
- run: jq -r '"version="+.version' < packages/uppy/package.json >> $GITHUB_OUTPUT
+ run:
+ jq -r '"version="+.version' < packages/uppy/package.json >>
+ $GITHUB_OUTPUT
- name: Create GitHub release
- run: gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t "Uppy ${{ steps.uppyVersion.outputs.version }}" -F CHANGELOG.diff.md
+ run:
+ gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t
+ "Uppy ${{ steps.uppyVersion.outputs.version }}" -F CHANGELOG.diff.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload `uppy` to CDN
@@ -79,19 +93,28 @@ jobs:
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
- name: Upload `@uppy/locales` to CDN if it was released
- run: git diff --exit-code --quiet HEAD^ -- packages/@uppy/locales/package.json ||corepack yarn run uploadcdn @uppy/locales
+ run:
+ git diff --exit-code --quiet HEAD^ --
+ packages/@uppy/locales/package.json ||corepack yarn run uploadcdn
+ @uppy/locales
env:
EDGLY_KEY: ${{secrets.EDGLY_KEY}}
EDGLY_SECRET: ${{secrets.EDGLY_SECRET}}
- name: Check if Companion was released
id: checkIfCompanionWasReleased
- run: git diff --exit-code --quiet HEAD^ -- packages/@uppy/companion/package.json || echo "version=$(jq -r .version < packages/@uppy/companion/package.json)" >> $GITHUB_OUTPUT
+ run:
+ git diff --exit-code --quiet HEAD^ --
+ packages/@uppy/companion/package.json || echo "version=$(jq -r
+ .version < packages/@uppy/companion/package.json)" >> $GITHUB_OUTPUT
- name: Remove release-candidate branch
- run: gh api -X DELETE repos/${{ github.repository }}/git/refs/heads/release-candidate || echo "Already deleted"
+ run:
+ gh api -X DELETE repos/${{ github.repository
+ }}/git/refs/heads/release-candidate || echo "Already deleted"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove release branch
- run: gh api -X DELETE repos/${{ github.repository }}/git/refs/heads/release
+ run:
+ gh api -X DELETE repos/${{ github.repository }}/git/refs/heads/release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Disable Release workflow
@@ -100,7 +123,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: In case of failure
if: ${{ failure() }}
- run: gh pr comment ${{ github.event.pull_request.number }} --body "Release job failed, please take action."
+ run:
+ gh pr comment ${{ github.event.pull_request.number }} --body "Release
+ job failed, please take action."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.stylelintrc.json b/.stylelintrc.json
index 264693460e..3d05d89b95 100644
--- a/.stylelintrc.json
+++ b/.stylelintrc.json
@@ -9,4 +9,4 @@
"scss/at-rule-no-unknown": true
},
"defaultSeverity": "warning"
-}
\ No newline at end of file
+}
diff --git a/.yarnrc.yml b/.yarnrc.yml
index 7745cf9592..1942f7cc94 100644
--- a/.yarnrc.yml
+++ b/.yarnrc.yml
@@ -10,6 +10,6 @@ nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
- spec: "@yarnpkg/plugin-workspace-tools"
+ spec: '@yarnpkg/plugin-workspace-tools'
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
- spec: "@yarnpkg/plugin-version"
+ spec: '@yarnpkg/plugin-version'
diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml
index 2e6f20226e..0ee79ae764 100644
--- a/docker-compose-dev.yml
+++ b/docker-compose-dev.yml
@@ -13,7 +13,7 @@ services:
- /app/node_modules
- /mnt/uppy-server-data:/mnt/uppy-server-data
ports:
- - "3020:3020"
- command: "/app/src/standalone/start-server.js --config nodemon.json"
+ - '3020:3020'
+ command: '/app/src/standalone/start-server.js --config nodemon.json'
env_file:
- - .env
+ - .env
diff --git a/docker-compose.yml b/docker-compose.yml
index 3dbf23a12a..fd6dbe4e03 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -10,6 +10,6 @@ services:
- /app/node_modules
- /mnt/uppy-server-data:/mnt/uppy-server-data
ports:
- - "3020:3020"
+ - '3020:3020'
env_file:
- - .env
+ - .env
diff --git a/e2e/clients/dashboard-aws-multipart/index.html b/e2e/clients/dashboard-aws-multipart/index.html
index ff8fd1dd5e..9ccaf9e3bd 100644
--- a/e2e/clients/dashboard-aws-multipart/index.html
+++ b/e2e/clients/dashboard-aws-multipart/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-aws-multipart
diff --git a/e2e/clients/dashboard-aws/index.html b/e2e/clients/dashboard-aws/index.html
index 4b14700fda..27ecd5736c 100644
--- a/e2e/clients/dashboard-aws/index.html
+++ b/e2e/clients/dashboard-aws/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-aws
diff --git a/e2e/clients/dashboard-compressor/index.html b/e2e/clients/dashboard-compressor/index.html
index 2896829cb1..849e8502c2 100644
--- a/e2e/clients/dashboard-compressor/index.html
+++ b/e2e/clients/dashboard-compressor/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-compressor
diff --git a/e2e/clients/dashboard-transloadit/index.html b/e2e/clients/dashboard-transloadit/index.html
index f36fb8dbb9..e05e15c945 100644
--- a/e2e/clients/dashboard-transloadit/index.html
+++ b/e2e/clients/dashboard-transloadit/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-transloadit
diff --git a/e2e/clients/dashboard-tus/index.html b/e2e/clients/dashboard-tus/index.html
index 9ee4db8d4d..235833541c 100644
--- a/e2e/clients/dashboard-tus/index.html
+++ b/e2e/clients/dashboard-tus/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-tus
diff --git a/e2e/clients/dashboard-ui/index.html b/e2e/clients/dashboard-ui/index.html
index e76c6332be..9beff94caa 100644
--- a/e2e/clients/dashboard-ui/index.html
+++ b/e2e/clients/dashboard-ui/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-ui
diff --git a/e2e/clients/dashboard-vue/App.vue b/e2e/clients/dashboard-vue/App.vue
index 3fa462b179..96fad8b781 100644
--- a/e2e/clients/dashboard-vue/App.vue
+++ b/e2e/clients/dashboard-vue/App.vue
@@ -13,10 +13,10 @@ export default {
Dashboard,
},
computed: {
- uppy: () => new Uppy()
+ uppy: () => new Uppy(),
},
}
-
-
+
+
diff --git a/e2e/clients/dashboard-vue/index.html b/e2e/clients/dashboard-vue/index.html
index 248d7a0407..d4254a3b90 100644
--- a/e2e/clients/dashboard-vue/index.html
+++ b/e2e/clients/dashboard-vue/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-vue
diff --git a/e2e/clients/dashboard-xhr/index.html b/e2e/clients/dashboard-xhr/index.html
index 48832c7ffe..83a81c643d 100644
--- a/e2e/clients/dashboard-xhr/index.html
+++ b/e2e/clients/dashboard-xhr/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-xhr
diff --git a/e2e/clients/react/index.html b/e2e/clients/react/index.html
index 710c490e16..315cd8ce91 100644
--- a/e2e/clients/react/index.html
+++ b/e2e/clients/react/index.html
@@ -1,7 +1,7 @@
-
+
dashboard-react
diff --git a/e2e/cypress/integration/dashboard-aws-multipart.spec.ts b/e2e/cypress/integration/dashboard-aws-multipart.spec.ts
index cc1e57f75f..70f384a999 100644
--- a/e2e/cypress/integration/dashboard-aws-multipart.spec.ts
+++ b/e2e/cypress/integration/dashboard-aws-multipart.spec.ts
@@ -8,7 +8,9 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {
})
it('should upload cat image successfully', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@post', '@get', '@put'])
@@ -16,7 +18,9 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {
})
it('should upload Russian poem image successfully', () => {
const fileName = '١٠ كم мест для Нью-Йорке.pdf'
- cy.get('@file-input').selectFile(`cypress/fixtures/images/${fileName}`, { force:true })
+ cy.get('@file-input').selectFile(`cypress/fixtures/images/${fileName}`, {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@post', '@get', '@put'])
@@ -24,88 +28,174 @@ describe('Dashboard with @uppy/aws-s3-multipart', () => {
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Complete')
})
- it('should handle retry request gracefully', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ it('should handle retry request gracefully', () => {
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
- cy.intercept('POST', '/s3/multipart', { forceNetworkError: true, times: 1 }).as('createMultipartUpload-fails')
+ cy.intercept('POST', '/s3/multipart', {
+ forceNetworkError: true,
+ times: 1,
+ }).as('createMultipartUpload-fails')
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@createMultipartUpload-fails'])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')
- cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt1', uploadId:'mocked-uploadId-attempt1' }) }).as('createMultipartUpload-attempt1')
- cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt1/1?key=mocked-key-attempt1', { forceNetworkError: true }).as('signPart-fails')
- cy.intercept('DELETE', '/s3/multipart/mocked-uploadId-attempt1?key=mocked-key-attempt1', { statusCode: 200, body: '{}' }).as('abortAttempt-1')
+ cy.intercept('POST', '/s3/multipart', {
+ statusCode: 200,
+ times: 1,
+ body: JSON.stringify({
+ key: 'mocked-key-attempt1',
+ uploadId: 'mocked-uploadId-attempt1',
+ }),
+ }).as('createMultipartUpload-attempt1')
+ cy.intercept(
+ 'GET',
+ '/s3/multipart/mocked-uploadId-attempt1/1?key=mocked-key-attempt1',
+ { forceNetworkError: true },
+ ).as('signPart-fails')
+ cy.intercept(
+ 'DELETE',
+ '/s3/multipart/mocked-uploadId-attempt1?key=mocked-key-attempt1',
+ { statusCode: 200, body: '{}' },
+ ).as('abortAttempt-1')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
- cy.wait(['@createMultipartUpload-attempt1', '@signPart-fails', '@abortAttempt-1'])
+ cy.wait([
+ '@createMultipartUpload-attempt1',
+ '@signPart-fails',
+ '@abortAttempt-1',
+ ])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')
- cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt2', uploadId:'mocked-uploadId-attempt2' }) }).as('createMultipartUpload-attempt2')
- cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt2/1?key=mocked-key-attempt2', {
+ cy.intercept('POST', '/s3/multipart', {
statusCode: 200,
- headers: {
- ETag: 'W/"222-GXE2wLoMKDihw3wxZFH1APdUjHM"',
+ times: 1,
+ body: JSON.stringify({
+ key: 'mocked-key-attempt2',
+ uploadId: 'mocked-uploadId-attempt2',
+ }),
+ }).as('createMultipartUpload-attempt2')
+ cy.intercept(
+ 'GET',
+ '/s3/multipart/mocked-uploadId-attempt2/1?key=mocked-key-attempt2',
+ {
+ statusCode: 200,
+ headers: {
+ ETag: 'W/"222-GXE2wLoMKDihw3wxZFH1APdUjHM"',
+ },
+ body: JSON.stringify({ url: '/put-fail', expires: 8 }),
},
- body: JSON.stringify({ url:'/put-fail', expires:8 }),
- }).as('signPart-toFail')
- cy.intercept('DELETE', '/s3/multipart/mocked-uploadId-attempt2?key=mocked-key-attempt2', { statusCode: 200, body: '{}' }).as('abortAttempt-2')
- cy.intercept('PUT', '/put-fail', { forceNetworkError: true }).as('put-fails')
+ ).as('signPart-toFail')
+ cy.intercept(
+ 'DELETE',
+ '/s3/multipart/mocked-uploadId-attempt2?key=mocked-key-attempt2',
+ { statusCode: 200, body: '{}' },
+ ).as('abortAttempt-2')
+ cy.intercept('PUT', '/put-fail', { forceNetworkError: true }).as(
+ 'put-fails',
+ )
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
- cy.wait(['@createMultipartUpload-attempt2', '@signPart-toFail', ...Array(5).fill('@put-fails'), '@abortAttempt-2'])
+ cy.wait([
+ '@createMultipartUpload-attempt2',
+ '@signPart-toFail',
+ ...Array(5).fill('@put-fails'),
+ '@abortAttempt-2',
+ ])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')
- cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt2/1?key=mocked-key-attempt2', {
- statusCode: 200,
- headers: {
- ETag: 'ETag-attempt2',
+ cy.intercept(
+ 'GET',
+ '/s3/multipart/mocked-uploadId-attempt2/1?key=mocked-key-attempt2',
+ {
+ statusCode: 200,
+ headers: {
+ ETag: 'ETag-attempt2',
+ },
+ body: JSON.stringify({ url: '/put-success-attempt2', expires: 8 }),
},
- body: JSON.stringify({ url:'/put-success-attempt2', expires:8 }),
- }).as('signPart-attempt2')
+ ).as('signPart-attempt2')
cy.intercept('PUT', '/put-success-attempt2', {
statusCode: 200,
headers: {
ETag: 'ETag-attempt2',
},
}).as('put-attempt2')
- cy.intercept('POST', '/s3/multipart/mocked-uploadId-attempt2/complete?key=mocked-key-attempt2', { forceNetworkError: true }).as('completeMultipartUpload-fails')
+ cy.intercept(
+ 'POST',
+ '/s3/multipart/mocked-uploadId-attempt2/complete?key=mocked-key-attempt2',
+ { forceNetworkError: true },
+ ).as('completeMultipartUpload-fails')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
- cy.wait(['@createMultipartUpload-attempt2', '@signPart-attempt2', '@put-attempt2', '@completeMultipartUpload-fails', '@abortAttempt-2'])
+ cy.wait([
+ '@createMultipartUpload-attempt2',
+ '@signPart-attempt2',
+ '@put-attempt2',
+ '@completeMultipartUpload-fails',
+ '@abortAttempt-2',
+ ])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Upload failed')
- cy.intercept('POST', '/s3/multipart', { statusCode: 200, times: 1, body: JSON.stringify({ key:'mocked-key-attempt3', uploadId:'mocked-uploadId-attempt3' }) }).as('createMultipartUpload-attempt3')
+ cy.intercept('POST', '/s3/multipart', {
+ statusCode: 200,
+ times: 1,
+ body: JSON.stringify({
+ key: 'mocked-key-attempt3',
+ uploadId: 'mocked-uploadId-attempt3',
+ }),
+ }).as('createMultipartUpload-attempt3')
let intercepted = 0
- cy.intercept('GET', '/s3/multipart/mocked-uploadId-attempt3/1?key=mocked-key-attempt3', (req) => {
- if (intercepted++ < 2) {
- // Ensure that Uppy can recover from at least 2 network errors at this stage.
- req.destroy()
- return
- }
- req.reply({
- statusCode: 200,
- headers: {
- ETag: 'ETag-attempt3',
- },
- body: JSON.stringify({ url:'/put-success-attempt3', expires:8 }),
- })
- }).as('signPart-attempt3')
+ cy.intercept(
+ 'GET',
+ '/s3/multipart/mocked-uploadId-attempt3/1?key=mocked-key-attempt3',
+ (req) => {
+ if (intercepted++ < 2) {
+ // Ensure that Uppy can recover from at least 2 network errors at this stage.
+ req.destroy()
+ return
+ }
+ req.reply({
+ statusCode: 200,
+ headers: {
+ ETag: 'ETag-attempt3',
+ },
+ body: JSON.stringify({ url: '/put-success-attempt3', expires: 8 }),
+ })
+ },
+ ).as('signPart-attempt3')
cy.intercept('PUT', '/put-success-attempt3', {
statusCode: 200,
headers: {
ETag: 'ETag-attempt3',
},
}).as('put-attempt3')
- cy.intercept('POST', '/s3/multipart/mocked-uploadId-attempt3/complete?key=mocked-key-attempt3', {
- statusCode: 200,
- body: JSON.stringify({
- location: 'someLocation',
- }),
- }).as('completeMultipartUpload-attempt3')
+ cy.intercept(
+ 'POST',
+ '/s3/multipart/mocked-uploadId-attempt3/complete?key=mocked-key-attempt3',
+ {
+ statusCode: 200,
+ body: JSON.stringify({
+ location: 'someLocation',
+ }),
+ },
+ ).as('completeMultipartUpload-attempt3')
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
- cy.wait(['@createMultipartUpload-attempt3', ...Array(3).fill('@signPart-attempt3'), '@put-attempt3', '@completeMultipartUpload-attempt3'])
+ cy.wait([
+ '@createMultipartUpload-attempt3',
+ ...Array(3).fill('@signPart-attempt3'),
+ '@put-attempt3',
+ '@completeMultipartUpload-attempt3',
+ ])
cy.get('.uppy-StatusBar-statusPrimary').should('contain', 'Complete')
})
it('should complete when resuming after pause', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force: true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@post')
diff --git a/e2e/cypress/integration/dashboard-aws.spec.ts b/e2e/cypress/integration/dashboard-aws.spec.ts
index 16a7a1ddbe..0b39f3fbaf 100644
--- a/e2e/cypress/integration/dashboard-aws.spec.ts
+++ b/e2e/cypress/integration/dashboard-aws.spec.ts
@@ -7,7 +7,9 @@ describe('Dashboard with @uppy/aws-s3', () => {
})
it('should upload cat image successfully', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@post', '@get'])
diff --git a/e2e/cypress/integration/dashboard-compressor.spec.ts b/e2e/cypress/integration/dashboard-compressor.spec.ts
index 93b22858ca..84e5ab8cfc 100644
--- a/e2e/cypress/integration/dashboard-compressor.spec.ts
+++ b/e2e/cypress/integration/dashboard-compressor.spec.ts
@@ -1,4 +1,4 @@
-function uglierBytes (text) {
+function uglierBytes(text) {
const KB = 2 ** 10
const MB = KB * KB
@@ -28,7 +28,13 @@ describe('dashboard-compressor', () => {
it('should compress images', () => {
const sizeBeforeCompression = []
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-Dashboard-Item-statusSize').each((element) => {
const text = element.text()
diff --git a/e2e/cypress/integration/dashboard-transloadit.spec.ts b/e2e/cypress/integration/dashboard-transloadit.spec.ts
index 94f03454f5..16b50bee45 100644
--- a/e2e/cypress/integration/dashboard-transloadit.spec.ts
+++ b/e2e/cypress/integration/dashboard-transloadit.spec.ts
@@ -8,7 +8,9 @@ describe('Dashboard with Transloadit', () => {
})
it('should upload cat image successfully', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@assemblies', '@resumable']).then(() => {
@@ -28,18 +30,30 @@ describe('Dashboard with Transloadit', () => {
cy.window().then(({ uppy }) => {
cy.get('@file-input').selectFile(
- ['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg', 'cypress/fixtures/images/car.jpg'],
- { force:true },
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ 'cypress/fixtures/images/car.jpg',
+ ],
+ { force: true },
)
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@createAssemblies']).then(() => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).every((a: any) => a.pollInterval)).to.equal(true)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).every(
+ (a: any) => a.pollInterval,
+ ),
+ ).to.equal(true)
uppy.cancelAll()
cy.wait(['@delete']).then(() => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some((a: any) => a.pollInterval)).to.equal(false)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some(
+ (a: any) => a.pollInterval,
+ ),
+ ).to.equal(false)
})
})
})
@@ -55,7 +69,13 @@ describe('Dashboard with Transloadit', () => {
cy.window().then(({ uppy }) => {
uppy.on('transloadit:assembly-cancelled', spy)
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.intercept({
method: 'GET',
@@ -69,9 +89,11 @@ describe('Dashboard with Transloadit', () => {
{ method: 'DELETE', pathname: '/resumable/files/*', times: 2 },
{ statusCode: 204, body: {} },
).as('fileDeletion')
- cy.intercept(
- { method: 'DELETE', pathname: '/assemblies/*', times: 1 },
- ).as('assemblyDeletion')
+ cy.intercept({
+ method: 'DELETE',
+ pathname: '/assemblies/*',
+ times: 1,
+ }).as('assemblyDeletion')
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@assemblyPolling')
@@ -91,7 +113,13 @@ describe('Dashboard with Transloadit', () => {
cy.window().then(({ uppy }) => {
uppy.on('transloadit:assembly-cancelled', spy)
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.intercept({
method: 'GET',
@@ -105,47 +133,77 @@ describe('Dashboard with Transloadit', () => {
{ method: 'DELETE', pathname: '/resumable/files/*', times: 2 },
{ statusCode: 204, body: {} },
).as('fileDeletion')
- cy.intercept(
- { method: 'DELETE', pathname: '/assemblies/*', times: 1 },
- ).as('assemblyDeletion')
+ cy.intercept({
+ method: 'DELETE',
+ pathname: '/assemblies/*',
+ times: 1,
+ }).as('assemblyDeletion')
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@assemblyPolling')
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).every((a: any) => a.pollInterval)).to.equal(true)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).every(
+ (a: any) => a.pollInterval,
+ ),
+ ).to.equal(true)
const { files } = uppy.getState()
uppy.removeFiles(Object.keys(files))
cy.wait('@assemblyDeletion').then(() => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some((a: any) => a.pollInterval)).to.equal(false)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some(
+ (a: any) => a.pollInterval,
+ ),
+ ).to.equal(false)
expect(spy).to.be.calledOnce
})
})
})
it('should not create assembly when all individual files have been cancelled', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.window().then(({ uppy }) => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).length).to.equal(0)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).length,
+ ).to.equal(0)
const { files } = uppy.getState()
uppy.removeFiles(Object.keys(files))
cy.wait('@createAssemblies').then(() => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some((a: any) => a.pollInterval)).to.equal(false)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).some(
+ (a: any) => a.pollInterval,
+ ),
+ ).to.equal(false)
})
})
})
// Not working, the upstream changes have not landed yet.
it.skip('should create assembly if there is still one file to upload', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.window().then(({ uppy }) => {
- expect(Object.values(uppy.getPlugin('Transloadit').activeAssemblies).length).to.equal(0)
+ expect(
+ Object.values(uppy.getPlugin('Transloadit').activeAssemblies).length,
+ ).to.equal(0)
const { files } = uppy.getState()
const [fileID] = Object.keys(files)
@@ -160,7 +218,13 @@ describe('Dashboard with Transloadit', () => {
// Not working, the upstream changes have not landed yet.
it.skip('should complete upload if one gets cancelled mid-flight', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@createAssemblies')
@@ -176,7 +240,9 @@ describe('Dashboard with Transloadit', () => {
})
it('should not emit error if upload is cancelled right away', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
const handler = cy.spy()
@@ -193,81 +259,88 @@ describe('Dashboard with Transloadit', () => {
})
it('should not re-use erroneous tus keys', () => {
- function createAssemblyStatus ({ message, assembly_id, bytes_expected, ...other }) {
+ function createAssemblyStatus({
+ message,
+ assembly_id,
+ bytes_expected,
+ ...other
+ }) {
return {
message,
assembly_id,
- parent_id:null,
- account_id:'deadbeef',
- account_name:'foo',
- account_slug:'foo',
- template_id:null,
- template_name:null,
- instance:'test.transloadit.com',
- assembly_url:`http://api2.test.transloadit.com/assemblies/${assembly_id}`,
- assembly_ssl_url:`https://api2-test.transloadit.com/assemblies/${assembly_id}`,
- uppyserver_url:'https://api2-test.transloadit.com/companion/',
- companion_url:'https://api2-test.transloadit.com/companion/',
- websocket_url:'about:blank',
- tus_url:'https://api2-test.transloadit.com/resumable/files/',
- bytes_received:0,
+ parent_id: null,
+ account_id: 'deadbeef',
+ account_name: 'foo',
+ account_slug: 'foo',
+ template_id: null,
+ template_name: null,
+ instance: 'test.transloadit.com',
+ assembly_url: `http://api2.test.transloadit.com/assemblies/${assembly_id}`,
+ assembly_ssl_url: `https://api2-test.transloadit.com/assemblies/${assembly_id}`,
+ uppyserver_url: 'https://api2-test.transloadit.com/companion/',
+ companion_url: 'https://api2-test.transloadit.com/companion/',
+ websocket_url: 'about:blank',
+ tus_url: 'https://api2-test.transloadit.com/resumable/files/',
+ bytes_received: 0,
bytes_expected,
- upload_duration:0.162,
- client_agent:null,
- client_ip:null,
- client_referer:null,
- transloadit_client:'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
+ upload_duration: 0.162,
+ client_agent: null,
+ client_ip: null,
+ client_referer: null,
+ transloadit_client:
+ 'uppy-core:3.2.0,uppy-transloadit:3.1.3,uppy-tus:3.1.0,uppy-dropbox:3.1.1,uppy-box:2.1.1,uppy-facebook:3.1.1,uppy-google-drive:3.1.1,uppy-instagram:3.1.1,uppy-onedrive:3.1.1,uppy-zoom:2.1.1,uppy-url:3.3.1',
start_date: new Date().toISOString(),
- upload_meta_data_extracted:false,
- warnings:[],
- is_infinite:false,
- has_dupe_jobs:false,
- execution_start:null,
- execution_duration:null,
- queue_duration:0.009,
- jobs_queue_duration:0,
- notify_start:null,
- notify_url:null,
- notify_response_code:null,
- notify_response_data:null,
- notify_duration:null,
- last_job_completed:null,
- fields:{},
- running_jobs:[],
- bytes_usage:0,
- executing_jobs:[],
- started_jobs:[],
- parent_assembly_status:null,
- params:'{}',
- template:null,
- merged_params:'{}',
- expected_tus_uploads:1,
- started_tus_uploads:0,
- finished_tus_uploads:0,
- tus_uploads:[],
- uploads:[],
- results:{},
- build_id:'4765326956',
- status_endpoint:`https://api2-test.transloadit.com/assemblies/${assembly_id}`,
+ upload_meta_data_extracted: false,
+ warnings: [],
+ is_infinite: false,
+ has_dupe_jobs: false,
+ execution_start: null,
+ execution_duration: null,
+ queue_duration: 0.009,
+ jobs_queue_duration: 0,
+ notify_start: null,
+ notify_url: null,
+ notify_response_code: null,
+ notify_response_data: null,
+ notify_duration: null,
+ last_job_completed: null,
+ fields: {},
+ running_jobs: [],
+ bytes_usage: 0,
+ executing_jobs: [],
+ started_jobs: [],
+ parent_assembly_status: null,
+ params: '{}',
+ template: null,
+ merged_params: '{}',
+ expected_tus_uploads: 1,
+ started_tus_uploads: 0,
+ finished_tus_uploads: 0,
+ tus_uploads: [],
+ uploads: [],
+ results: {},
+ build_id: '4765326956',
+ status_endpoint: `https://api2-test.transloadit.com/assemblies/${assembly_id}`,
...other,
}
}
- cy.get('@file-input').selectFile(
- ['cypress/fixtures/images/cat.jpg'],
- { force:true },
- )
+ cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg'], {
+ force: true,
+ })
// SETUP for FIRST ATTEMPT (error response from Transloadit backend)
const assemblyIDAttempt1 = '500e56004f4347a288194edd7c7a0ae1'
const tusIDAttempt1 = 'a9daed4af4981880faf29b0e9596a14d'
cy.intercept('POST', 'https://api2.transloadit.com/assemblies', {
statusCode: 200,
- body: JSON.stringify(createAssemblyStatus({
- ok:'ASSEMBLY_UPLOADING',
- message:'The Assembly is still in the process of being uploaded.',
- assembly_id:assemblyIDAttempt1,
- bytes_expected:263871,
- })),
+ body: JSON.stringify(
+ createAssemblyStatus({
+ ok: 'ASSEMBLY_UPLOADING',
+ message: 'The Assembly is still in the process of being uploaded.',
+ assembly_id: assemblyIDAttempt1,
+ bytes_expected: 263871,
+ }),
+ ),
}).as('createAssembly')
cy.intercept('POST', 'https://api2-test.transloadit.com/resumable/files/', {
@@ -277,28 +350,42 @@ describe('Dashboard with Transloadit', () => {
},
times: 1,
}).as('tusCall')
- cy.intercept('PATCH', `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt1}`, {
- statusCode: 204,
- headers: {
- 'Upload-Length': '263871',
- 'Upload-Offset': '263871',
+ cy.intercept(
+ 'PATCH',
+ `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt1}`,
+ {
+ statusCode: 204,
+ headers: {
+ 'Upload-Length': '263871',
+ 'Upload-Offset': '263871',
+ },
+ times: 1,
},
- times: 1,
- })
- cy.intercept('HEAD', `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt1}`, { statusCode: 204 })
+ )
+ cy.intercept(
+ 'HEAD',
+ `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt1}`,
+ { statusCode: 204 },
+ )
- cy.intercept('GET', `https://api2-test.transloadit.com/assemblies/${assemblyIDAttempt1}`, {
- statusCode: 200,
- body: JSON.stringify(createAssemblyStatus({
- error:'INVALID_FILE_META_DATA',
- http_code:400,
- message:'Whatever error message from Transloadit backend',
- reason:'Whatever reason',
- msg:'Whatever error from Transloadit backend',
- assembly_id:'500e56004f4347a288194edd7c7a0ae1',
- bytes_expected:263871,
- })),
- }).as('failureReported')
+ cy.intercept(
+ 'GET',
+ `https://api2-test.transloadit.com/assemblies/${assemblyIDAttempt1}`,
+ {
+ statusCode: 200,
+ body: JSON.stringify(
+ createAssemblyStatus({
+ error: 'INVALID_FILE_META_DATA',
+ http_code: 400,
+ message: 'Whatever error message from Transloadit backend',
+ reason: 'Whatever reason',
+ msg: 'Whatever error from Transloadit backend',
+ assembly_id: '500e56004f4347a288194edd7c7a0ae1',
+ bytes_expected: 263871,
+ }),
+ ),
+ },
+ ).as('failureReported')
cy.intercept('POST', 'https://transloaditstatus.com/client_error', {
statusCode: 200,
@@ -315,55 +402,85 @@ describe('Dashboard with Transloadit', () => {
const tusIDAttempt2 = 'b8ebed4af4981880faf29b0e9596b25e'
cy.intercept('POST', 'https://api2.transloadit.com/assemblies', {
statusCode: 200,
- body: JSON.stringify(createAssemblyStatus({
- ok:'ASSEMBLY_UPLOADING',
- message:'The Assembly is still in the process of being uploaded.',
- assembly_id:assemblyIDAttempt2,
- tus_url:'https://api2-test.transloadit.com/resumable/files/attempt2',
- bytes_expected:263871,
- })),
+ body: JSON.stringify(
+ createAssemblyStatus({
+ ok: 'ASSEMBLY_UPLOADING',
+ message: 'The Assembly is still in the process of being uploaded.',
+ assembly_id: assemblyIDAttempt2,
+ tus_url: 'https://api2-test.transloadit.com/resumable/files/attempt2',
+ bytes_expected: 263871,
+ }),
+ ),
}).as('createAssembly-attempt2')
- cy.intercept('POST', 'https://api2-test.transloadit.com/resumable/files/attempt2', {
- statusCode: 201,
- headers: {
- 'Upload-Length': '263871',
- 'Upload-Offset': '0',
- Location: `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`,
+ cy.intercept(
+ 'POST',
+ 'https://api2-test.transloadit.com/resumable/files/attempt2',
+ {
+ statusCode: 201,
+ headers: {
+ 'Upload-Length': '263871',
+ 'Upload-Offset': '0',
+ Location: `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`,
+ },
+ times: 1,
},
- times: 1,
- }).as('tusCall-attempt2')
+ ).as('tusCall-attempt2')
- cy.intercept('PATCH', `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`, {
- statusCode: 204,
- headers: {
- 'Upload-Length': '263871',
- 'Upload-Offset': '263871',
- 'Tus-Resumable': '1.0.0',
+ cy.intercept(
+ 'PATCH',
+ `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`,
+ {
+ statusCode: 204,
+ headers: {
+ 'Upload-Length': '263871',
+ 'Upload-Offset': '263871',
+ 'Tus-Resumable': '1.0.0',
+ },
+ times: 1,
},
- times: 1,
- })
- cy.intercept('HEAD', `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`, { statusCode: 204 })
+ )
+ cy.intercept(
+ 'HEAD',
+ `https://api2-test.transloadit.com/resumable/files/${tusIDAttempt2}`,
+ { statusCode: 204 },
+ )
- cy.intercept('GET', `https://api2-test.transloadit.com/assemblies/${assemblyIDAttempt2}`, {
- statusCode: 200,
- body: JSON.stringify(createAssemblyStatus({
- ok:'ASSEMBLY_COMPLETED',
- http_code:200,
- message:'The Assembly was successfully completed.',
- assembly_id:assemblyIDAttempt2,
- bytes_received:263871,
- bytes_expected:263871,
- })),
- }).as('assemblyCompleted-attempt2')
+ cy.intercept(
+ 'GET',
+ `https://api2-test.transloadit.com/assemblies/${assemblyIDAttempt2}`,
+ {
+ statusCode: 200,
+ body: JSON.stringify(
+ createAssemblyStatus({
+ ok: 'ASSEMBLY_COMPLETED',
+ http_code: 200,
+ message: 'The Assembly was successfully completed.',
+ assembly_id: assemblyIDAttempt2,
+ bytes_received: 263871,
+ bytes_expected: 263871,
+ }),
+ ),
+ },
+ ).as('assemblyCompleted-attempt2')
// SECOND ATTEMPT
cy.get('.uppy-StatusBar-actions > .uppy-c-btn').click()
- cy.wait(['@createAssembly-attempt2', '@tusCall-attempt2', '@assemblyCompleted-attempt2'])
+ cy.wait([
+ '@createAssembly-attempt2',
+ '@tusCall-attempt2',
+ '@assemblyCompleted-attempt2',
+ ])
})
it('should complete on retry', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force: true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.intercept('POST', 'https://transloaditstatus.com/client_error', {
statusCode: 200,
@@ -386,7 +503,13 @@ describe('Dashboard with Transloadit', () => {
})
it('should complete when resuming after pause', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force: true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@createAssemblies')
diff --git a/e2e/cypress/integration/dashboard-tus.spec.ts b/e2e/cypress/integration/dashboard-tus.spec.ts
index b693330972..053089c7df 100644
--- a/e2e/cypress/integration/dashboard-tus.spec.ts
+++ b/e2e/cypress/integration/dashboard-tus.spec.ts
@@ -20,7 +20,9 @@ describe('Dashboard with Tus', () => {
})
it('should upload cat image successfully', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', { force:true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/cat.jpg', {
+ force: true,
+ })
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait(['@post', '@patch']).then(() => {
@@ -29,7 +31,9 @@ describe('Dashboard with Tus', () => {
})
it('should start exponential backoff when receiving HTTP 429', () => {
- cy.get('@file-input').selectFile('cypress/fixtures/images/baboon.png', { force: true })
+ cy.get('@file-input').selectFile('cypress/fixtures/images/baboon.png', {
+ force: true,
+ })
cy.intercept(
{ method: 'PATCH', pathname: '/files/*', times: 2 },
diff --git a/e2e/cypress/integration/dashboard-ui.spec.ts b/e2e/cypress/integration/dashboard-ui.spec.ts
index 6c9133d274..e38e9ec3e3 100644
--- a/e2e/cypress/integration/dashboard-ui.spec.ts
+++ b/e2e/cypress/integration/dashboard-ui.spec.ts
@@ -6,7 +6,13 @@ describe('dashboard-ui', () => {
})
it('should not throw when calling uppy.close()', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.window().then(({ uppy }) => {
expect(uppy.close()).to.not.throw
@@ -14,27 +20,37 @@ describe('dashboard-ui', () => {
})
it('should render thumbnails', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-Dashboard-Item-previewImg')
.should('have.length', 2)
.each((element) => expect(element).attr('src').to.include('blob:'))
})
it('should support drag&drop', () => {
- cy.get('@drop-target').selectFile([
- 'cypress/fixtures/images/cat.jpg',
- 'cypress/fixtures/images/cat-symbolic-link',
- 'cypress/fixtures/images/cat-symbolic-link.jpg',
- 'cypress/fixtures/images/traffic.jpg',
- ], { action: 'drag-drop' })
+ cy.get('@drop-target').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/cat-symbolic-link',
+ 'cypress/fixtures/images/cat-symbolic-link.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { action: 'drag-drop' },
+ )
- cy.get('.uppy-Dashboard-Item')
- .should('have.length', 4)
+ cy.get('.uppy-Dashboard-Item').should('have.length', 4)
cy.get('.uppy-Dashboard-Item-previewImg')
.should('have.length', 3)
.each((element) => expect(element).attr('src').to.include('blob:'))
cy.window().then(({ uppy }) => {
- expect(JSON.stringify(uppy.getFiles().map(file => file.meta.relativePath))).to.be.equal('[null,null,null,null]')
+ expect(
+ JSON.stringify(uppy.getFiles().map((file) => file.meta.relativePath)),
+ ).to.be.equal('[null,null,null,null]')
})
})
})
diff --git a/e2e/cypress/integration/dashboard-vue.spec.ts b/e2e/cypress/integration/dashboard-vue.spec.ts
index d36860d3b3..57d51b01f1 100644
--- a/e2e/cypress/integration/dashboard-vue.spec.ts
+++ b/e2e/cypress/integration/dashboard-vue.spec.ts
@@ -6,7 +6,13 @@ describe('dashboard-vue', () => {
// Only Vue 3 works in Parcel if you use SFC's but Vue 3 is broken in Uppy:
// https://github.com/transloadit/uppy/issues/2877
xit('should render in Vue 3 and show thumbnails', () => {
- cy.get('@file-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@file-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('.uppy-Dashboard-Item-previewImg')
.should('have.length', 2)
.each((element) => expect(element).attr('src').to.include('blob:'))
diff --git a/e2e/cypress/integration/dashboard-xhr.spec.ts b/e2e/cypress/integration/dashboard-xhr.spec.ts
index 2b7e057f7c..e21ee08caa 100644
--- a/e2e/cypress/integration/dashboard-xhr.spec.ts
+++ b/e2e/cypress/integration/dashboard-xhr.spec.ts
@@ -1,4 +1,9 @@
-import { interceptCompanionUrlRequest, interceptCompanionUnsplashRequest, runRemoteUrlImageUploadTest, runRemoteUnsplashUploadTest } from './reusable-tests'
+import {
+ interceptCompanionUrlRequest,
+ interceptCompanionUnsplashRequest,
+ runRemoteUrlImageUploadTest,
+ runRemoteUnsplashUploadTest,
+} from './reusable-tests'
describe('Dashboard with XHR', () => {
beforeEach(() => {
@@ -14,7 +19,9 @@ describe('Dashboard with XHR', () => {
it('should return correct file name with URL plugin from remote image with Content-Disposition', () => {
const fileName = `DALL·E IMG_9078 - 学中文 🤑`
cy.get('[data-cy="Url"]').click()
- cy.get('.uppy-Url-input').type('http://localhost:4678/file-with-content-disposition')
+ cy.get('.uppy-Url-input').type(
+ 'http://localhost:4678/file-with-content-disposition',
+ )
cy.get('.uppy-Url-importButton').click()
cy.wait('@url').then(() => {
cy.get('.uppy-Dashboard-Item-name').should('contain', fileName)
@@ -40,7 +47,9 @@ describe('Dashboard with XHR', () => {
}).as('url')
cy.get('[data-cy="Url"]').click()
- cy.get('.uppy-Url-input').type('http://localhost:4678/file-with-content-disposition')
+ cy.get('.uppy-Url-input').type(
+ 'http://localhost:4678/file-with-content-disposition',
+ )
cy.get('.uppy-Url-importButton').click()
cy.wait('@url').then(() => {
cy.get('.uppy-Dashboard-Item-name').should('contain', 'file-with')
diff --git a/e2e/cypress/integration/react.spec.ts b/e2e/cypress/integration/react.spec.ts
index b3120e7b57..c937e35070 100644
--- a/e2e/cypress/integration/react.spec.ts
+++ b/e2e/cypress/integration/react.spec.ts
@@ -7,7 +7,13 @@ describe('@uppy/react', () => {
})
it('should render Dashboard in React and show thumbnails', () => {
- cy.get('@dashboard-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@dashboard-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('#dashboard .uppy-Dashboard-Item-previewImg')
.should('have.length', 2)
.each((element) => expect(element).attr('src').to.include('blob:'))
@@ -15,7 +21,13 @@ describe('@uppy/react', () => {
it('should render Modal in React and show thumbnails', () => {
cy.get('#open').click()
- cy.get('@modal-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@modal-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
cy.get('#modal .uppy-Dashboard-Item-previewImg')
.should('have.length', 2)
.each((element) => expect(element).attr('src').to.include('blob:'))
@@ -25,7 +37,13 @@ describe('@uppy/react', () => {
const spy = cy.spy()
cy.window().then(({ uppy }) => uppy.on('thumbnail:generated', spy))
- cy.get('@dragdrop-input').selectFile(['cypress/fixtures/images/cat.jpg', 'cypress/fixtures/images/traffic.jpg'], { force:true })
+ cy.get('@dragdrop-input').selectFile(
+ [
+ 'cypress/fixtures/images/cat.jpg',
+ 'cypress/fixtures/images/traffic.jpg',
+ ],
+ { force: true },
+ )
// not sure how I can accurately wait for the thumbnail
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(1000).then(() => expect(spy).to.be.called)
diff --git a/e2e/cypress/integration/reusable-tests.ts b/e2e/cypress/integration/reusable-tests.ts
index 1e5ada2c4d..f60d29de53 100644
--- a/e2e/cypress/integration/reusable-tests.ts
+++ b/e2e/cypress/integration/reusable-tests.ts
@@ -1,11 +1,15 @@
/* global cy */
-export const interceptCompanionUrlRequest = () => cy.intercept('http://localhost:3020/url/*').as('url')
-export const interceptCompanionUnsplashRequest = () => cy.intercept('http://localhost:3020/search/unsplash/*').as('unsplash')
+export const interceptCompanionUrlRequest = () =>
+ cy.intercept('http://localhost:3020/url/*').as('url')
+export const interceptCompanionUnsplashRequest = () =>
+ cy.intercept('http://localhost:3020/search/unsplash/*').as('unsplash')
-export function runRemoteUrlImageUploadTest () {
+export function runRemoteUrlImageUploadTest() {
cy.get('[data-cy="Url"]').click()
- cy.get('.uppy-Url-input').type('https://raw.githubusercontent.com/transloadit/uppy/main/e2e/cypress/fixtures/images/cat.jpg')
+ cy.get('.uppy-Url-input').type(
+ 'https://raw.githubusercontent.com/transloadit/uppy/main/e2e/cypress/fixtures/images/cat.jpg',
+ )
cy.get('.uppy-Url-importButton').click()
cy.get('.uppy-StatusBar-actionBtn--upload').click()
cy.wait('@url').then(() => {
@@ -13,7 +17,7 @@ export function runRemoteUrlImageUploadTest () {
})
}
-export function runRemoteUnsplashUploadTest () {
+export function runRemoteUnsplashUploadTest() {
cy.get('[data-cy="Unsplash"]').click()
cy.get('.uppy-SearchProvider-input').type('book')
cy.get('.uppy-SearchProvider-searchButton').click()
diff --git a/e2e/cypress/support/createFakeFile.ts b/e2e/cypress/support/createFakeFile.ts
index 4e55087126..825cae6ffc 100644
--- a/e2e/cypress/support/createFakeFile.ts
+++ b/e2e/cypress/support/createFakeFile.ts
@@ -2,7 +2,7 @@ declare global {
namespace Cypress {
interface Chainable {
// eslint-disable-next-line no-use-before-define
- createFakeFile: typeof createFakeFile;
+ createFakeFile: typeof createFakeFile
}
}
}
@@ -14,14 +14,21 @@ interface File {
data: Blob
}
-export function createFakeFile (name?: string, type?: string, b64?: string): File {
- // eslint-disable-next-line no-param-reassign
- if (!b64) b64 = 'PHN2ZyB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiLz4KPC9zdmc+Cg=='
+export function createFakeFile(
+ name?: string,
+ type?: string,
+ b64?: string,
+): File {
+ if (!b64) {
+ // eslint-disable-next-line no-param-reassign
+ b64 =
+ 'PHN2ZyB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+CiAgPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNTAiLz4KPC9zdmc+Cg=='
+ }
// eslint-disable-next-line no-param-reassign
if (!type) type = 'image/svg+xml'
// https://stackoverflow.com/questions/16245767/creating-a-blob-from-a-base64-string-in-javascript
- function base64toBlob (base64Data: string, contentType = '') {
+ function base64toBlob(base64Data: string, contentType = '') {
const sliceSize = 1024
const byteCharacters = atob(base64Data)
const bytesLength = byteCharacters.length
diff --git a/e2e/cypress/support/e2e.ts b/e2e/cypress/support/e2e.ts
index 7583ae8e57..a848280213 100644
--- a/e2e/cypress/support/e2e.ts
+++ b/e2e/cypress/support/e2e.ts
@@ -21,6 +21,6 @@ import './commands'
// eslint-disable-next-line
// @ts-ignore
-import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector.js'
+import installLogsCollector from 'cypress-terminal-report/src/installLogsCollector.js'
installLogsCollector()
diff --git a/examples/angular-example/.eslintrc.json b/examples/angular-example/.eslintrc.json
index 0ed227af25..6eee1d5d5c 100644
--- a/examples/angular-example/.eslintrc.json
+++ b/examples/angular-example/.eslintrc.json
@@ -1,12 +1,8 @@
{
- "ignorePatterns": [
- "projects/**/*"
- ],
+ "ignorePatterns": ["projects/**/*"],
"overrides": [
{
- "files": [
- "*.ts"
- ],
+ "files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
@@ -37,9 +33,7 @@
}
},
{
- "files": [
- "star.html"
- ],
+ "files": ["star.html"],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
diff --git a/examples/angular-example/angular.json b/examples/angular-example/angular.json
index 51f5b5714f..f40ebd3c9f 100644
--- a/examples/angular-example/angular.json
+++ b/examples/angular-example/angular.json
@@ -16,17 +16,10 @@
"outputPath": "dist/angular-example",
"index": "src/index.html",
"main": "src/main.ts",
- "polyfills": [
- "zone.js"
- ],
+ "polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
- "assets": [
- "src/favicon.ico",
- "src/assets"
- ],
- "styles": [
- "src/styles.css"
- ],
+ "assets": ["src/favicon.ico", "src/assets"],
+ "styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
@@ -77,36 +70,23 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
- "polyfills": [
- "zone.js",
- "zone.js/testing"
- ],
+ "polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
- "assets": [
- "src/favicon.ico",
- "src/assets"
- ],
- "styles": [
- "src/styles.css"
- ],
+ "assets": ["src/favicon.ico", "src/assets"],
+ "styles": ["src/styles.css"],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
- "lintFilePatterns": [
- "src/**/*.ts",
- "src/**/*.html"
- ]
+ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
}
}
}
}
},
"cli": {
- "schematicCollections": [
- "@angular-eslint/schematics"
- ]
+ "schematicCollections": ["@angular-eslint/schematics"]
}
}
diff --git a/examples/angular-example/src/app/app.component.html b/examples/angular-example/src/app/app.component.html
index e4e763e743..36092f8cbe 100644
--- a/examples/angular-example/src/app/app.component.html
+++ b/examples/angular-example/src/app/app.component.html
@@ -9,7 +9,9 @@
diff --git a/examples/node-xhr/index.html b/examples/node-xhr/index.html
index b768a79a1a..54b683f268 100644
--- a/examples/node-xhr/index.html
+++ b/examples/node-xhr/index.html
@@ -1,8 +1,8 @@
-
+
-
-
+
+
Node.js + Uppy Example
diff --git a/examples/php-xhr/index.html b/examples/php-xhr/index.html
index 8a98441ecf..e1e3db298f 100644
--- a/examples/php-xhr/index.html
+++ b/examples/php-xhr/index.html
@@ -1,8 +1,8 @@
-
+
-
-
+
+
PHP + Uppy Example
diff --git a/examples/python-xhr/index.html b/examples/python-xhr/index.html
index 0e89baa514..65bdb392a7 100644
--- a/examples/python-xhr/index.html
+++ b/examples/python-xhr/index.html
@@ -1,8 +1,8 @@
-
+
-
-
+
+
Python + Uppy Example
diff --git a/examples/react-example/index.html b/examples/react-example/index.html
index be17dd91ff..7a885b5b25 100644
--- a/examples/react-example/index.html
+++ b/examples/react-example/index.html
@@ -1,10 +1,10 @@
-
+
-
-
+
+
Uppy React Example
-
+
diff --git a/examples/react-native-expo/app.json b/examples/react-native-expo/app.json
index d5b376e76e..f9755f55e3 100644
--- a/examples/react-native-expo/app.json
+++ b/examples/react-native-expo/app.json
@@ -13,9 +13,7 @@
"updates": {
"fallbackToCacheTimeout": 0
},
- "assetBundlePatterns": [
- "**/*"
- ],
+ "assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
diff --git a/examples/redux/index.html b/examples/redux/index.html
index 94009877f7..54e51d3712 100644
--- a/examples/redux/index.html
+++ b/examples/redux/index.html
@@ -1,8 +1,8 @@
-
+
-
-
+
+
Uppy example: Redux
diff --git a/examples/svelte-example/public/global.css b/examples/svelte-example/public/global.css
index 5d532f6b91..619a92f331 100644
--- a/examples/svelte-example/public/global.css
+++ b/examples/svelte-example/public/global.css
@@ -10,7 +10,8 @@ body {
margin: 0;
padding: 8px;
box-sizing: border-box;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
+ Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}
a {
@@ -64,4 +65,4 @@ button:not(:disabled):active {
button:focus {
border-color: #666;
-}
\ No newline at end of file
+}
diff --git a/examples/svelte-example/public/index.html b/examples/svelte-example/public/index.html
index 943e7a25f8..2b86c92861 100644
--- a/examples/svelte-example/public/index.html
+++ b/examples/svelte-example/public/index.html
@@ -1,17 +1,16 @@
-
+
-
-
-
+
+
+
- Svelte app
+ Svelte app
-
-
-
-
-
+
+
+
+
+
-
-
+
diff --git a/examples/svelte-example/tsconfig.json b/examples/svelte-example/tsconfig.json
index 3575716026..47bdb60e94 100644
--- a/examples/svelte-example/tsconfig.json
+++ b/examples/svelte-example/tsconfig.json
@@ -1,8 +1,7 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
- "compilerOptions": {
- },
+ "compilerOptions": {},
"esModuleInterop": true,
"include": ["src/**/*"],
"exclude": ["node_modules/*", "__sapper__/*", "public/*"]
-}
\ No newline at end of file
+}
diff --git a/examples/transloadit-markdown-bin/index.html b/examples/transloadit-markdown-bin/index.html
index 6c9bee1bfe..3868967f29 100644
--- a/examples/transloadit-markdown-bin/index.html
+++ b/examples/transloadit-markdown-bin/index.html
@@ -1,21 +1,31 @@
-
+
-
+
- Uppy Transloadit playground
+
+ Uppy Transloadit
+
+ playground
+
- This page contains small examples for different ways you can use Uppy with Transloadit. Please see the Github repository for the source code.
+ This page contains small examples for different ways you can use Uppy
+ with Transloadit. Please see the
+ Github repository
+ for the source code.
-
+
Form
- The form API allows you to easily send files through Transloadit’s encoding backend. When the user submits the form, any files are uploaded to Transloadit. The form data is then sent to your own backend, with additional data about the Transloadit Assemblies that were started.
+ The form API allows you to easily send files through Transloadit’s
+ encoding backend. When the user submits the form, any files are uploaded
+ to Transloadit. The form data is then sent to your own backend, with
+ additional data about the Transloadit Assemblies that were started.
-
- Upload
-
+ Upload
-
+
-
+
Form with inline Dashboard
-
- You can also use the Dashboard UI inside a plain old HTML form.
-
-
+ You can also use the Dashboard UI inside a plain old HTML form.
+
leave a message
- name:
-
+ name:
+
- message:
+ message:
@@ -91,39 +119,47 @@ Form with inline Dashboard
-
- Upload
-
+ Upload
-
+
-
+
Inline Dashboard
- The robodog.dashboard
API allows you to embed a Dashboard at any location. Users can continuously upload files through this UI, so please make sure this fits your use case!
+ The robodog.dashboard
API allows you to embed a Dashboard
+ at any location. Users can continuously upload files through this UI, so
+ please make sure this fits your use case!
-
+
Dashboard Modal
- This API is a one-shot upload UI using a modal overlay. Call the function and receive a listen to an event with upload results ✌️
+ This API is a one-shot upload UI using a modal overlay. Call the
+ function and receive a listen to an event with upload results ✌️
Open
uppy.upload()
+ An <input type=file> backed by uppy.upload()
:
- An <input type=file> backed by uppy.upload()
:
-
-
-
+
-
+
diff --git a/examples/uppy-with-companion/client/index.html b/examples/uppy-with-companion/client/index.html
index 5206c7c291..f21eeeaeec 100644
--- a/examples/uppy-with-companion/client/index.html
+++ b/examples/uppy-with-companion/client/index.html
@@ -1,21 +1,36 @@
-
+
-
-
-
+
+
+
Open Modal
This web page requires JavaScript to work properly.
-
-
-
-
-
+
+
+
+
-
-
-
+
+
+
+
diff --git a/packages/@uppy/angular/.eslintrc.json b/packages/@uppy/angular/.eslintrc.json
index 2304954633..54e1cd9a19 100644
--- a/packages/@uppy/angular/.eslintrc.json
+++ b/packages/@uppy/angular/.eslintrc.json
@@ -1,12 +1,8 @@
{
- "ignorePatterns": [
- "projects/**/*"
- ],
+ "ignorePatterns": ["projects/**/*"],
"overrides": [
{
- "files": [
- "*.ts"
- ],
+ "files": ["*.ts"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
@@ -14,6 +10,7 @@
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
+ // eslint-disable-line import/newline-after-import
"@angular-eslint/directive-selector": [
"error",
{
@@ -37,9 +34,7 @@
}
},
{
- "files": [
- "*.html"
- ],
+ "files": ["*.html"],
"extends": [
"plugin:@angular-eslint/template/recommended",
"plugin:@angular-eslint/template/accessibility"
diff --git a/packages/@uppy/angular/angular.json b/packages/@uppy/angular/angular.json
index b0febadbde..3aa602c2de 100644
--- a/packages/@uppy/angular/angular.json
+++ b/packages/@uppy/angular/angular.json
@@ -28,10 +28,7 @@
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/uppy/angular/tsconfig.spec.json",
- "polyfills": [
- "zone.js",
- "zone.js/testing"
- ]
+ "polyfills": ["zone.js", "zone.js/testing"]
}
}
}
diff --git a/packages/@uppy/angular/projects/uppy/angular/.eslintrc.json b/packages/@uppy/angular/projects/uppy/angular/.eslintrc.json
index 2ab1305077..67ef3094ec 100644
--- a/packages/@uppy/angular/projects/uppy/angular/.eslintrc.json
+++ b/packages/@uppy/angular/projects/uppy/angular/.eslintrc.json
@@ -1,13 +1,9 @@
{
"extends": "../../../.eslintrc.json",
- "ignorePatterns": [
- "!**/*"
- ],
+ "ignorePatterns": ["!**/*"],
"overrides": [
{
- "files": [
- "*.ts"
- ],
+ "files": ["*.ts"],
"parserOptions": {
"project": [
"packages/@uppy/angular/projects/angular/tsconfig.lib.json",
@@ -43,9 +39,7 @@
}
},
{
- "files": [
- "*.html"
- ],
+ "files": ["*.html"],
"rules": {}
}
]
diff --git a/packages/@uppy/angular/projects/uppy/angular/ng-package.json b/packages/@uppy/angular/projects/uppy/angular/ng-package.json
index 5d14d4e69f..fab7346366 100644
--- a/packages/@uppy/angular/projects/uppy/angular/ng-package.json
+++ b/packages/@uppy/angular/projects/uppy/angular/ng-package.json
@@ -4,4 +4,4 @@
"lib": {
"entryFile": "src/public-api.ts"
}
-}
\ No newline at end of file
+}
diff --git a/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts b/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts
index 4351587147..8a4b78bf92 100644
--- a/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts
+++ b/packages/@uppy/angular/projects/uppy/angular/src/public-api.ts
@@ -2,13 +2,13 @@
* Public API Surface of @uppy/angular
*/
-export { UppyAngularDashboardModule } from './lib/components/dashboard/dashboard.module'
-export { UppyAngularDashboardModalModule } from './lib/components/dashboard-modal/dashboard-modal.module'
-export { UppyAngularProgressBarModule } from './lib/components/progress-bar/progress-bar.module'
-export { UppyAngularStatusBarModule } from './lib/components/status-bar/status-bar.module'
-export { UppyAngularDragDropModule } from './lib/components/drag-drop/drag-drop.module'
-export { StatusBarComponent } from './lib/components/status-bar/status-bar.component'
-export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component'
-export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component'
-export { DashboardComponent } from './lib/components/dashboard/dashboard.component'
-export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component'
+export { UppyAngularDashboardModule } from './lib/components/dashboard/dashboard.module';
+export { UppyAngularDashboardModalModule } from './lib/components/dashboard-modal/dashboard-modal.module';
+export { UppyAngularProgressBarModule } from './lib/components/progress-bar/progress-bar.module';
+export { UppyAngularStatusBarModule } from './lib/components/status-bar/status-bar.module';
+export { UppyAngularDragDropModule } from './lib/components/drag-drop/drag-drop.module';
+export { StatusBarComponent } from './lib/components/status-bar/status-bar.component';
+export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component';
+export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component';
+export { DashboardComponent } from './lib/components/dashboard/dashboard.component';
+export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component';
diff --git a/packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json b/packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json
index 879250df42..f73c766cf7 100644
--- a/packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json
+++ b/packages/@uppy/angular/projects/uppy/angular/tsconfig.lib.json
@@ -8,7 +8,5 @@
"inlineSources": true,
"types": []
},
- "exclude": [
- "**/*.spec.ts"
- ]
+ "exclude": ["**/*.spec.ts"]
}
diff --git a/packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json b/packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json
index 80f875ef27..3a8a02edf6 100644
--- a/packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json
+++ b/packages/@uppy/angular/projects/uppy/angular/tsconfig.spec.json
@@ -3,12 +3,7 @@
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "../../../out-tsc/spec",
- "types": [
- "jasmine"
- ]
+ "types": ["jasmine"]
},
- "include": [
- "**/*.spec.ts",
- "**/*.d.ts"
- ]
+ "include": ["**/*.spec.ts", "**/*.d.ts"]
}
diff --git a/packages/@uppy/angular/tsconfig.json b/packages/@uppy/angular/tsconfig.json
index 8ee11a4611..ccfa195bcb 100644
--- a/packages/@uppy/angular/tsconfig.json
+++ b/packages/@uppy/angular/tsconfig.json
@@ -3,9 +3,7 @@
"compileOnSave": false,
"compilerOptions": {
"paths": {
- "@uppy/angular": [
- "dist/uppy/angular"
- ]
+ "@uppy/angular": ["dist/uppy/angular"]
},
"baseUrl": "./",
"outDir": "./dist/out-tsc",
@@ -24,10 +22,7 @@
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
- "lib": [
- "ES2022",
- "dom"
- ]
+ "lib": ["ES2022", "dom"]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
diff --git a/packages/@uppy/audio/src/style.scss b/packages/@uppy/audio/src/style.scss
index e5f9ed6a64..692a31088f 100644
--- a/packages/@uppy/audio/src/style.scss
+++ b/packages/@uppy/audio/src/style.scss
@@ -59,14 +59,18 @@
display: block;
font-size: 16px;
line-height: 1.2;
- padding: .4em 1em .3em .4em;
+ padding: 0.4em 1em 0.3em 0.4em;
width: 100%;
max-width: 90%;
border: 1px solid $gray-600;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23757575%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
background-repeat: no-repeat;
- background-position: right .4em top 50%, 0 0;
- background-size: .65em auto, 100%;
+ background-position:
+ right 0.4em top 50%,
+ 0 0;
+ background-size:
+ 0.65em auto,
+ 100%;
margin: auto;
margin-bottom: 10px;
white-space: nowrap;
@@ -78,9 +82,9 @@
}
}
- .uppy-Audio-audioSource-select::-ms-expand {
- display: none;
- }
+.uppy-Audio-audioSource-select::-ms-expand {
+ display: none;
+}
.uppy-Audio-buttonContainer {
width: 50%;
@@ -120,7 +124,7 @@
background-color: darken($red, 5%);
}
- [data-uppy-theme="dark"] & {
+ [data-uppy-theme='dark'] & {
@include blue-border-focus--dark;
}
}
@@ -187,7 +191,7 @@
text-align: center;
color: $gray-800;
- [data-uppy-theme="dark"] & {
+ [data-uppy-theme='dark'] & {
color: $gray-200;
}
}
diff --git a/packages/@uppy/aws-s3-multipart/types/chunk.d.ts b/packages/@uppy/aws-s3-multipart/types/chunk.d.ts
index 2a9980d33b..a01c6b5289 100644
--- a/packages/@uppy/aws-s3-multipart/types/chunk.d.ts
+++ b/packages/@uppy/aws-s3-multipart/types/chunk.d.ts
@@ -1,7 +1,7 @@
export interface Chunk {
- getData: () => Blob
- onProgress: (ev: ProgressEvent) => void
- onComplete: (etag: string) => void
- shouldUseMultipart: boolean
- setAsUploaded?: () => void
+ getData: () => Blob
+ onProgress: (ev: ProgressEvent) => void
+ onComplete: (etag: string) => void
+ shouldUseMultipart: boolean
+ setAsUploaded?: () => void
}
diff --git a/packages/@uppy/aws-s3-multipart/types/index.d.ts b/packages/@uppy/aws-s3-multipart/types/index.d.ts
index ef53079b9f..40adc5b8ea 100644
--- a/packages/@uppy/aws-s3-multipart/types/index.d.ts
+++ b/packages/@uppy/aws-s3-multipart/types/index.d.ts
@@ -2,19 +2,21 @@ import type { BasePlugin, PluginOptions, UppyFile } from '@uppy/core'
type MaybePromise = T | Promise
-export type AwsS3UploadParameters = {
- method: 'POST'
- url: string
- fields: Record
- expires?: number
- headers?: Record
-} | {
- method?: 'PUT'
- url: string
- fields?: Record
- expires?: number
- headers?: Record
-}
+export type AwsS3UploadParameters =
+ | {
+ method: 'POST'
+ url: string
+ fields: Record
+ expires?: number
+ headers?: Record
+ }
+ | {
+ method?: 'PUT'
+ url: string
+ fields?: Record
+ expires?: number
+ headers?: Record
+ }
export interface AwsS3Part {
PartNumber?: number
@@ -44,88 +46,101 @@ type AWSS3NonMultipartWithCompanionMandatory = {
}
type AWSS3NonMultipartWithoutCompanionMandatory = {
- getUploadParameters: (
- file: UppyFile
- ) => MaybePromise
+ getUploadParameters: (file: UppyFile) => MaybePromise
}
type AWSS3NonMultipartWithCompanion = AWSS3WithCompanion &
- AWSS3NonMultipartWithCompanionMandatory &
- {
- shouldUseMultipart: false
- createMultipartUpload?: never
- listParts?: never
- signPart?: never
- abortMultipartUpload?: never
- completeMultipartUpload?: never
- }
+ AWSS3NonMultipartWithCompanionMandatory & {
+ shouldUseMultipart: false
+ createMultipartUpload?: never
+ listParts?: never
+ signPart?: never
+ abortMultipartUpload?: never
+ completeMultipartUpload?: never
+ }
type AWSS3NonMultipartWithoutCompanion = AWSS3WithoutCompanion &
- AWSS3NonMultipartWithoutCompanionMandatory &
- {
- shouldUseMultipart: false
- createMultipartUpload?: never
- listParts?: never
- signPart?: never
- abortMultipartUpload?: never
- completeMultipartUpload?: never
- }
+ AWSS3NonMultipartWithoutCompanionMandatory & {
+ shouldUseMultipart: false
+ createMultipartUpload?: never
+ listParts?: never
+ signPart?: never
+ abortMultipartUpload?: never
+ completeMultipartUpload?: never
+ }
type AWSS3MultipartWithoutCompanionMandatory = {
getChunkSize?: (file: UppyFile) => number
createMultipartUpload: (
- file: UppyFile
+ file: UppyFile,
) => MaybePromise<{ uploadId: string; key: string }>
listParts: (
file: UppyFile,
- opts: { uploadId: string; key: string; signal: AbortSignal }
+ opts: { uploadId: string; key: string; signal: AbortSignal },
) => MaybePromise
abortMultipartUpload: (
file: UppyFile,
- opts: { uploadId: string; key: string; signal: AbortSignal }
+ opts: { uploadId: string; key: string; signal: AbortSignal },
) => MaybePromise
completeMultipartUpload: (
file: UppyFile,
- opts: { uploadId: string; key: string; parts: AwsS3Part[]; signal: AbortSignal }
+ opts: {
+ uploadId: string
+ key: string
+ parts: AwsS3Part[]
+ signal: AbortSignal
+ },
) => MaybePromise<{ location?: string }>
-} & ({
- signPart: (
- file: UppyFile,
- opts: { uploadId: string; key: string; partNumber: number; body: Blob; signal: AbortSignal }
- ) => MaybePromise
-} | {
- /** @deprecated Use signPart instead */
- prepareUploadParts: (
- file: UppyFile,
- partData: { uploadId: string; key: string; parts: [{ number: number, chunk: Blob }] }
- ) => MaybePromise<{ presignedUrls: Record, headers?: Record> }>
-})
+} & (
+ | {
+ signPart: (
+ file: UppyFile,
+ opts: {
+ uploadId: string
+ key: string
+ partNumber: number
+ body: Blob
+ signal: AbortSignal
+ },
+ ) => MaybePromise
+ }
+ | {
+ /** @deprecated Use signPart instead */
+ prepareUploadParts: (
+ file: UppyFile,
+ partData: {
+ uploadId: string
+ key: string
+ parts: [{ number: number; chunk: Blob }]
+ },
+ ) => MaybePromise<{
+ presignedUrls: Record
+ headers?: Record>
+ }>
+ }
+)
type AWSS3MultipartWithoutCompanion = AWSS3WithoutCompanion &
- AWSS3MultipartWithoutCompanionMandatory &
- {
- shouldUseMultipart?: true
- getUploadParameters?: never
- }
+ AWSS3MultipartWithoutCompanionMandatory & {
+ shouldUseMultipart?: true
+ getUploadParameters?: never
+ }
type AWSS3MultipartWithCompanion = AWSS3WithCompanion &
- Partial &
- {
- shouldUseMultipart?: true
- getUploadParameters?: never
- }
+ Partial & {
+ shouldUseMultipart?: true
+ getUploadParameters?: never
+ }
type AWSS3MaybeMultipartWithCompanion = AWSS3WithCompanion &
- Partial &
- AWSS3NonMultipartWithCompanionMandatory &
- {
- shouldUseMultipart: ((file: UppyFile) => boolean)
- }
+ Partial &
+ AWSS3NonMultipartWithCompanionMandatory & {
+ shouldUseMultipart: (file: UppyFile) => boolean
+ }
type AWSS3MaybeMultipartWithoutCompanion = AWSS3WithoutCompanion &
- AWSS3MultipartWithoutCompanionMandatory &
- AWSS3NonMultipartWithoutCompanionMandatory &
- {
- shouldUseMultipart: ((file: UppyFile) => boolean)
- }
+ AWSS3MultipartWithoutCompanionMandatory &
+ AWSS3NonMultipartWithoutCompanionMandatory & {
+ shouldUseMultipart: (file: UppyFile) => boolean
+ }
type AWSS3WithCompanion = {
companionUrl: string
@@ -137,24 +152,27 @@ type AWSS3WithoutCompanion = {
companionUrl?: never
companionHeaders?: never
companionCookiesRule?: never
- getTemporarySecurityCredentials?: (options?: {signal?: AbortSignal}) => MaybePromise
+ getTemporarySecurityCredentials?: (options?: {
+ signal?: AbortSignal
+ }) => MaybePromise
}
interface _AwsS3MultipartOptions extends PluginOptions {
- allowedMetaFields?: string[] | null
- limit?: number
- retryDelays?: number[] | null
+ allowedMetaFields?: string[] | null
+ limit?: number
+ retryDelays?: number[] | null
}
-export type AwsS3MultipartOptions = _AwsS3MultipartOptions & (AWSS3NonMultipartWithCompanion |
- AWSS3NonMultipartWithoutCompanion |
- AWSS3MultipartWithCompanion |
- AWSS3MultipartWithoutCompanion |
- AWSS3MaybeMultipartWithCompanion |
- AWSS3MaybeMultipartWithoutCompanion)
+export type AwsS3MultipartOptions = _AwsS3MultipartOptions &
+ (
+ | AWSS3NonMultipartWithCompanion
+ | AWSS3NonMultipartWithoutCompanion
+ | AWSS3MultipartWithCompanion
+ | AWSS3MultipartWithoutCompanion
+ | AWSS3MaybeMultipartWithCompanion
+ | AWSS3MaybeMultipartWithoutCompanion
+ )
-declare class AwsS3Multipart extends BasePlugin<
- AwsS3MultipartOptions
-> {}
+declare class AwsS3Multipart extends BasePlugin {}
export default AwsS3Multipart
diff --git a/packages/@uppy/aws-s3-multipart/types/index.test-d.ts b/packages/@uppy/aws-s3-multipart/types/index.test-d.ts
index 4ccadd71a8..1287eca958 100644
--- a/packages/@uppy/aws-s3-multipart/types/index.test-d.ts
+++ b/packages/@uppy/aws-s3-multipart/types/index.test-d.ts
@@ -8,17 +8,17 @@ import type { AwsS3Part } from '..'
const uppy = new Uppy()
uppy.use(AwsS3Multipart, {
shouldUseMultipart: true,
- createMultipartUpload (file) {
+ createMultipartUpload(file) {
expectType(file)
return { uploadId: '', key: '' }
},
- listParts (file, opts) {
+ listParts(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
return []
},
- signPart (file, opts) {
+ signPart(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
@@ -26,12 +26,12 @@ import type { AwsS3Part } from '..'
expectType(opts.signal)
return { url: '' }
},
- abortMultipartUpload (file, opts) {
+ abortMultipartUpload(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
},
- completeMultipartUpload (file, opts) {
+ completeMultipartUpload(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
@@ -44,7 +44,15 @@ import type { AwsS3Part } from '..'
{
const uppy = new Uppy()
expectError(uppy.use(AwsS3Multipart, { companionUrl: '', getChunkSize: 100 }))
- expectError(uppy.use(AwsS3Multipart, { companionUrl: '', getChunkSize: () => 'not a number' }))
+ expectError(
+ uppy.use(AwsS3Multipart, {
+ companionUrl: '',
+ getChunkSize: () => 'not a number',
+ }),
+ )
uppy.use(AwsS3Multipart, { companionUrl: '', getChunkSize: () => 100 })
- uppy.use(AwsS3Multipart, { companionUrl: '', getChunkSize: (file) => file.size })
+ uppy.use(AwsS3Multipart, {
+ companionUrl: '',
+ getChunkSize: (file) => file.size,
+ })
}
diff --git a/packages/@uppy/aws-s3/types/index.d.ts b/packages/@uppy/aws-s3/types/index.d.ts
index 04b1104140..7a146aec15 100644
--- a/packages/@uppy/aws-s3/types/index.d.ts
+++ b/packages/@uppy/aws-s3/types/index.d.ts
@@ -3,34 +3,36 @@ import type { BasePlugin, Locale, PluginOptions, UppyFile } from '@uppy/core'
type MaybePromise = T | Promise
-export type AwsS3UploadParameters = {
- method?: 'POST'
- url: string
- fields?: Record
- expires?: number
- headers?: Record
-} | {
- method: 'PUT'
- url: string
- fields?: Record
- expires?: number
- headers?: Record
-}
+export type AwsS3UploadParameters =
+ | {
+ method?: 'POST'
+ url: string
+ fields?: Record
+ expires?: number
+ headers?: Record
+ }
+ | {
+ method: 'PUT'
+ url: string
+ fields?: Record
+ expires?: number
+ headers?: Record
+ }
interface LegacyAwsS3Options extends PluginOptions {
- shouldUseMultipart?: never
- companionUrl?: string | null
- companionHeaders?: Record
- allowedMetaFields?: Array | null
- getUploadParameters?: (file: UppyFile) => MaybePromise
- limit?: number
- /** @deprecated this option will not be supported in future versions of this plugin */
- getResponseData?: (responseText: string, response: XMLHttpRequest) => void
- locale?: Locale,
- timeout?: number
- }
+ shouldUseMultipart?: never
+ companionUrl?: string | null
+ companionHeaders?: Record
+ allowedMetaFields?: Array | null
+ getUploadParameters?: (file: UppyFile) => MaybePromise
+ limit?: number
+ /** @deprecated this option will not be supported in future versions of this plugin */
+ getResponseData?: (responseText: string, response: XMLHttpRequest) => void
+ locale?: Locale
+ timeout?: number
+}
-export type AwsS3Options = LegacyAwsS3Options | AwsS3MultipartOptions;
+export type AwsS3Options = LegacyAwsS3Options | AwsS3MultipartOptions
declare class AwsS3 extends BasePlugin {}
diff --git a/packages/@uppy/aws-s3/types/index.test-d.ts b/packages/@uppy/aws-s3/types/index.test-d.ts
index 0e922b81bc..02f244f0e3 100644
--- a/packages/@uppy/aws-s3/types/index.test-d.ts
+++ b/packages/@uppy/aws-s3/types/index.test-d.ts
@@ -6,49 +6,53 @@ import AwsS3 from '..'
{
const uppy = new Uppy()
uppy.use(AwsS3, {
- getUploadParameters (file) {
+ getUploadParameters(file) {
expectType(file)
return { method: 'POST', url: '' }
},
})
- expectError(uppy.use(AwsS3, {
- shouldUseMultipart: false,
- getUploadParameters (file) {
- expectType(file)
- return { method: 'POST', url: '' }
- },
- }))
+ expectError(
+ uppy.use(AwsS3, {
+ shouldUseMultipart: false,
+ getUploadParameters(file) {
+ expectType(file)
+ return { method: 'POST', url: '' }
+ },
+ }),
+ )
uppy.use(AwsS3, {
shouldUseMultipart: false,
- getUploadParameters (file) {
+ getUploadParameters(file) {
expectType(file)
return { method: 'POST', url: '', fields: {} }
},
})
- expectError(uppy.use(AwsS3, {
- shouldUseMultipart: true,
- getUploadParameters (file) {
- expectType(file)
- return { method: 'PUT', url: '' }
- },
- }))
+ expectError(
+ uppy.use(AwsS3, {
+ shouldUseMultipart: true,
+ getUploadParameters(file) {
+ expectType(file)
+ return { method: 'PUT', url: '' }
+ },
+ }),
+ )
uppy.use(AwsS3, {
shouldUseMultipart: () => Math.random() > 0.5,
- getUploadParameters (file) {
+ getUploadParameters(file) {
expectType(file)
return { method: 'PUT', url: '' }
},
- createMultipartUpload (file) {
+ createMultipartUpload(file) {
expectType(file)
return { uploadId: '', key: '' }
},
- listParts (file, opts) {
+ listParts(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
return []
},
- signPart (file, opts) {
+ signPart(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
@@ -56,12 +60,12 @@ import AwsS3 from '..'
expectType(opts.signal)
return { url: '' }
},
- abortMultipartUpload (file, opts) {
+ abortMultipartUpload(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
},
- completeMultipartUpload (file, opts) {
+ completeMultipartUpload(file, opts) {
expectType(file)
expectType(opts.uploadId)
expectType(opts.key)
diff --git a/packages/@uppy/box/types/index.d.ts b/packages/@uppy/box/types/index.d.ts
index e081c786f9..4700dcf8cc 100644
--- a/packages/@uppy/box/types/index.d.ts
+++ b/packages/@uppy/box/types/index.d.ts
@@ -1,10 +1,13 @@
import type { PluginTarget, UIPlugin, UIPluginOptions } from '@uppy/core'
-import type { PublicProviderOptions, TokenStorage } from '@uppy/companion-client'
+import type {
+ PublicProviderOptions,
+ TokenStorage,
+} from '@uppy/companion-client'
interface BoxOptions extends UIPluginOptions, PublicProviderOptions {
- target?: PluginTarget
- title?: string
- storage?: TokenStorage
+ target?: PluginTarget
+ title?: string
+ storage?: TokenStorage
}
declare class Box extends UIPlugin {}
diff --git a/packages/@uppy/companion-client/types/index.d.ts b/packages/@uppy/companion-client/types/index.d.ts
index 8cea2392d7..6f7c78c39a 100644
--- a/packages/@uppy/companion-client/types/index.d.ts
+++ b/packages/@uppy/companion-client/types/index.d.ts
@@ -19,31 +19,47 @@ export interface RequestClientOptions {
}
type RequestOptions = {
- skipPostResponse?: boolean,
- signal?: AbortSignal,
+ skipPostResponse?: boolean
+ signal?: AbortSignal
}
export class RequestClient {
- constructor (uppy: Uppy, opts: RequestClientOptions)
+ constructor(uppy: Uppy, opts: RequestClientOptions)
readonly hostname: string
setCompanionHeaders(headers: CompanionHeaders): void
- get (path: string, options?: RequestOptions): Promise
+ get(path: string, options?: RequestOptions): Promise
/** @deprecated use option bag instead */
- get (path: string, skipPostResponse: boolean): Promise
+ get(path: string, skipPostResponse: boolean): Promise
- post (path: string, data: Record, options?: RequestOptions): Promise
+ post(
+ path: string,
+ data: Record,
+ options?: RequestOptions,
+ ): Promise
/** @deprecated use option bag instead */
- post (path: string, data: Record, skipPostResponse: boolean): Promise
-
- delete (path: string, data?: Record, options?: RequestOptions): Promise
+ post(
+ path: string,
+ data: Record,
+ skipPostResponse: boolean,
+ ): Promise
+
+ delete(
+ path: string,
+ data?: Record,
+ options?: RequestOptions,
+ ): Promise
/** @deprecated use option bag instead */
- delete (path: string, data: Record, skipPostResponse: boolean): Promise
+ delete(
+ path: string,
+ data: Record,
+ skipPostResponse: boolean,
+ ): Promise
}
/**
@@ -64,19 +80,23 @@ export interface ProviderOptions extends PublicProviderOptions {
}
export class Provider extends RequestClient {
- constructor (uppy: Uppy, opts: ProviderOptions)
+ constructor(uppy: Uppy, opts: ProviderOptions)
- checkAuth (): Promise
+ checkAuth(): Promise
- authUrl (): string
+ authUrl(): string
- fileUrl (id: string): string
+ fileUrl(id: string): string
- list (directory: string): Promise
+ list(directory: string): Promise
- logout (redirect?: string): Promise
+ logout(redirect?: string): Promise
- static initPlugin (plugin: unknown, opts: Record, defaultOpts?: Record): void
+ static initPlugin(
+ plugin: unknown,
+ opts: Record,
+ defaultOpts?: Record,
+ ): void
}
export interface SocketOptions {
@@ -87,17 +107,17 @@ export interface SocketOptions {
export class Socket {
readonly isOpen: boolean
- constructor (opts: SocketOptions)
+ constructor(opts: SocketOptions)
- open (): void
+ open(): void
- close (): void
+ close(): void
- send (action: string, payload: unknown): void
+ send(action: string, payload: unknown): void
- on (action: string, handler: (param: any) => void): void
+ on(action: string, handler: (param: any) => void): void
- once (action: string, handler: (param: any) => void): void
+ once(action: string, handler: (param: any) => void): void
- emit (action: string, payload: (param: any) => void): void
+ emit(action: string, payload: (param: any) => void): void
}
diff --git a/packages/@uppy/companion/infra/kube/companion/companion-kube.yaml b/packages/@uppy/companion/infra/kube/companion/companion-kube.yaml
index d465ccd8da..05e13b8f67 100644
--- a/packages/@uppy/companion/infra/kube/companion/companion-kube.yaml
+++ b/packages/@uppy/companion/infra/kube/companion/companion-kube.yaml
@@ -3,13 +3,13 @@ kind: Service
metadata:
name: companion
namespace: companion
- labels:
+ labels:
app: companion
spec:
ports:
- - port: 80
- targetPort: 3020
- protocol: TCP
+ - port: 80
+ targetPort: 3020
+ protocol: TCP
selector:
app: companion
---
@@ -25,32 +25,32 @@ spec:
replicas: 2
updateStrategy:
type: RollingUpdate
- serviceName: "companion"
+ serviceName: 'companion'
template:
metadata:
labels:
app: companion
spec:
containers:
- - image: docker.io/transloadit/companion:latest
- imagePullPolicy: Always
- name: companion
- envFrom:
- - secretRef:
- name: companion-env
- ports:
- - containerPort: 3020
- volumeMounts:
- - name: companion-data
- mountPath: /mnt/companion-data
+ - image: docker.io/transloadit/companion:latest
+ imagePullPolicy: Always
+ name: companion
+ envFrom:
+ - secretRef:
+ name: companion-env
+ ports:
+ - containerPort: 3020
+ volumeMounts:
+ - name: companion-data
+ mountPath: /mnt/companion-data
volumeClaimTemplates:
- - metadata:
- name: companion-data
- spec:
- accessModes: [ "ReadWriteOnce" ]
- resources:
- requests:
- storage: 10Gi
+ - metadata:
+ name: companion-data
+ spec:
+ accessModes: ['ReadWriteOnce']
+ resources:
+ requests:
+ storage: 10Gi
---
apiVersion: extensions/v1beta1
kind: Ingress
@@ -58,10 +58,10 @@ metadata:
name: companion
namespace: companion
annotations:
- kubernetes.io/tls-acme: "true"
- kubernetes.io/ingress.class: "nginx"
- certmanager.k8s.io/cluster-issuer: "letsencrypt-prod"
- certmanager.k8s.io/acme-http01-edit-in-place: "true"
+ kubernetes.io/tls-acme: 'true'
+ kubernetes.io/ingress.class: 'nginx'
+ certmanager.k8s.io/cluster-issuer: 'letsencrypt-prod'
+ certmanager.k8s.io/acme-http01-edit-in-place: 'true'
spec:
tls:
- secretName: server-tls
@@ -69,22 +69,22 @@ spec:
- companion.uppy.io
- secretName: uppy-tls
hosts:
- - server.uppy.io
+ - server.uppy.io
rules:
- - host: companion.uppy.io
- http:
- paths:
- - path: /
- backend:
- serviceName: companion
- servicePort: 80
- - host: server.uppy.io
- http:
- paths:
- - path: /
- backend:
- serviceName: companion
- servicePort: 80
+ - host: companion.uppy.io
+ http:
+ paths:
+ - path: /
+ backend:
+ serviceName: companion
+ servicePort: 80
+ - host: server.uppy.io
+ http:
+ paths:
+ - path: /
+ backend:
+ serviceName: companion
+ servicePort: 80
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
@@ -98,4 +98,4 @@ spec:
name: companion
minReplicas: 1
maxReplicas: 5
- targetCPUUtilizationPercentage: 80
\ No newline at end of file
+ targetCPUUtilizationPercentage: 80
diff --git a/packages/@uppy/companion/nodemon.json b/packages/@uppy/companion/nodemon.json
index 856a794505..42012c5513 100644
--- a/packages/@uppy/companion/nodemon.json
+++ b/packages/@uppy/companion/nodemon.json
@@ -1,13 +1,13 @@
{
- "restartable": "rs",
- "verbose": true,
- "env": {
- "NODE_ENV": "development",
- "DEBUG": "app:*",
- "DEBUG_COLORS": true
- },
- "debug": true,
- "watch": ["/app/", "/src/"],
- "ext": "js dust html ejs css scss rb json htpasswd",
- "exec": "node /app/lib/standalone/start-server.js"
-}
\ No newline at end of file
+ "restartable": "rs",
+ "verbose": true,
+ "env": {
+ "NODE_ENV": "development",
+ "DEBUG": "app:*",
+ "DEBUG_COLORS": true
+ },
+ "debug": true,
+ "watch": ["/app/", "/src/"],
+ "ext": "js dust html ejs css scss rb json htpasswd",
+ "exec": "node /app/lib/standalone/start-server.js"
+}
diff --git a/packages/@uppy/companion/src/server/provider/error.d.ts b/packages/@uppy/companion/src/server/provider/error.d.ts
index 29ce604bcf..e6aaed6288 100644
--- a/packages/@uppy/companion/src/server/provider/error.d.ts
+++ b/packages/@uppy/companion/src/server/provider/error.d.ts
@@ -11,6 +11,9 @@ export class ProviderAuthError extends ProviderApiError {
constructor()
}
-export function errorToResponse(anyError: Error): { code: number, message: string }
+export function errorToResponse(anyError: Error): {
+ code: number
+ message: string
+}
export function respondWithError(anyError: Error, res: any): boolean
diff --git a/packages/@uppy/companion/tsconfig.json b/packages/@uppy/companion/tsconfig.json
index cb42df19a1..ac532cc3d4 100644
--- a/packages/@uppy/companion/tsconfig.json
+++ b/packages/@uppy/companion/tsconfig.json
@@ -11,7 +11,5 @@
"checkJs": true,
"noEmitOnError": true
},
- "include": [
- "src/**/*"
- ]
+ "include": ["src/**/*"]
}
diff --git a/packages/@uppy/compressor/types/index.d.ts b/packages/@uppy/compressor/types/index.d.ts
index 8137a08010..5562d4badc 100644
--- a/packages/@uppy/compressor/types/index.d.ts
+++ b/packages/@uppy/compressor/types/index.d.ts
@@ -8,7 +8,9 @@ export interface CompressorOptions extends PluginOptions {
locale?: CompressorLocale
}
-export type CompressorCompleteCallback = (files: UppyFile[]) => void;
+export type CompressorCompleteCallback = (
+ files: UppyFile[],
+) => void
declare module '@uppy/core' {
export interface UppyEventMap {
diff --git a/packages/@uppy/core/src/_common.scss b/packages/@uppy/core/src/_common.scss
index 563e1eca66..1dcea0cc3f 100644
--- a/packages/@uppy/core/src/_common.scss
+++ b/packages/@uppy/core/src/_common.scss
@@ -15,8 +15,8 @@
// One selector uses the dir attribute declared by the page. If that does not exist, Uppy adds a
// fallback dir attribute on the root element itself, and we need a second selector to match that.
-[dir="rtl"] .uppy-Root,
-.uppy-Root[dir="rtl"] {
+[dir='rtl'] .uppy-Root,
+.uppy-Root[dir='rtl'] {
text-align: right;
}
@@ -40,7 +40,7 @@
line-height: 1;
}
-[dir="rtl"] .uppy-u-reset {
+[dir='rtl'] .uppy-u-reset {
text-align: right;
}
@@ -65,13 +65,13 @@
box-shadow: 0 0 0 3px rgba($blue, 0.15);
}
- [data-uppy-theme="dark"] & {
+ [data-uppy-theme='dark'] & {
color: $gray-200;
background-color: $gray-800;
border-color: $gray-800;
}
- [data-uppy-theme="dark"] &:focus {
+ [data-uppy-theme='dark'] &:focus {
border-color: $gray-700;
box-shadow: none;
}
@@ -107,7 +107,9 @@
user-select: none;
// Override right-to-left variant of the uppy-u-reset class
- [dir="rtl"] & { text-align: center; }
+ [dir='rtl'] & {
+ text-align: center;
+ }
}
.uppy-c-btn:not(:disabled):not(.disabled) {
@@ -138,7 +140,7 @@
padding: 13px 22px;
}
- [data-uppy-theme="dark"] & {
+ [data-uppy-theme='dark'] & {
color: $gray-200;
@include blue-border-focus--dark;
@@ -166,13 +168,13 @@
padding: 13px 18px;
}
- [data-uppy-theme="dark"] & {
+ [data-uppy-theme='dark'] & {
color: $gray-200;
@include blue-border-focus--dark;
}
- [data-uppy-theme="dark"] &:hover {
+ [data-uppy-theme='dark'] &:hover {
color: $gray-500;
}
}
diff --git a/packages/@uppy/core/src/_utils.scss b/packages/@uppy/core/src/_utils.scss
index 1e4264214b..77fc4a26d6 100644
--- a/packages/@uppy/core/src/_utils.scss
+++ b/packages/@uppy/core/src/_utils.scss
@@ -37,7 +37,7 @@ $focus-shadow: 0 0 0 3px rgba($blue, 0.5);
background-color: $highlight;
}
- [data-uppy-theme="dark"] &:focus {
+ [data-uppy-theme='dark'] &:focus {
background-color: $gray-800;
}
}
diff --git a/packages/@uppy/core/src/_variables.scss b/packages/@uppy/core/src/_variables.scss
index 1450a25733..500440719d 100644
--- a/packages/@uppy/core/src/_variables.scss
+++ b/packages/@uppy/core/src/_variables.scss
@@ -1,7 +1,10 @@
// Fonts
-$font-family-base: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Segoe UI Symbol", "Segoe UI Emoji", "Apple Color Emoji", Roboto, Helvetica, Arial, sans-serif !default;
-$font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
+$font-family-base: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI',
+ 'Segoe UI Symbol', 'Segoe UI Emoji', 'Apple Color Emoji', Roboto, Helvetica,
+ Arial, sans-serif !default;
+$font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
+ 'Courier New', monospace !default;
// Colors
diff --git a/packages/@uppy/core/types/index.d.ts b/packages/@uppy/core/types/index.d.ts
index 1ba322e30f..8ee4a343b5 100644
--- a/packages/@uppy/core/types/index.d.ts
+++ b/packages/@uppy/core/types/index.d.ts
@@ -13,18 +13,18 @@ export interface IndexedObject {
// These are defined in @uppy/utils instead of core so it can be used there without creating import cycles
export type UppyFile<
TMeta extends IndexedObject = Record,
- TBody extends IndexedObject = Record
- > = UppyUtils.UppyFile
+ TBody extends IndexedObject = Record,
+> = UppyUtils.UppyFile
-export type FileProgress = UppyUtils.FileProgress;
+export type FileProgress = UppyUtils.FileProgress
-export type FileRemoveReason = 'removed-by-user' | 'cancel-all';
+export type FileRemoveReason = 'removed-by-user' | 'cancel-all'
// Replace the `meta` property type with one that allows omitting internal metadata addFile() will add that
-type UppyFileWithoutMeta, TBody extends IndexedObject> = OmitKey<
- UppyFile,
- 'meta'
->
+type UppyFileWithoutMeta<
+ TMeta extends IndexedObject,
+ TBody extends IndexedObject,
+> = OmitKey, 'meta'>
type LocaleStrings = {
[K in TNames]?: string | { [n: number]: string }
@@ -39,23 +39,23 @@ export type Store = UppyUtils.Store
export type InternalMetadata = UppyUtils.InternalMetadata
export interface UploadedUppyFile<
- TMeta extends IndexedObject,
- TBody extends IndexedObject
- > extends UppyFile {
+ TMeta extends IndexedObject,
+ TBody extends IndexedObject,
+> extends UppyFile {
uploadURL: string
}
export interface FailedUppyFile<
- TMeta extends IndexedObject,
- TBody extends IndexedObject
- > extends UppyFile {
+ TMeta extends IndexedObject,
+ TBody extends IndexedObject,
+> extends UppyFile {
error: string
}
export interface AddFileOptions<
- TMeta extends IndexedObject = IndexedObject,
- TBody extends IndexedObject = IndexedObject
- > extends Partial> {
+ TMeta extends IndexedObject = IndexedObject,
+ TBody extends IndexedObject = IndexedObject,
+> extends Partial> {
// `.data` is the only required property here.
data: Blob | File
meta?: Partial & TMeta
@@ -95,7 +95,9 @@ export class BasePlugin {
uninstall(): void
}
-export class UIPlugin extends BasePlugin {
+export class UIPlugin<
+ TOptions extends UIPluginOptions = DefaultPluginOptions,
+> extends BasePlugin {
id: string
// eslint-disable-next-line no-use-before-define
@@ -137,9 +139,9 @@ export interface Locale {
}
export interface Logger {
- debug: (...args: any[]) => void;
- warn: (...args: any[]) => void;
- error: (...args: any[]) => void;
+ debug: (...args: any[]) => void
+ warn: (...args: any[]) => void
+ error: (...args: any[]) => void
}
export interface Restrictions {
@@ -151,7 +153,9 @@ export interface Restrictions {
allowedFileTypes?: string[] | null
}
-export interface UppyOptions = Record> {
+export interface UppyOptions<
+ TMeta extends IndexedObject = Record,
+> {
id?: string
autoProceed?: boolean
/**
@@ -165,7 +169,7 @@ export interface UppyOptions = Record,
- files: { [key: string]: UppyFile }
+ files: { [key: string]: UppyFile },
) => UppyFile | boolean | undefined
onBeforeUpload?: (files: {
[key: string]: UppyFile
@@ -177,23 +181,21 @@ export interface UppyOptions = Record = Record,
- TBody extends IndexedObject = Record
- > {
+ TBody extends IndexedObject = Record,
+> {
successful: UploadedUppyFile[]
failed: FailedUppyFile[]
}
export interface State<
TMeta extends IndexedObject = Record,
- TBody extends IndexedObject = Record
- > extends IndexedObject {
+ TBody extends IndexedObject = Record,
+> extends IndexedObject {
capabilities?: { resumableUploads?: boolean }
currentUploads: Record
error?: string
files: {
- [key: string]:
- | UploadedUppyFile
- | FailedUppyFile
+ [key: string]: UploadedUppyFile | FailedUppyFile
}
info?: Array<{
isHidden: boolean
@@ -213,42 +215,63 @@ export interface ErrorResponse {
export interface SuccessResponse {
uploadURL?: string
status?: number
- body?: any,
+ body?: any
bytesUploaded?: number
}
-export type GenericEventCallback = () => void;
-export type FileAddedCallback> = (file: UppyFile) => void;
-export type FilesAddedCallback> = (files: UppyFile[]) => void;
-export type FileRemovedCallback> =
- (file: UppyFile, reason: FileRemoveReason) => void;
-export type UploadCallback = (data: { id: string, fileIDs: string[] }) => void;
-export type ProgressCallback = (progress: number) => void;
-export type PreProcessCompleteCallback> = (file: UppyFile | undefined) => void;
-export type UploadProgressCallback> =
- (file: UppyFile | undefined, progress: FileProgress) => void;
-export type UploadSuccessCallback> =
- (file: UppyFile | undefined, response: SuccessResponse) => void
-export type UploadCompleteCallback> = (result: UploadResult) => void
-export type ErrorCallback = (error: Error) => void;
-export type UploadErrorCallback> =
- (file: UppyFile | undefined, error: Error, response?: ErrorResponse) => void;
-export type UploadRetryCallback = (fileID: string) => void;
-export type RetryAllCallback = (fileIDs: string[]) => void;
-export type RestrictionFailedCallback> =
- (file: UppyFile | undefined, error: Error) => void;
-
-export interface UppyEventMap = Record> {
+export type GenericEventCallback = () => void
+export type FileAddedCallback> = (
+ file: UppyFile,
+) => void
+export type FilesAddedCallback> = (
+ files: UppyFile[],
+) => void
+export type FileRemovedCallback> = (
+ file: UppyFile,
+ reason: FileRemoveReason,
+) => void
+export type UploadCallback = (data: { id: string; fileIDs: string[] }) => void
+export type ProgressCallback = (progress: number) => void
+export type PreProcessCompleteCallback> = (
+ file: UppyFile | undefined,
+) => void
+export type UploadProgressCallback> = (
+ file: UppyFile | undefined,
+ progress: FileProgress,
+) => void
+export type UploadSuccessCallback> = (
+ file: UppyFile | undefined,
+ response: SuccessResponse,
+) => void
+export type UploadCompleteCallback> = (
+ result: UploadResult,
+) => void
+export type ErrorCallback = (error: Error) => void
+export type UploadErrorCallback> = (
+ file: UppyFile | undefined,
+ error: Error,
+ response?: ErrorResponse,
+) => void
+export type UploadRetryCallback = (fileID: string) => void
+export type RetryAllCallback = (fileIDs: string[]) => void
+export type RestrictionFailedCallback> = (
+ file: UppyFile | undefined,
+ error: Error,
+) => void
+
+export interface UppyEventMap<
+ TMeta extends IndexedObject = Record,
+> {
'file-added': FileAddedCallback
'files-added': FilesAddedCallback
'file-removed': FileRemovedCallback
- 'upload': UploadCallback
- 'progress': ProgressCallback
+ upload: UploadCallback
+ progress: ProgressCallback
'preprocess-complete': PreProcessCompleteCallback
'upload-progress': UploadProgressCallback
'upload-success': UploadSuccessCallback
- 'complete': UploadCompleteCallback
- 'error': ErrorCallback
+ complete: UploadCompleteCallback
+ error: ErrorCallback
'upload-error': UploadErrorCallback
'upload-retry': UploadRetryCallback
'retry-all': RetryAllCallback
@@ -264,15 +287,24 @@ export class Uppy {
on(event: K, callback: UppyEventMap[K]): this
- on