Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
7ad8c683
Commit
7ad8c683
authored
Jan 14, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API][Async] withFile route ok
parent
1ba8f6b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
API.hs
src/Gargantext/API.hs
+2
-2
New.hs
src/Gargantext/API/Corpus/New.hs
+14
-10
No files found.
src/Gargantext/API.hs
View file @
7ad8c683
...
...
@@ -284,7 +284,7 @@ type GargPrivateAPI' =
:>
TreeAPI
:<|>
New
.
AddWithQuery
--
:<|> New.AddWithFile
:<|>
New
.
AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api
...
...
@@ -365,7 +365,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
<$>
PathNode
<*>
treeAPI
-- TODO access
:<|>
addWithQuery
-- :<|> addWithQuery
:<|>
addWithFile
-- :<|> addToCorpus
-- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info uid -- TODO-SECURITY
...
...
src/Gargantext/API/Corpus/New.hs
View file @
7ad8c683
...
...
@@ -138,10 +138,10 @@ deriveJSON (unPrefix "_scst_") 'ScraperStatus
----------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
data
WithQuery
=
WithQuery
{
_wq_query
::
!
Text
,
_wq_corpus
::
!
Int
,
_wq_databases
::
!
[
ExternalAPIs
]
}
deriving
Generic
...
...
@@ -151,17 +151,20 @@ makeLenses ''WithQuery
instance
FromJSON
WithQuery
where
parseJSON
=
genericParseJSON
$
jsonOptions
"_wq_"
instance
ToSchema
WithQuery
-- TODO _scin2_ prefix
instance
ToSchema
WithQuery
type
(
AddAPI
m
)
=
AsyncJobsAPI
ScraperStatus
m
ScraperStatus
------------------------------------------------------------------------
type
AddAPI
withInput
=
AsyncJobsAPI
ScraperStatus
withInput
ScraperStatus
------------------------------------------------------------------------
type
AddWithQuery
=
Summary
"Add to corpus endpoint"
:>
"corpus"
:>
Capture
"corpus_id"
CorpusId
:>
"add"
:>
"query"
:>
"async"
:>
(
AddAPI
WithQuery
)
type
WithUpload'
=
QueryParam
"fileType"
FileType
:>
"add"
:>
"query"
:>
"async"
:>
AddAPI
WithQuery
type
AddWithFile
=
Summary
"Add to corpus endpoint"
:>
"corpus"
...
...
@@ -170,9 +173,10 @@ type AddWithFile = Summary "Add to corpus endpoint"
:>
"file"
:>
MultipartForm
Mem
(
MultipartData
Mem
)
:>
QueryParam
"fileType"
FileType
:>
"async"
:>
(
AddAPI
WithQuery
)
:>
"async"
:>
AddAPI
()
------------------------------------------------------------------------
-- TODO WithQuery also has a corpus id
addToCorpusJobFunction
::
FlowCmdM
env
err
m
=>
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