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
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
1fd46635
Commit
1fd46635
authored
Apr 09, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] WebSockets (WIP)
parent
a3caa26a
Pipeline
#1442
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
5 deletions
+21
-5
package.yaml
package.yaml
+1
-0
API.hs
src/Gargantext/API.hs
+1
-4
Routes.hs
src/Gargantext/API/Routes.hs
+15
-0
FrequentItemSet.hs
src/Gargantext/Core/Text/Metrics/FrequentItemSet.hs
+4
-1
No files found.
package.yaml
View file @
1fd46635
...
@@ -217,6 +217,7 @@ library:
...
@@ -217,6 +217,7 @@ library:
-
servant-static-th
-
servant-static-th
-
servant-swagger
-
servant-swagger
-
servant-swagger-ui
-
servant-swagger-ui
-
servant-websockets
-
servant-xml
-
servant-xml
-
simple-reflect
-
simple-reflect
-
singletons
# (IGraph)
-
singletons
# (IGraph)
...
...
src/Gargantext/API.hs
View file @
1fd46635
...
@@ -178,9 +178,6 @@ makeDevMiddleware mode = do
...
@@ -178,9 +178,6 @@ makeDevMiddleware mode = do
-- | API Global
-- | API Global
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------
-- TODO-SECURITY admin only: withAdmin
-- TODO-SECURITY admin only: withAdmin
-- Question: How do we mark admins?
-- Question: How do we mark admins?
{-
{-
...
@@ -226,4 +223,4 @@ type family GenericTypeName t (r :: *) :: Symbol where
...
@@ -226,4 +223,4 @@ type family GenericTypeName t (r :: *) :: Symbol where
GenericTypeName t (D1 ('MetaData name mod pkg nt) f x) = name
GenericTypeName t (D1 ('MetaData name mod pkg nt) f x) = name
type Desc t n = Description (AppendSymbol (TypeName t) (AppendSymbol " | " n))
type Desc t n = Description (AppendSymbol (TypeName t) (AppendSymbol " | " n))
-}
-}
\ No newline at end of file
src/Gargantext/API/Routes.hs
View file @
1fd46635
...
@@ -26,6 +26,12 @@ module Gargantext.API.Routes
...
@@ -26,6 +26,12 @@ module Gargantext.API.Routes
import
Control.Concurrent
(
threadDelay
)
import
Control.Concurrent
(
threadDelay
)
import
Control.Lens
(
view
)
import
Control.Lens
(
view
)
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Aeson
(
Value
)
import
Data.Conduit
(
ConduitT
)
import
Servant.API.WebSocketConduit
(
WebSocketConduit
,
WebSocketSource
)
import
qualified
Data.Conduit.List
as
CL
import
Data.Validity
import
Data.Validity
import
Gargantext.API.Admin.Auth.Types
(
AuthRequest
,
AuthResponse
,
AuthenticatedUser
(
..
),
PathId
(
..
))
import
Gargantext.API.Admin.Auth.Types
(
AuthRequest
,
AuthResponse
,
AuthenticatedUser
(
..
),
PathId
(
..
))
import
Gargantext.API.Admin.Auth
(
withAccess
)
import
Gargantext.API.Admin.Auth
(
withAccess
)
...
@@ -168,6 +174,10 @@ type GargPrivateAPI' =
...
@@ -168,6 +174,10 @@ type GargPrivateAPI' =
:> Capture "x" Int
:> Capture "x" Int
:> WaitAPI -- Get '[JSON] Int
:> WaitAPI -- Get '[JSON] Int
-}
-}
:<|>
"ws"
:>
Summary
"WebSocket Test Route"
:>
WebSocketConduit
Value
Value
-- /mv/<id>/<id>
-- /mv/<id>/<id>
-- /merge/<id>/<id>
-- /merge/<id>/<id>
-- /rename/<id>
-- /rename/<id>
...
@@ -239,7 +249,12 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
...
@@ -239,7 +249,12 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
-- :<|> New.info uid -- TODO-SECURITY
-- :<|> New.info uid -- TODO-SECURITY
:<|>
List
.
api
:<|>
List
.
api
-- :<|> waitAPI
-- :<|> waitAPI
:<|>
echo
-- FIXME which Monad type it is ?
-- echo :: ConduitT Value Value ?? ()
echo
=
CL
.
map
identity
----------------------------------------------------------------------
----------------------------------------------------------------------
-- For Tests
-- For Tests
...
...
src/Gargantext/Core/Text/Metrics/FrequentItemSet.hs
View file @
1fd46635
...
@@ -90,7 +90,10 @@ fisWithSize n f is = case n of
...
@@ -90,7 +90,10 @@ fisWithSize n f is = case n of
fisWith
::
Maybe
([
Item
]
->
Bool
)
->
Frequency
->
[[
Item
]]
->
[
Fis
]
fisWith
::
Maybe
([
Item
]
->
Bool
)
->
Frequency
->
[[
Item
]]
->
[
Fis
]
fisWith
s
f
is
=
case
filter
(
not
.
null
)
is
of
fisWith
s
f
is
=
case
filter
(
not
.
null
)
is
of
[]
->
[]
[]
->
[]
js
->
catMaybes
$
map
items2fis
$
filter'
$
runLCMmatrix
js
f
js
->
catMaybes
$
map
items2fis
$
filter'
$
runLCMmatrix
js
f
-- drop unMaybe
-- drop unMaybe
where
where
filter'
=
case
s
of
filter'
=
case
s
of
...
...
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