* start supporting isolatedDeclarations
* add errors and storage package
* add utils, and storage-driver-local
* fix rest of packages
* fix types/collab import
* hardcode "isolatedDeclarations": true in all configs for now
* Revert "hardcode "isolatedDeclarations": true in all configs for now"
This reverts commit ac71582159.
* fix formatting
* undo readme change
* remove link
* fix lockfile
* dont do a js string cast here I guess
* use tsc over tsdown because of failing tests
* last fixes
* use tsdown --clean instead of rimraf
* fmt and fixes
* re add weird space
* add run as entry
* undo api using tsdown
* switch back to tsdown again now with unbundle 🥳
* more ts fixes
* build with tsdown in @directus/themes
* fix bb tests
* undo spaces
* another space
* fix collab import
* add changeset
* Apply suggestion from @ComfortablyCoding
* Apply suggestion from @ComfortablyCoding
* Update .changeset/hungry-yaks-enter.md
Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>
---------
Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>
* add eslint-plugin-import and configure import sorting rules
* apply `eslint . --fix`
* disable import order rule for test files
* enable import order rule for test files and disable it inline after mock imports
* prettier
* address failed tests by removing unused i18n mocks from test files
* reorder import statement for createApp to address failed test
* Remove disable/enable blocks
* Resolve conflict with VSCode organize imports functionality (#26461)
* Update to use default grouping and prevent adding newlines in between
Co-authored-by: ian <licitdev@gmail.com>
* apply eslint fix
* run prettier
---------
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
* Refactor read method to allow for cache busting
* update tests
* fix formatting
* add changeset
* use file.modified_on as version instead of cache busting
* run linter
---------
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
* WIP initial TUS tests
* WIP further tus integration
* WIP authenticate uploads
* boilerplate stuff
* Migrated handlers
* resolving type errors
* tackle some build errors
* WIP moving resumable uploads to its own package
* added migration and integrated local file storage into directus files
* cleaned up local store
* cleaned up failed experiments
* prettier
* Add tus_data and tus_id to system data
* Improve file upload progress estimation for multiple files
* bypass creating a revision per uploaded chunk
* fixed accidental commit
* Fix pause/resume for multiple uploads
* Null coalesce all the way
* Added directus locking logic
* prettier
* Small tweak (added resume uploads dialog)
* authentication
* Add remove to resumable uploads
* added delete endpoint and cleaned old service setup
* WIP s3 storage adapter
* Less breaking of interfaces, more breaking of text
* Moved local adapter to its own package
* Prettying some things up
* Sort resumable uploads by creation time
* Fix resumable uploads dialog popping up on second file upload
* Move buttons around & properly handle error
* s3
* A few changes
- Make S3 driver work more reliable
- Move common logic to tus driver class
- Respect `folder` when uploading from a different folder
- Implement cleanup for both local and S3
* synced dependencies
* accept presets
* Remove extra code for folder, as this is handled in presets now
* Rename migration to most recent date
* updated lcokfile
* prettier
* dont fully rely on the sudo service
* removed unused import
* Hide partial file uploads from the API
* satisfy linter
* Refactor tus into storage driver
* Fix merge conflicts
* Update pnpm-lock
* Fix typing issue
* nuked tus driver packages
* updated environment vars
* prettier
* Change type import style
* Fix S3 cleanup
* Use `modified_on` instead of tus creation date
* Pass chunk size to storage drivers
* Add sudo service to scheduled job
* Make cleanup work even if no upload was done before
* Remove "Resume Uploads" interface
* Update packages/env/src/constants/defaults.ts
Co-authored-by: ian <licitdev@gmail.com>
* Add config docs
* Add resumable to dictionary
* moved chunk filter to service
* simplify middleware
* use lodash
* Update api/src/services/tus/data-store.ts
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
* move to devDeps
* package lock
* fixed import
* updated test mocking
* Create a new TUS server handler for every request instead of one global one
* Allow for tree-shaking tus-client
* Rename resumable-uploads.ts to tus.ts
* Extract meta data from uploaded file
* Only consider full parts or the final part for bytesUploaded in S3
* Add additional sanity check to S3 driver
* Remove pause/resume functionality
* fixed file replacement
* Remove unused expose
* Reintroduce defineExpose and expose abort
* Broken file replace
* fixed replacement
* prettier
* added filesize in replace
* update metadata extraction
* Remove unused import
* updated package-lock
* extra validation check
* oops
---------
Co-authored-by: Hannes Küttner <kuettner.hannes@gmail.com>
Co-authored-by: Hannes Küttner <4376726+hanneskuettner@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
* Refactor storage logic to testable setup
* Add tests to get storage config
* Add tests for register drivers
* Tests for index
* Organize imports
* Add missing getStorage
* Setup boilerplate for cloudinary drive
* Add build script
* Add cloudinary configuration
* WIP tweaks for R&D
* Start storage abstraction v2
* Make storage manager single file
* Add test coverage
* Organize imports
* Setup local driver boilerplate
* [WIP] Start on local driver 2.0
* Add more methods
* Lunchtime
* Add put method
* Add list method
* [WIP] Try using storage in api
* Use node16 module-resolution
* Lets not mess with apply-query rn
* I love CJS. Death to CJS.
* Use dynamic imports
* Make things work
* Add path normalizer
* Add azure storage driver
* Update lock
* Start on tests
* Add getBuffer test
* Add getStat tests
* Add tests for exists
* Add tests for move
* Add tests for copy
* Add tests for put
* Add tests for delete
* Add test coverage for list
* Add removeLeading option to normalizePath
* Use removeLeading option
* Start on gcs
* Add fullpath test
* Add getStream
* Add getBuffer
* Add getStat
* Add exists
* Add move
* Add copy
* Add put
* Add delete
* Finish DriverGCS
* Cleanup tests a bit
* Start s3
* Add getStream
* Add getBuffer
* Please Wryn
* Add #exists
* Use randomize data
* No more hardcoded values 🙅♀️
* Add tests for copy
* Add tests for put
* Add put/copy/delete
* Add tests for delete
* WIP list
* Remove duplicate fullPath check
* Finish AWS tests
* Listen to wryn
* Mission critical tweak
* Add randomization, cleanup tests
* Check src vs dest full path
* Start on Cloudinary
* Add parameter signature helper
* Fix ESM building of shared
* Fix ESM building of shared
* Improve tests
* Update pnpm
* Remove old build commands
* Generated d.ts files
* Fix export naming
* Move ESM only utils to new @directus/utils
* Update lockfile
* Fix type exports
* Implement getStream
* Cleanup tests
* Simplify api
* Simplify API
* Simplify api
* Simplify API
* Add read/stat
* Cleanup / add exists
* Add move
* Add write
* Move uploadChunk to separate method
* Add test for #uploadChunk
* Add tests for write
* Add copy
* Add delete
* Add list
* Add list error handling
* Remove old drive packages
* Start updating API usage of storage
* Use Readable instead of NodeJS.ReadableStream
* Use readable instead of buffer
* Restore shared to main
* Update lockfile
* Use a streaming pipeline for sharp metadata
* Add basic e2e test for local upload and delete
* Fix integer filesize in SQLite
* fixed environment mocking in unit tests
* applied the same env mocking to other tests
* Update api/src/storage/register-drivers.ts
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Use sha256 by default
* Add base read test for /assets
* Replace exifr with exif-reader
* Fix tests for storage/index
* Install faking lib for tests
* Add test for register-drivers
* Add tests for register-locations
* Finish tests
* Organize imports
* Resolve Azris comments
* Fix outdated tests
Certainly not the cleanest, but I need to do a bigger pass on all these tests to get them up to date with the latest team requirements. Gonna do that in a separate PR..
* Test for sha256
* Attempt 1 at fixing toString errorr
I'm not seeing this issue locally, so we'll spam a couple commits here to get things going
* Use node 18 in tests?!
* Fix localhost resolution with 127.0.0.1
* Mock getEnv()
* Use @directus/tsconfig instead of duplicated conf
* Does this fix it?
* OK fun detour
* Recreate lockfile
* Update config files
* Use multipart uploads in S3
* Cleanup imports
* File Storage 2.0: Make metadata extraction backward-compatible (#16868)
* Reinstall packages using pnpm instead of manually removing them (#16871)
* Added extra environment setting for sharp processing of invalid images (#16811)
* Added extra environment setting for sharp processing of invalid images
* renamed environment var to `ASSETS_INVALID_IMAGE_SENSITIVITY_LEVEL`
* Remove unused excludes from tsconfig
* Remove copy/paste leftover
* Update packages/utils/readme.md
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
* Update packages/utils/package.json
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>