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
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
Christian Merten
haskell-gargantext
Commits
fe51b054
Commit
fe51b054
authored
Aug 30, 2022
by
Alp Mestanogullari
Committed by
Karen Konou
Sep 03, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Gargantext.API.Client
parent
1781ba63
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
4 deletions
+15
-4
package.yaml
package.yaml
+1
-0
Client.hs
src/Gargantext/API/Client.hs
+4
-2
Image.hs
src/Gargantext/API/Image.hs
+9
-2
stack.yaml
stack.yaml
+1
-0
No files found.
package.yaml
View file @
fe51b054
...
...
@@ -250,6 +250,7 @@ library:
-
servant-job
-
servant-mock
-
servant-multipart
-
servant-multipart-client
-
servant-server
-
servant-static-th
-
servant-swagger
...
...
src/Gargantext/API/Client.hs
View file @
fe51b054
...
...
@@ -4,6 +4,7 @@
module
Gargantext.API.Client
where
import
qualified
Data.ByteString.Lazy
as
LBS
import
Data.Int
import
Data.Maybe
import
Data.Map
(
Map
)
...
...
@@ -59,7 +60,8 @@ import Servant.Job.Core
import
Servant.Job.Types
import
System.Metrics.Json
(
Sample
,
Value
)
import
Gargantext.API.Image
(
IntResponse
)
import
Servant.Multipart
(
MultipartData
,
Mem
,
MultipartForm
)
import
Servant.Multipart
(
MultipartData
,
Mem
)
import
Servant.Multipart.Client
()
-- * version API
...
...
@@ -424,7 +426,7 @@ pollListCsvUpdateAsyncJob :: Token -> NodeId -> JobID 'Unsafe -> Maybe Limit ->
waitListCsvUpdateAsyncJob
::
Token
->
NodeId
->
JobID
'U
n
safe
->
ClientM
(
JobOutput
JobLog
)
-- * image upload api
postUploadImage
::
Token
->
MultipartForm
Mem
(
MultipartData
Mem
)
->
ClientM
IntResponse
postUploadImage
::
Token
->
(
LBS
.
ByteString
,
MultipartData
Mem
)
->
ClientM
IntResponse
-- * public API
getPublicData
::
ClientM
[
PublicData
]
...
...
src/Gargantext/API/Image.hs
View file @
fe51b054
...
...
@@ -26,7 +26,8 @@ import Gargantext.API.GraphQL.UserInfo (ui_cwImagePathL)
import
Gargantext.Database.Schema.Node
(
node_id
,
node_hyperdata
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Control.Lens
import
Data.Aeson
(
ToJSON
)
import
Data.Aeson
(
FromJSON
,
ToJSON
)
import
Servant.Ekg
import
Servant.Swagger.Internal
import
Data.Monoid
(
mempty
)
...
...
@@ -37,7 +38,12 @@ type ImageUploadAPI = Summary "Image upload endpoint"
imageUploadAPI
::
UserId
->
GargServer
ImageUploadAPI
imageUploadAPI
=
upload
instance
ToParamSchema
(
MultipartData
Mem
)
where
toParamSchema
_
=
toParamSchema
(
Proxy
::
Proxy
TODO
)
instance
HasEndpoint
sub
=>
HasEndpoint
(
MultipartForm
backend
a
:>
sub
)
where
getEndpoint
_
=
getEndpoint
(
Proxy
::
Proxy
sub
)
enumerateEndpoints
_
=
enumerateEndpoints
(
Proxy
::
Proxy
sub
)
instance
ToParamSchema
(
MultipartData
Mem
)
where
toParamSchema
_
=
toParamSchema
(
Proxy
::
Proxy
TODO
)
instance
(
ToParamSchema
a
,
HasSwagger
sub
)
=>
HasSwagger
(
MultipartForm
tag
a
:>
sub
)
where
...
...
@@ -55,6 +61,7 @@ instance (ToParamSchema a, HasSwagger sub) =>
newtype
IntResponse
=
IntResponse
Int
deriving
(
Generic
)
instance
FromJSON
IntResponse
instance
ToJSON
IntResponse
instance
ToSchema
IntResponse
where
declareNamedSchema
_
=
declareNamedSchema
(
Proxy
::
Proxy
TODO
)
...
...
stack.yaml
View file @
fe51b054
...
...
@@ -153,6 +153,7 @@ extra-deps:
-
servant-cassava-0.10.1@sha256:07e7b6ca67cf57dcb4a0041a399a25d058844505837c6479e01d62be59d01fdf,1665
-
servant-flatten-0.2@sha256:276896f7c5cdec5b8f8493f6205fded0cc602d050b58fdb09a6d7c85c3bb0837,1234
-
servant-mock-0.8.7@sha256:64cb3e52bbd51ab6cb25e3f412a99ea712c6c26f1efd117f01a8d1664df49c67,2306
-
servant-multipart-client-0.12.1@sha256:fdaeea6a7e3b5459321520606a5dc0be55e16ebc3abe245fddb14df8a34a08cb,1976
-
servant-xml-1.0.1.4@sha256:6c9f2986ac42e72fe24b794c660763a1966a18d696b34cd4f4ed15165edd4aa0,851
-
stemmer-0.5.2@sha256:823aec56249ec2619f60a2c0d1384b732894dbbbe642856d337ebfe9629a0efd,4082
-
xmlbf-0.6.1@sha256:57867fcb39e0514d17b3328ff5de8d241a18482fc89bb742d9ed820a6a2a5187,1540
...
...
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