@@ -725,3 +725,67 @@ Error Connecting to auth service ...
725725}
726726```
727727
728+
729+
730+
731+ ## Get Importer Mappings
732+
733+ This endpoint returns a list of available staging importer apps that have been marked as supported. This endpoint also
734+ returns a mapping between a list of files and predicted importer app.
735+
736+ For example,
737+ * if we pass in nothing we get a response with a list of apps, and no mappings
738+ * if we pass in a list of files, such as [ "file1.fasta", "file2.fq", "None"] , we would get back a response
739+ that maps to Fasta Importers and FastQ Importers, with a weight of 0 to 1
740+ which represents the probability that this is the correct importer for you.
741+ * for files for which there is no predicted app, the return is a null value
742+ * output type is not currently used for anything
743+ * this endpoint is used to power the dropdowns for the staging service window in the Narrative
744+
745+ ** URL** : ` ci.kbase.us/services/staging_service/importer_mappings `
746+
747+ ** local URL** : ` localhost:3000/importer_mappings `
748+
749+ ** Method** : ` POST `
750+
751+ ** Headers** : Not Required
752+
753+ ## Success Response
754+
755+ ** Code** : ` 200 OK `
756+
757+ ** Content example**
758+
759+ ```
760+ data = {"file_list": ["file1.txt", "file.zip"]}
761+ async with AppClient(config, username) as cli:
762+ resp = await cli.post(
763+ "importer_mappings/", data=data
764+ )
765+ ```
766+ Response:
767+ ```
768+ {
769+ "apps": {
770+ "decompress/unpack": {
771+ "title": "Decompress/Unpack",
772+ "app": "kb_uploadmethods/unpack_staging_file",
773+ "output_type": [null],
774+ "extensions": ["zip", "tar", "tgz", "tar.gz", "7z", "gz", "gzip", "rar"],
775+ "id": 7
776+ },
777+ "mappings": [null, [{
778+ "id": 7,
779+ "title": "decompress/unpack",
780+ "app_weight": 1
781+ }]]
782+ }
783+ ```
784+ ## Error Response
785+ ** Code** : ` 400 Bad Request `
786+
787+ ** Content**
788+ ```
789+ must provide file_list field
790+ ```
791+
0 commit comments