Commit Graph

32 Commits

Author SHA1 Message Date
Diamond Lewis
142eaa71bd Run Prettier JS #2 (#6796) 2020-07-13 15:13:08 -07:00
Diamond Lewis
370215a39b Support Metadata in GridFSAdapter (#6660)
* Support Metadata in GridFSAdapter

* Useful for testing in the JS SDK
* Adds new endpoint to be used with `Parse.File.getData`
* Allows file adapters to return tags as well as future data.

* fix tests

* Make getMetadata optional

* Revert "fix tests"

This reverts commit 7706da13c688027483974e854b5b24321fb070cd.

* improve coverage
2020-05-08 15:32:20 -05:00
stevestencil
a9dba442b1 Add file triggers and file meta data (#6344)
* added hint to aggregate

* added support for hint in query

* added else clause to aggregate

* fixed tests

* updated tests

* Add tests and clean up

* added beforeSaveFile and afterSaveFile triggers

* Add support for explain

* added some validation

* added support for metadata and tags

* tests?

* trying tests

* added tests

* fixed failing tests

* added some docs for fileObject

* updated hooks to use Parse.File

* added test for already saved file being returned in hook

* added beforeDeleteFile and afterDeleteFile hooks

* removed contentLength because it's already in the header

* added fileSize param to FileTriggerRequest

* added support for client side metadata and tags

* removed fit test

* removed unused import

* added loging to file triggers

* updated error message

* updated error message

* fixed tests

* fixed typos

* Update package.json

* fixed failing test

* fixed error message

* fixed failing tests (hopefully)

* TESTS!!!

* Update FilesAdapter.js

fixed comment

* added test for changing file name

* updated comments

Co-authored-by: Diamond Lewis <findlewis@gmail.com>
2020-04-02 16:00:15 -05:00
Mike Patnode
a7cb381fbf Allow validateFilename to return a string or Parse Error (#6246) 2019-12-02 19:47:22 -06:00
Mike Patnode
1c8d4a6519 Move filename validation out of the Router and into the FilesAdaptor (#6157)
* Move filename validation out of the Router and into the FilesAdaptor

* Address PR comments

* Update unittests to handle FilesAdapter interface change

* Make validateFilename optional
2019-10-26 21:15:21 -05:00
Diamond Lewis
63cabb8423 Stream video with GridFSBucketAdapter (implements byte-range requests) (#6028)
* Stream video with GridFSBucketAdapter (implements byte-range requests)

Closes: https://github.com/parse-community/parse-server/issues/5834

Similar to https://github.com/parse-community/parse-server/pull/2437

I ran into this issue while trying to view a mov file in safari from the dashboard.

* Rename getFileStream to handleFileStream
2019-09-11 09:34:39 -05:00
Florent Vilmart
d83a0b6808 Use Prettier JS (#5017)
* Adds prettier

* Run lint before tests
2018-09-01 13:58:06 -04:00
GabrielLomba
6a151ee135 Add the addFileNameHash option that allows users to remove the hash f… (#4915)
* Add the addFileNameHash option that allows users to remove the hash from file names

* Change option name to preserveFileName

* Revert changes to package-lock.json
2018-07-27 09:04:06 -04:00
Florent Vilmart
6a1510729a Bump nodejs version to 6+ (#4272)
* let travis build against 3.x

* Cleanup dependencies and bump min version to current LTS

* Makes npm-git push all branches to -preview

* restores releases

* Bumps mime to 2.0.3 (requires node 6+)

* Bumps express to latest version

* Fixes linting issue after upgrade

* Use travis-branch for partial releases
2017-11-25 15:39:31 -05:00
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00
Florent Vilmart
8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00
Yuki Takeichi
758975cf03 Revert " Saved filename fixed so that clients display it correctly #2415 (#2705)" (#2833)
This reverts commit 22c1a87d80.
2016-10-19 16:55:20 -04:00
Lama Chandrasena
22c1a87d80 Saved filename fixed so that clients display it correctly #2415 (#2705)
* increased filename length to 36 to make sure clients display correct filename

* increased filename length to 36 to make sure clients display correct filename

* added uuid prefix to saved filenames
2016-09-17 14:27:31 -04:00
Brage G. Staven
e690b73bb5 Stream video with GridStoreAdapter (implements byte-range requests) (#2437)
* Stream video with GridStoreAdapter

* fixing nits. Removing test(Range not accepted as header)

* nit

* Changed names. Added function to check if stream-requirements is fulfilled.
2016-08-12 15:58:18 -04:00
OzgeAkin
6dc8d287d6 Option to ignore parse file storage (#2222)
* flag in configurations to use only files adapter

* added lib folder

* remove lib

* alignment edit

* replace comma with semicolon

* ignore parse file storage if fileKey is not provided (undefined)
2016-07-10 10:15:30 -07:00
Patrick Pelletier
65518cdd64 Support file objects in the legacy bucket: files.parse.com 2016-06-07 15:59:45 -07:00
Florent Vilmart
1e45ac753a Moves Files adapters to external packages 2016-03-24 00:48:34 -04:00
Mike McDonald
0f00d659cb Removed extraneous console.log() 2016-03-07 00:34:41 -08:00
Mike McDonald
ce35b81cc6 New things for GCS Adapter 2016-03-07 00:30:21 -08:00
Florent Vilmart
7257ee858b Moves some logic from FilesRouter to FilesController for content-type and filename 2016-03-01 10:14:03 -05:00
Florent Vilmart
78d380df72 Adds content type support in S3 2016-03-01 09:28:17 -05:00
Nikita Lutsenko
966d10ca43 Allow uploading files without content-type. 2016-02-22 14:07:58 -08:00
Florent Vilmart
23e55e941e Splits Adapter loading from AdaptableController
- Adds dynamic prototype conformance check upon setting adapter
- Throws when adapter is undefined, invalid in controller
2016-02-21 23:47:07 -05:00
Florent Vilmart
d504681589 Improves Controller and Adapter relationship
- Controllers that have adapters are AdaptableControllers
- AdaptableController is responsible to instantiate the proper adapter if needed (string, function or BaseAdapter)
- BaseAdapter is the base class for adapters, allows skipping when passed directly to the controller
2016-02-21 17:04:34 -05:00
Florent Vilmart
305879a251 Refactors FilesController in FilesRouter and FilesController 2016-02-20 13:52:35 -05:00
Florent Vilmart
067946c66c Refactors PushController and FilesController to support multiple apps 2016-02-19 23:49:12 -05:00
Dmitry Chestnykh
62cbc451aa Generate tokens and ids with cryptoUtils module.
Move object ID, token, and random string generation into their own
module, cryptoUtils.

Remove hat dependency, which was used to generate session and some other
tokens, because it  used non-cryptographic random number generator.
Replace it with the cryptographically secure one. The result has the
same format (32-character hex string, 128 bits of entropy).

Remove randomstring dependency, as we already have this functionality.

Add tests.
2016-02-12 21:16:50 +01:00
Nikita Lutsenko
f53cb60d57 Add enforceMasterKeyAccess middleware. 2016-02-11 23:26:44 -08:00
Wes Thomas
a75376523c file DELETE support 2016-02-11 21:21:42 -05:00
Nikita Lutsenko
07c9c1d648 Cleanup and modernize S3Adapter to ES6 syntax. 2016-02-09 21:48:05 -08:00
Nikita Lutsenko
8ca25cbabe Moved getting the url for every file from RestQuery into FilesController. 2016-02-09 19:31:29 -08:00
Nikita Lutsenko
53b2d4e176 Refactor files.js into FilesController. 2016-02-09 14:38:34 -08:00