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
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
Pipeline
#4656
failed with stage
in 9 minutes and 9 seconds
Changes
2
Pipelines
3
Show 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' =
...
@@ -284,7 +284,7 @@ type GargPrivateAPI' =
:>
TreeAPI
:>
TreeAPI
:<|>
New
.
AddWithQuery
:<|>
New
.
AddWithQuery
--
:<|> New.AddWithFile
:<|>
New
.
AddWithFile
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "scraper" :> WithCallbacks ScraperAPI
-- :<|> "new" :> New.Api
-- :<|> "new" :> New.Api
...
@@ -365,7 +365,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
...
@@ -365,7 +365,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
<$>
PathNode
<*>
treeAPI
<$>
PathNode
<*>
treeAPI
-- TODO access
-- TODO access
:<|>
addWithQuery
:<|>
addWithQuery
-- :<|> addWithQuery
:<|>
addWithFile
-- :<|> addToCorpus
-- :<|> addToCorpus
-- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info 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
...
@@ -138,10 +138,10 @@ deriveJSON (unPrefix "_scst_") 'ScraperStatus
----------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
data
WithQuery
=
WithQuery
data
WithQuery
=
WithQuery
{
_wq_query
::
!
Text
{
_wq_query
::
!
Text
,
_wq_corpus
::
!
Int
,
_wq_databases
::
!
[
ExternalAPIs
]
,
_wq_databases
::
!
[
ExternalAPIs
]
}
}
deriving
Generic
deriving
Generic
...
@@ -151,17 +151,20 @@ makeLenses ''WithQuery
...
@@ -151,17 +151,20 @@ makeLenses ''WithQuery
instance
FromJSON
WithQuery
where
instance
FromJSON
WithQuery
where
parseJSON
=
genericParseJSON
$
jsonOptions
"_wq_"
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"
type
AddWithQuery
=
Summary
"Add to corpus endpoint"
:>
"corpus"
:>
"corpus"
:>
Capture
"corpus_id"
CorpusId
:>
Capture
"corpus_id"
CorpusId
:>
"add"
:>
"query"
:>
"async"
:>
(
AddAPI
WithQuery
)
:>
"add"
:>
"query"
:>
"async"
type
WithUpload'
=
QueryParam
"fileType"
FileType
:>
AddAPI
WithQuery
type
AddWithFile
=
Summary
"Add to corpus endpoint"
type
AddWithFile
=
Summary
"Add to corpus endpoint"
:>
"corpus"
:>
"corpus"
...
@@ -170,9 +173,10 @@ type AddWithFile = Summary "Add to corpus endpoint"
...
@@ -170,9 +173,10 @@ type AddWithFile = Summary "Add to corpus endpoint"
:>
"file"
:>
"file"
:>
MultipartForm
Mem
(
MultipartData
Mem
)
:>
MultipartForm
Mem
(
MultipartData
Mem
)
:>
QueryParam
"fileType"
FileType
:>
QueryParam
"fileType"
FileType
:>
"async"
:>
(
AddAPI
WithQuery
)
:>
"async"
:>
AddAPI
()
------------------------------------------------------------------------
-- TODO WithQuery also has a corpus id
-- TODO WithQuery also has a corpus id
addToCorpusJobFunction
::
FlowCmdM
env
err
m
addToCorpusJobFunction
::
FlowCmdM
env
err
m
=>
CorpusId
=>
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