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

[API] route for upload WIP.

parent 1c531d83
...@@ -295,9 +295,10 @@ type GargPrivateAPI' = ...@@ -295,9 +295,10 @@ type GargPrivateAPI' =
:> Capture "tree_id" NodeId :> Capture "tree_id" NodeId
:> TreeAPI :> TreeAPI
:<|> New.AddWithQuery -- :<|> New.Upload
:<|> New.AddWithFile
:<|> New.AddWithForm :<|> New.AddWithForm
-- :<|> New.AddWithQuery
-- :<|> New.AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI -- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api -- :<|> "new" :> New.Api
...@@ -377,13 +378,19 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid)) ...@@ -377,13 +378,19 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
:<|> withAccess (Proxy :: Proxy TreeAPI) Proxy uid :<|> withAccess (Proxy :: Proxy TreeAPI) Proxy uid
<$> PathNode <*> treeAPI <$> PathNode <*> treeAPI
-- TODO access -- TODO access
:<|> addWithQuery -- :<|> addUpload
:<|> addWithFile -- (\corpus -> addWithQuery corpus :<|> addWithFile corpus)
-- :<|> addWithFile
:<|> addWithForm :<|> addWithForm
-- :<|> addToCorpus
-- :<|> New.api uid -- TODO-SECURITY -- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info 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 :: GargServer New.AddWithQuery
addWithQuery cid = addWithQuery cid =
serveJobsAPI $ serveJobsAPI $
......
...@@ -139,6 +139,14 @@ instance ToSchema WithForm where ...@@ -139,6 +139,14 @@ instance ToSchema WithForm where
type AsyncJobs event ctI input output = type AsyncJobs event ctI input output =
Flat (AsyncJobsAPI' 'Unsafe 'Safe ctI '[JSON] Maybe event 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" type AddWithQuery = Summary "Add with Query to corpus endpoint"
:> "corpus" :> "corpus"
:> Capture "corpus_id" CorpusId :> 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