Implement files/browse API (original) (raw)

This API will be the base for the API-exposed file-viewer.

It'll need to expose similar values to what we currently render into the template, which is something along the lines of…

{ "id": 80, "created": "2018-12-21T15:12:57Z", "hash": "sha256:edfc2d21143ebcd077fdde831262671802776ec41fccc1fa2aecbf30e5794206", "is_restart_required": false, "is_webextension": true, "is_mozilla_signed_extension": false, "platform": "all", "size": 7608, "status": "unreviewed", "url": "http://olympia.test/firefox/downloads/file/80/notify_link_clicks_i18n-1.0-fx.xpi?src=", "permissions": [ "notifications", "" ], "automated_signing": false, "has_been_validated": true, "validation_url_json": "/en-US/developers/addon/notify-link-clicks-i18n/file/80/validation.json", "validation_url": "/en-US/developers/addon/notify-link-clicks-i18n/file/80/validation", "content": "", "version": { "id": 88, "channel": "listed", "compatibility": { "firefox": { "max": "*", "min": "42.0" } }, "edit_url": "http://olympia.test/en-US/developers/addon/notify-link-clicks-i18n/versions/88", "files": [ { "id": 80, "created": "2018-12-21T15:12:57Z", "hash": "sha256:edfc2d21143ebcd077fdde831262671802776ec41fccc1fa2aecbf30e5794206", "is_restart_required": false, "is_webextension": true, "is_mozilla_signed_extension": false, "platform": "all", "size": 7608, "status": "unreviewed", "url": "http://olympia.test/firefox/downloads/file/80/notify_link_clicks_i18n-1.0-fx.xpi?src=", "permissions": [ "notifications", "" ] } ], "is_strict_compatibility_enabled": false, "license": { "id": 1, "is_custom": false, "name": { "el": "GNU General Public License, έκδοση 3.0", }, "text": null, "url": "http://www.gnu.org/licenses/gpl-3.0.html" }, "release_notes": null, "reviewed": null, "url": "http://olympia.test/en-US/firefox/addon/notify-link-clicks-i18n/versions/1.0", "version": "1.0" }, "files": { "README.md": { "mimetype": "text/markdown", "binary": false, "depth": 0, "short": "README.md", "size": 922, "version": "1.0", "directory": false, "sha256": "cc09ac04604bd9d2e758706cff4ce9cd61e638359353b809864277563416bb9c", "id": 80, "filename": "README.md" }, "_locales": { "mimetype": "application/octet-stream", "binary": false, "depth": 0, "short": "_locales", "size": null, "version": "1.0", "directory": true, "sha256": "", "id": 80, "filename": "_locales" }, "content-script.js": { "mimetype": "application/javascript", "binary": false, "depth": 0, "short": "content-script.js", "size": 530, "version": "1.0", "directory": false, "sha256": "26cfb0293eddaee36e265c95a471c1e1d7c48bc83ba7e616fc68018047a2a8bd", "id": 80, "filename": "content-script.js" }, "icons": { "mimetype": "application/octet-stream", "binary": false, "depth": 0, "short": "icons", "size": null, "version": "1.0", "directory": true, "sha256": "", "id": 80, "filename": "icons" }, "icons/LICENSE": { "mimetype": "application/octet-stream", "binary": false, "depth": 1, "short": "icons/LICENSE", "size": 136, "version": "1.0", "directory": false, "sha256": "b48e66c02fe62dd47521def7c5ea11b86af91b94c23cfdf67592e1053952ed55", "id": 80, "filename": "LICENSE" }, "icons/link-48.png": { "mimetype": "image/png", "binary": "image", "depth": 1, "short": "icons/link-48.png", "size": 596, "version": "1.0", "directory": false, "sha256": "a871776829ddc7a057fb65aaa6f7c0b2846558bdb023a6f18de7eb0fee698a7b", "id": 80, "filename": "link-48.png" }, "manifest.json": { "mimetype": "application/json", "binary": false, "depth": 0, "short": "manifest.json", "size": 622, "version": "1.0", "directory": false, "sha256": "71d4122c0f2f78e089136602f88dbf590f2fa04bb5bc417454bf21446d6cb4f0", "id": 80, "filename": "manifest.json" } } }