Commit 3b25757d authored by Alexandre Delanoë's avatar Alexandre Delanoë

[API] route for upload WIP.

parent 1c531d83
Pipeline #697 failed with stage
......@@ -295,9 +295,10 @@ type GargPrivateAPI' =
:> Capture "tree_id" NodeId
:> TreeAPI
:<|> New.AddWithQuery
:<|> New.AddWithFile
-- :<|> New.Upload
:<|> New.AddWithForm
-- :<|> New.AddWithQuery
-- :<|> New.AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api
......@@ -377,13 +378,19 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
:<|> withAccess (Proxy :: Proxy TreeAPI) Proxy uid
<$> PathNode <*> treeAPI
-- TODO access
:<|> addWithQuery
:<|> addWithFile
-- :<|> addUpload
-- (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
-- :<|> addWithFile
:<|> addWithForm
-- :<|> addToCorpus
-- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info uid -- TODO-SECURITY
{-
addUpload :: GargServer New.Upload
addUpload cId = serveJobsAPI $ JobFunction (\i log -> New.addToCorpusJobFunction cid i (liftIO . log))
:<|> (serveJobsAPI $ JobFunction (\i log -> New.addToCorpusWithForm cid i (liftIO . log)))
-}
addWithQuery :: GargServer New.AddWithQuery
addWithQuery cid =
serveJobsAPI $
......
......@@ -139,6 +139,14 @@ instance ToSchema WithForm where
type AsyncJobs event ctI input output =
Flat (AsyncJobsAPI' 'Unsafe 'Safe ctI '[JSON] Maybe event input output)
------------------------------------------------------------------------
type Upload = Summary "Corpus Upload endpoint"
:> "corpus"
:> Capture "corpus_id" CorpusId
:<|> "addWithquery" :> AsyncJobsAPI ScraperStatus WithQuery ScraperStatus
:<|> "addWithfile" :> AsyncJobs ScraperStatus '[FormUrlEncoded] WithForm ScraperStatus
type AddWithQuery = Summary "Add with Query to corpus endpoint"
:> "corpus"
:> Capture "corpus_id" CorpusId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment