Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
3b25757d
Commit
3b25757d
authored
Jan 21, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] route for upload WIP.
parent
1c531d83
Pipeline
#697
failed with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
API.hs
src/Gargantext/API.hs
+12
-5
New.hs
src/Gargantext/API/Corpus/New.hs
+8
-0
No files found.
src/Gargantext/API.hs
View file @
3b25757d
...
@@ -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
$
...
...
src/Gargantext/API/Corpus/New.hs
View file @
3b25757d
...
@@ -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'
'U
n
safe
'S
a
fe
ctI
'[
J
SON
]
Maybe
event
input
output
)
Flat
(
AsyncJobsAPI'
'U
n
safe
'S
a
fe
ctI
'[
J
SON
]
Maybe
event
input
output
)
------------------------------------------------------------------------
------------------------------------------------------------------------
type
Upload
=
Summary
"Corpus Upload endpoint"
:>
"corpus"
:>
Capture
"corpus_id"
CorpusId
:<|>
"addWithquery"
:>
AsyncJobsAPI
ScraperStatus
WithQuery
ScraperStatus
:<|>
"addWithfile"
:>
AsyncJobs
ScraperStatus
'[
F
ormUrlEncoded
]
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment