Closed antst closed 1 year ago
I'd suggest a more generic approach of plugin
as the plugin is a archive/directory with manifest.json
or metadata.json
in it along with bunch of files.
Details:
Plugins are uploaded a tar.gz bundle. Archive must have present fine manifest.json
Media-manager needs: 1) to have another directory, where it stores plugins (similar to directories for other assets)
2) PUT endpoint: on upload of plugin, MM has to check file-type (tar.gz), and then creates subdirectory with name which is md5 hash of the tar.gz archive (similar to what we do with the rest), then try to unarchive bundle to this directory and check that there is present file "manifest.json". if OK then plugin is accepted, if not, then abort, and delete subdirectory 3) once plugin is uploaded then we need to register in DB (pending to happen in outer UC bits) 4) GET endpoint: media.GET("/render/plugin/:directory/:filepath", n.apiMediaGetPluginFile), returns a file ":filepath" from ":directory" (which is hash)
implemented in #289
Add handling of FE plugins to the media managing subsystem in the UC 1) Add EPs to store/retrieve. Similar to assets, but named "feplugin" 2) it should check that file type corresponds to what it should be in case of FE plugin (presumably JS, but check up with Mitia)