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
200
Issues
200
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
a250518a
Verified
Commit
a250518a
authored
Nov 19, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[worker] job comments added
Also, some import refactoring
parent
a4185c58
Pipeline
#6989
failed with stages
in 63 minutes and 58 seconds
Changes
26
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
176 additions
and
128 deletions
+176
-128
gargantext.cabal
gargantext.cabal
+3
-3
Contact.hs
src/Gargantext/API/Node/Contact.hs
+2
-2
Types.hs
src/Gargantext/API/Node/Contact/Types.hs
+1
-5
Annuaire.hs
src/Gargantext/API/Node/Corpus/Annuaire.hs
+2
-3
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+1
-1
Types.hs
src/Gargantext/API/Node/Corpus/New/Types.hs
+1
-6
Searx.hs
src/Gargantext/API/Node/Corpus/Searx.hs
+1
-1
Types.hs
src/Gargantext/API/Node/Corpus/Types.hs
+0
-7
Update.hs
src/Gargantext/API/Node/Corpus/Update.hs
+5
-6
DocumentsFromWriteNodes.hs
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
+4
-4
Get.hs
src/Gargantext/API/Node/Get.hs
+0
-8
New.hs
src/Gargantext/API/Node/New.hs
+5
-5
Types.hs
src/Gargantext/API/Node/New/Types.hs
+2
-7
Export.hs
src/Gargantext/API/Node/Phylo/Export.hs
+1
-1
Types.hs
src/Gargantext/API/Node/Phylo/Export/Types.hs
+6
-6
Share.hs
src/Gargantext/API/Node/Share.hs
+5
-5
Types.hs
src/Gargantext/API/Node/Share/Types.hs
+3
-8
ShareURL.hs
src/Gargantext/API/Node/ShareURL.hs
+4
-4
Types.hs
src/Gargantext/API/Node/Types.hs
+3
-3
Update.hs
src/Gargantext/API/Node/Update.hs
+1
-1
Types.hs
src/Gargantext/API/Node/Update/Types.hs
+2
-25
WebSocket.hs
src/Gargantext/Core/Notifications/Dispatcher/WebSocket.hs
+6
-4
Worker.hs
src/Gargantext/Core/Worker.hs
+29
-0
Jobs.hs
src/Gargantext/Core/Worker/Jobs.hs
+16
-5
Metrics.hs
src/Gargantext/Database/Admin/Types/Metrics.hs
+14
-6
Instances.hs
test/Test/Instances.hs
+59
-2
No files found.
gargantext.cabal
View file @
a250518a
...
@@ -127,6 +127,7 @@ library
...
@@ -127,6 +127,7 @@ library
Gargantext.API.Ngrams.Tools
Gargantext.API.Ngrams.Tools
Gargantext.API.Ngrams.Types
Gargantext.API.Ngrams.Types
Gargantext.API.Node
Gargantext.API.Node
Gargantext.API.Node.Contact.Types
Gargantext.API.Node.Corpus.Annuaire
Gargantext.API.Node.Corpus.Annuaire
Gargantext.API.Node.Corpus.New
Gargantext.API.Node.Corpus.New
Gargantext.API.Node.Corpus.New.Types
Gargantext.API.Node.Corpus.New.Types
...
@@ -137,6 +138,8 @@ library
...
@@ -137,6 +138,8 @@ library
Gargantext.API.Node.File
Gargantext.API.Node.File
Gargantext.API.Node.File.Types
Gargantext.API.Node.File.Types
Gargantext.API.Node.FrameCalcUpload.Types
Gargantext.API.Node.FrameCalcUpload.Types
Gargantext.API.Node.Get
Gargantext.API.Node.New.Types
Gargantext.API.Node.Share
Gargantext.API.Node.Share
Gargantext.API.Node.Share.Types
Gargantext.API.Node.Share.Types
Gargantext.API.Node.ShareURL
Gargantext.API.Node.ShareURL
...
@@ -316,7 +319,6 @@ library
...
@@ -316,7 +319,6 @@ library
Gargantext.API.Metrics
Gargantext.API.Metrics
Gargantext.API.Ngrams.NgramsTree
Gargantext.API.Ngrams.NgramsTree
Gargantext.API.Node.Contact
Gargantext.API.Node.Contact
Gargantext.API.Node.Contact.Types
Gargantext.API.Node.Corpus.Export
Gargantext.API.Node.Corpus.Export
Gargantext.API.Node.Corpus.Export.Types
Gargantext.API.Node.Corpus.Export.Types
Gargantext.API.Node.Corpus.Searx
Gargantext.API.Node.Corpus.Searx
...
@@ -327,9 +329,7 @@ library
...
@@ -327,9 +329,7 @@ library
Gargantext.API.Node.DocumentUpload
Gargantext.API.Node.DocumentUpload
Gargantext.API.Node.DocumentsFromWriteNodes
Gargantext.API.Node.DocumentsFromWriteNodes
Gargantext.API.Node.FrameCalcUpload
Gargantext.API.Node.FrameCalcUpload
Gargantext.API.Node.Get
Gargantext.API.Node.New
Gargantext.API.Node.New
Gargantext.API.Node.New.Types
Gargantext.API.Public.Types
Gargantext.API.Public.Types
Gargantext.API.Search
Gargantext.API.Search
Gargantext.API.Search.Types
Gargantext.API.Search.Types
...
...
src/Gargantext/API/Node/Contact.hs
View file @
a250518a
...
@@ -22,7 +22,7 @@ import Gargantext.API.Admin.Auth.Types ( AuthenticatedUser(AuthenticatedUser) )
...
@@ -22,7 +22,7 @@ import Gargantext.API.Admin.Auth.Types ( AuthenticatedUser(AuthenticatedUser) )
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Node
(
nodeNodeAPI
)
import
Gargantext.API.Node
(
nodeNodeAPI
)
import
Gargantext.API.Node.Contact.Types
import
Gargantext.API.Node.Contact.Types
(
AddContactParams
(
..
))
import
Gargantext.API.Prelude
(
GargM
,
simuLogs
)
import
Gargantext.API.Prelude
(
GargM
,
simuLogs
)
import
Gargantext.API.Routes.Named.Contact
qualified
as
Named
import
Gargantext.API.Routes.Named.Contact
qualified
as
Named
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.API.Worker
(
serveWorkerAPI
)
...
@@ -41,6 +41,7 @@ import Gargantext.Utils.Jobs.Monad (MonadJobStatus(..))
...
@@ -41,6 +41,7 @@ import Gargantext.Utils.Jobs.Monad (MonadJobStatus(..))
import
Servant
import
Servant
import
Servant.Server.Generic
(
AsServerT
)
import
Servant.Server.Generic
(
AsServerT
)
contactAPI
::
AuthenticatedUser
->
CorpusId
->
Named
.
ContactAPI
(
AsServerT
(
GargM
Env
BackendInternalError
))
contactAPI
::
AuthenticatedUser
->
CorpusId
->
Named
.
ContactAPI
(
AsServerT
(
GargM
Env
BackendInternalError
))
contactAPI
authUser
@
(
AuthenticatedUser
userNodeId
_userUserId
)
cid
=
Named
.
ContactAPI
contactAPI
authUser
@
(
AuthenticatedUser
userNodeId
_userUserId
)
cid
=
Named
.
ContactAPI
{
contactAsyncAPI
=
apiAsync
(
RootId
userNodeId
)
cid
{
contactAsyncAPI
=
apiAsync
(
RootId
userNodeId
)
cid
...
@@ -55,7 +56,6 @@ apiAsync u nId = Named.ContactAsyncAPI {
...
@@ -55,7 +56,6 @@ apiAsync u nId = Named.ContactAsyncAPI {
,
_ac_node_id
=
nId
,
_ac_node_id
=
nId
,
_ac_user
=
u
}
,
_ac_user
=
u
}
}
}
-- addContact u nId p jHandle
addContact
::
(
FlowCmdM
env
err
m
,
MonadJobStatus
m
)
addContact
::
(
FlowCmdM
env
err
m
,
MonadJobStatus
m
)
=>
User
=>
User
...
...
src/Gargantext/API/Node/Contact/Types.hs
View file @
a250518a
...
@@ -12,11 +12,9 @@ Portability : POSIX
...
@@ -12,11 +12,9 @@ Portability : POSIX
module
Gargantext.API.Node.Contact.Types
where
module
Gargantext.API.Node.Contact.Types
where
import
Data.Aeson
import
Data.Aeson
import
Data.Swagger
import
Data.Swagger
(
ToSchema
)
import
GHC.Generics
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Test.QuickCheck
------------------------------------------------------------------------
------------------------------------------------------------------------
data
AddContactParams
=
AddContactParams
{
firstname
::
!
Text
,
lastname
::
!
Text
}
data
AddContactParams
=
AddContactParams
{
firstname
::
!
Text
,
lastname
::
!
Text
}
...
@@ -35,7 +33,5 @@ instance ToJSON AddContactParams where
...
@@ -35,7 +33,5 @@ instance ToJSON AddContactParams where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
instance
ToSchema
AddContactParams
instance
ToSchema
AddContactParams
instance
Arbitrary
AddContactParams
where
arbitrary
=
elements
[
AddContactParams
"Pierre"
"Dupont"
]
------------------------------------------------------------------------
------------------------------------------------------------------------
src/Gargantext/API/Node/Corpus/Annuaire.hs
View file @
a250518a
...
@@ -14,9 +14,8 @@ Portability : POSIX
...
@@ -14,9 +14,8 @@ Portability : POSIX
module
Gargantext.API.Node.Corpus.Annuaire
module
Gargantext.API.Node.Corpus.Annuaire
where
where
import
Control.Lens
hiding
(
elements
)
import
Data.Aeson
(
genericParseJSON
,
genericToJSON
)
import
Data.Aeson
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Swagger
import
Gargantext.API.Node.Corpus.New.Types
qualified
as
NewTypes
import
Gargantext.API.Node.Corpus.New.Types
qualified
as
NewTypes
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
)
import
Gargantext.Core.Utils.Prefix
(
unPrefixSwagger
)
...
...
src/Gargantext/API/Node/Corpus/New.hs
View file @
a250518a
...
@@ -20,7 +20,7 @@ module Gargantext.API.Node.Corpus.New
...
@@ -20,7 +20,7 @@ module Gargantext.API.Node.Corpus.New
where
where
import
Conduit
import
Conduit
((
.|
),
yieldMany
,
mapMC
,
mapC
,
transPipe
)
import
Control.Lens
(
view
,
non
)
import
Control.Lens
(
view
,
non
)
import
Data.ByteString.Base64
qualified
as
BSB64
import
Data.ByteString.Base64
qualified
as
BSB64
import
Data.Conduit.Internal
(
zipSources
)
import
Data.Conduit.Internal
(
zipSources
)
...
...
src/Gargantext/API/Node/Corpus/New/Types.hs
View file @
a250518a
...
@@ -10,13 +10,10 @@ Portability : POSIX
...
@@ -10,13 +10,10 @@ Portability : POSIX
module
Gargantext.API.Node.Corpus.New.Types
where
module
Gargantext.API.Node.Corpus.New.Types
where
import
Data.Aeson
import
Data.Swagger
(
ToSchema
,
ToParamSchema
)
import
Data.Swagger
import
Data.Text
(
pack
)
import
Data.Text
(
pack
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Servant
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
data
FileType
=
TSV
data
FileType
=
TSV
|
TSV_HAL
|
TSV_HAL
...
@@ -27,7 +24,6 @@ data FileType = TSV
...
@@ -27,7 +24,6 @@ data FileType = TSV
|
JSON
|
JSON
deriving
(
Eq
,
Show
,
Generic
)
deriving
(
Eq
,
Show
,
Generic
)
instance
ToSchema
FileType
instance
ToSchema
FileType
instance
Arbitrary
FileType
where
arbitrary
=
elements
[
TSV
,
PresseRIS
]
instance
ToParamSchema
FileType
instance
ToParamSchema
FileType
instance
FromJSON
FileType
instance
FromJSON
FileType
instance
ToJSON
FileType
instance
ToJSON
FileType
...
@@ -47,7 +43,6 @@ instance ToHttpApiData FileType where
...
@@ -47,7 +43,6 @@ instance ToHttpApiData FileType where
data
FileFormat
=
Plain
|
ZIP
data
FileFormat
=
Plain
|
ZIP
deriving
(
Eq
,
Show
,
Generic
)
deriving
(
Eq
,
Show
,
Generic
)
instance
ToSchema
FileFormat
instance
ToSchema
FileFormat
instance
Arbitrary
FileFormat
where
arbitrary
=
elements
[
Plain
,
ZIP
]
instance
ToParamSchema
FileFormat
instance
ToParamSchema
FileFormat
instance
FromJSON
FileFormat
instance
FromJSON
FileFormat
instance
ToJSON
FileFormat
instance
ToJSON
FileFormat
...
...
src/Gargantext/API/Node/Corpus/Searx.hs
View file @
a250518a
...
@@ -43,7 +43,7 @@ import Gargantext.Database.Query.Table.Node (getOrMkList, insertDefaultNodeIfNot
...
@@ -43,7 +43,7 @@ import Gargantext.Database.Query.Table.Node (getOrMkList, insertDefaultNodeIfNot
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Tree.Error
(
HasTreeError
)
import
Gargantext.Database.Query.Tree.Error
(
HasTreeError
)
import
Gargantext.Database.Query.Tree.Root
(
getOrMkRootWithCorpus
,
MkCorpusUser
(
MkCorpusUserMaster
))
import
Gargantext.Database.Query.Tree.Root
(
getOrMkRootWithCorpus
,
MkCorpusUser
(
MkCorpusUserMaster
))
import
Gargantext.Prelude
hiding
(
All
)
import
Gargantext.Prelude
import
Gargantext.Utils.Jobs.Monad
(
JobHandle
,
MonadJobStatus
(
..
))
import
Gargantext.Utils.Jobs.Monad
(
JobHandle
,
MonadJobStatus
(
..
))
import
Network.HTTP.Client
import
Network.HTTP.Client
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
import
Network.HTTP.Client.TLS
(
tlsManagerSettings
)
...
...
src/Gargantext/API/Node/Corpus/Types.hs
View file @
a250518a
...
@@ -22,7 +22,6 @@ import Gargantext.API.Admin.Orchestrator.Types qualified as Types
...
@@ -22,7 +22,6 @@ import Gargantext.API.Admin.Orchestrator.Types qualified as Types
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Action.Flow.Types
(
DataOrigin
(
..
))
import
Gargantext.Database.Action.Flow.Types
(
DataOrigin
(
..
))
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Test.QuickCheck
(
Arbitrary
(
..
),
oneof
,
arbitraryBoundedEnum
)
data
Database
=
Empty
data
Database
=
Empty
|
OpenAlex
|
OpenAlex
...
@@ -34,9 +33,6 @@ data Database = Empty
...
@@ -34,9 +33,6 @@ data Database = Empty
|
EPO
|
EPO
deriving
(
Eq
,
Show
,
Generic
,
Enum
,
Bounded
)
deriving
(
Eq
,
Show
,
Generic
,
Enum
,
Bounded
)
instance
Arbitrary
Database
where
arbitrary
=
arbitraryBoundedEnum
deriveJSON
(
unPrefix
""
)
''
D
atabase
deriveJSON
(
unPrefix
""
)
''
D
atabase
instance
ToSchema
Database
where
instance
ToSchema
Database
where
declareNamedSchema
=
genericDeclareNamedSchemaUnrestricted
defaultSchemaOptions
declareNamedSchema
=
genericDeclareNamedSchemaUnrestricted
defaultSchemaOptions
...
@@ -72,9 +68,6 @@ instance ToJSON Datafield where
...
@@ -72,9 +68,6 @@ instance ToJSON Datafield where
toJSON
(
External
db
)
=
toJSON
$
object
[
(
"External"
,
toJSON
db
)
]
toJSON
(
External
db
)
=
toJSON
$
object
[
(
"External"
,
toJSON
db
)
]
toJSON
s
=
toJSON
(
show
s
::
Text
)
toJSON
s
=
toJSON
(
show
s
::
Text
)
instance
Arbitrary
Datafield
where
arbitrary
=
oneof
[
pure
Gargantext
,
pure
Web
,
pure
Files
,
External
<$>
arbitrary
]
instance
ToSchema
Datafield
where
instance
ToSchema
Datafield
where
declareNamedSchema
_
=
do
declareNamedSchema
_
=
do
pure
$
NamedSchema
(
Just
"Datafield"
)
$
mempty
pure
$
NamedSchema
(
Just
"Datafield"
)
$
mempty
...
...
src/Gargantext/API/Node/Corpus/Update.hs
View file @
a250518a
...
@@ -16,13 +16,12 @@ module Gargantext.API.Node.Corpus.Update
...
@@ -16,13 +16,12 @@ module Gargantext.API.Node.Corpus.Update
where
where
import
Control.Lens
(
over
)
import
Control.Lens
(
over
)
import
Control.Monad
import
Gargantext.Core
(
Lang
)
import
Gargantext.Core
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
(
HyperdataCorpus
,
_hc_lang
)
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
DbCmd
'
)
import
Gargantext.Database.Prelude
(
DbCmd
'
)
import
Gargantext.Database.Query.Table.Node
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
)
import
Gargantext.Prelude
import
Gargantext.Prelude
...
...
src/Gargantext/API/Node/DocumentsFromWriteNodes.hs
View file @
a250518a
...
@@ -23,14 +23,14 @@ import Gargantext.API.Admin.Auth.Types ( AuthenticatedUser, auth_node_id, auth_u
...
@@ -23,14 +23,14 @@ import Gargantext.API.Admin.Auth.Types ( AuthenticatedUser, auth_node_id, auth_u
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Ngrams
(
commitStatePatch
,
Versioned
(
..
))
import
Gargantext.API.Ngrams
(
commitStatePatch
,
Versioned
(
..
))
import
Gargantext.API.Node.DocumentsFromWriteNodes.Types
import
Gargantext.API.Node.DocumentsFromWriteNodes.Types
(
Params
(
..
))
import
Gargantext.API.Prelude
(
GargM
)
import
Gargantext.API.Prelude
(
GargM
)
import
Gargantext.API.Routes.Named.Document
qualified
as
Named
import
Gargantext.API.Routes.Named.Document
qualified
as
Named
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
)
import
Gargantext.Core.Text.Corpus.Parsers.Date
(
split'
)
import
Gargantext.Core.Text.Corpus.Parsers.Date
(
split'
)
import
Gargantext.Core.Text.Corpus.Parsers.FrameWrite
import
Gargantext.Core.Text.Corpus.Parsers.FrameWrite
(
Author
(
..
),
Parsed
(
..
),
parseLines
,
text2titleParagraphs
)
import
Gargantext.Core.Text.Terms
(
TermType
(
..
))
import
Gargantext.Core.Text.Terms
(
TermType
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
...
@@ -42,9 +42,9 @@ import Gargantext.Database.Admin.Types.Node ( NodeId, Node, NodeType(..) )
...
@@ -42,9 +42,9 @@ import Gargantext.Database.Admin.Types.Node ( NodeId, Node, NodeType(..) )
import
Gargantext.Database.Query.Table.Node
(
getChildrenByType
,
getClosestParentIdByType'
,
getNodeWith
,
getOrMkList
)
import
Gargantext.Database.Query.Table.Node
(
getChildrenByType
,
getClosestParentIdByType'
,
getNodeWith
,
getOrMkList
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
,
node_name
,
node_date
)
import
Gargantext.Database.Schema.Node
(
node_hyperdata
,
node_name
,
node_date
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.System.Logging
import
Gargantext.System.Logging
(
logLocM
,
LogLevel
(
..
))
import
Gargantext.Utils.Jobs.Monad
(
MonadJobStatus
(
..
))
import
Gargantext.Utils.Jobs.Monad
(
MonadJobStatus
(
..
))
import
Gargantext.Utils.Jobs.Error
import
Gargantext.Utils.Jobs.Error
(
HumanFriendlyErrorText
(
..
))
import
Servant.Server.Generic
(
AsServerT
)
import
Servant.Server.Generic
(
AsServerT
)
api
::
AuthenticatedUser
api
::
AuthenticatedUser
...
...
src/Gargantext/API/Node/Get.hs
View file @
a250518a
...
@@ -11,11 +11,6 @@ Polymorphic Get Node API
...
@@ -11,11 +11,6 @@ Polymorphic Get Node API
-}
-}
{-# OPTIONS_GHC -fno-warn-deprecations #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Node.Get
module
Gargantext.API.Node.Get
where
where
...
@@ -23,7 +18,6 @@ import Data.Aeson
...
@@ -23,7 +18,6 @@ import Data.Aeson
import
Data.Swagger
import
Data.Swagger
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Test.QuickCheck.Arbitrary
------------------------------------------------------------------------
------------------------------------------------------------------------
data
GetNodeParams
=
GetNodeParams
{
node_id
::
NodeId
data
GetNodeParams
=
GetNodeParams
{
node_id
::
NodeId
...
@@ -39,7 +33,5 @@ instance ToJSON GetNodeParams where
...
@@ -39,7 +33,5 @@ instance ToJSON GetNodeParams where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
})
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
ObjectWithSingleField
})
instance
ToSchema
GetNodeParams
instance
ToSchema
GetNodeParams
instance
Arbitrary
GetNodeParams
where
arbitrary
=
GetNodeParams
<$>
arbitrary
<*>
arbitrary
------------------------------------------------------------------------
------------------------------------------------------------------------
src/Gargantext/API/Node/New.hs
View file @
a250518a
...
@@ -18,18 +18,18 @@ module Gargantext.API.Node.New
...
@@ -18,18 +18,18 @@ module Gargantext.API.Node.New
where
where
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Gargantext.API.Admin.Auth.Types
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
,
auth_user_id
)
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Admin.EnvTypes
(
Env
)
import
Gargantext.API.Errors.Types
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Node.New.Types
import
Gargantext.API.Node.New.Types
(
PostNode
(
..
))
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
(
GargM
)
import
Gargantext.API.Routes.Named.Node
qualified
as
Named
import
Gargantext.API.Routes.Named.Node
qualified
as
Named
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.Core.Mail.Types
(
HasMail
)
import
Gargantext.Core.Mail.Types
(
HasMail
)
import
Gargantext.Core.Notifications.CentralExchange.Types
qualified
as
CE
import
Gargantext.Core.Notifications.CentralExchange.Types
qualified
as
CE
import
Gargantext.Core.NLP
(
HasNLPServer
)
import
Gargantext.Core.NLP
(
HasNLPServer
)
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Database.Action.Node
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
CmdM
,
DBCmd
'
)
import
Gargantext.Database.Prelude
(
CmdM
,
DBCmd
'
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
...
...
src/Gargantext/API/Node/New/Types.hs
View file @
a250518a
...
@@ -13,13 +13,10 @@ module Gargantext.API.Node.New.Types (
...
@@ -13,13 +13,10 @@ module Gargantext.API.Node.New.Types (
PostNode
(
..
)
PostNode
(
..
)
)
where
)
where
import
Data.Aeson
import
Data.Swagger
(
ToSchema
)
import
Data.Swagger
import
GHC.Generics
import
Gargantext.Core.Types
(
NodeType
(
..
))
import
Gargantext.Core.Types
(
NodeType
(
..
))
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Test.QuickCheck
import
Web.FormUrlEncoded
(
FromForm
,
ToForm
)
import
Web.FormUrlEncoded
------------------------------------------------------------------------
------------------------------------------------------------------------
data
PostNode
=
PostNode
{
pn_name
::
Text
data
PostNode
=
PostNode
{
pn_name
::
Text
...
@@ -32,6 +29,4 @@ instance ToJSON PostNode
...
@@ -32,6 +29,4 @@ instance ToJSON PostNode
instance
ToSchema
PostNode
instance
ToSchema
PostNode
instance
FromForm
PostNode
instance
FromForm
PostNode
instance
ToForm
PostNode
instance
ToForm
PostNode
instance
Arbitrary
PostNode
where
arbitrary
=
elements
[
PostNode
"Node test"
NodeCorpus
]
src/Gargantext/API/Node/Phylo/Export.hs
View file @
a250518a
...
@@ -11,7 +11,7 @@ Portability : POSIX
...
@@ -11,7 +11,7 @@ Portability : POSIX
module
Gargantext.API.Node.Phylo.Export
module
Gargantext.API.Node.Phylo.Export
where
where
import
Data.Aeson
import
Data.Aeson
(
Value
)
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
Gargantext.API.Prelude
(
GargNoServer
,
IsGargServer
)
import
Gargantext.API.Prelude
(
GargNoServer
,
IsGargServer
)
import
Gargantext.API.Routes.Named.Viz
qualified
as
Named
import
Gargantext.API.Routes.Named.Viz
qualified
as
Named
...
...
src/Gargantext/API/Node/Phylo/Export/Types.hs
View file @
a250518a
...
@@ -13,20 +13,20 @@ Portability : POSIX
...
@@ -13,20 +13,20 @@ Portability : POSIX
module
Gargantext.API.Node.Phylo.Export.Types
where
module
Gargantext.API.Node.Phylo.Export.Types
where
import
Data.Aeson.TH
(
deriveJSON
)
--, PlainText, MimeRender(..
)
-- import Data.Csv (DefaultOrdered(..), ToNamedRecord(..), (.=), header, namedRecord)
-- import Data.Csv (DefaultOrdered(..), ToNamedRecord(..), (.=), header, namedRecord)
import
Data.Swagger
(
genericDeclareNamedSchema
,
ToParamSchema
(
..
),
ToSchema
(
..
)
)
-- import Data.Text qualified as T
-- import Data.Text qualified as T
-- import Data.Text.Encoding qualified as TE
-- import Data.Text.Encoding qualified as TE
-- import Gargantext.Database.Schema.Node (NodePoly(..))
-- import Gargantext.Utils.Servant (ZIP)
-- import Gargantext.Utils.Zip (zipContentsPure)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
(
genericDeclareNamedSchema
,
ToParamSchema
(
..
),
ToSchema
(
..
)
)
import
Gargantext.Core.Types
(
Node
,
TODO
)
import
Gargantext.Core.Types
(
Node
,
TODO
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
)
import
Gargantext.Database.Admin.Types.Hyperdata.Phylo
(
HyperdataPhylo
(
..
)
)
import
Gargantext.Database.Admin.Types.Hyperdata.Phylo
(
HyperdataPhylo
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
PhyloId
)
import
Gargantext.Database.Admin.Types.Node
(
PhyloId
)
-- import Gargantext.Database.Schema.Node (NodePoly(..))
-- import Gargantext.Utils.Servant (ZIP)
-- import Gargantext.Utils.Zip (zipContentsPure)
import
Protolude
import
Protolude
--, PlainText, MimeRender(..)
-- | Phylo Export
-- | Phylo Export
...
...
src/Gargantext/API/Node/Share.hs
View file @
a250518a
...
@@ -17,17 +17,17 @@ module Gargantext.API.Node.Share
...
@@ -17,17 +17,17 @@ module Gargantext.API.Node.Share
import
Data.List
qualified
as
List
import
Data.List
qualified
as
List
import
Data.Text
qualified
as
Text
import
Data.Text
qualified
as
Text
import
Gargantext.API.Node.Share.Types
import
Gargantext.API.Node.Share.Types
(
ShareNodeParams
(
..
))
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
(
IsGargServer
)
import
Gargantext.API.Routes.Named.Share
qualified
as
Named
import
Gargantext.API.Routes.Named.Share
qualified
as
Named
import
Gargantext.Core.Notifications.CentralExchange.Types
(
HasCentralExchangeNotification
)
import
Gargantext.Core.Notifications.CentralExchange.Types
(
HasCentralExchangeNotification
)
import
Gargantext.Core.NLP
(
HasNLPServer
)
import
Gargantext.Core.NLP
(
HasNLPServer
)
import
Gargantext.Core.Types.Individu
(
User
(
..
),
arbitraryUsername
)
import
Gargantext.Core.Types.Individu
(
User
(
..
),
arbitraryUsername
)
import
Gargantext.Database.Action.Share
(
ShareNodeWith
(
..
))
import
Gargantext.Database.Action.Share
(
ShareNodeWith
(
..
))
import
Gargantext.Database.Action.Share
as
DB
(
shareNodeWith
,
unPublish
)
import
Gargantext.Database.Action.Share
as
DB
(
shareNodeWith
,
unPublish
)
import
Gargantext.Database.Action.User
import
Gargantext.Database.Action.User
(
getUserId'
,
getUsername
)
import
Gargantext.Database.Action.User.New
import
Gargantext.Database.Action.User.New
(
guessUserName
,
newUser
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
(
..
),
UserId
(
..
))
import
Gargantext.Database.Prelude
(
CmdRandom
)
import
Gargantext.Database.Prelude
(
CmdRandom
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Tree
(
findNodesWithType
)
import
Gargantext.Database.Query.Tree
(
findNodesWithType
)
...
...
src/Gargantext/API/Node/Share/Types.hs
View file @
a250518a
...
@@ -2,12 +2,11 @@
...
@@ -2,12 +2,11 @@
module
Gargantext.API.Node.Share.Types
where
module
Gargantext.API.Node.Share.Types
where
import
Data.Aeson
import
Data.Aeson
import
Data.Swagger
import
Data.Swagger
(
ToSchema
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
data
ShareNodeParams
=
ShareTeamParams
{
username
::
Text
}
data
ShareNodeParams
=
ShareTeamParams
{
username
::
Text
}
|
SharePublicParams
{
node_id
::
NodeId
}
|
SharePublicParams
{
node_id
::
NodeId
}
...
@@ -19,7 +18,3 @@ instance FromJSON ShareNodeParams where
...
@@ -19,7 +18,3 @@ instance FromJSON ShareNodeParams where
instance
ToJSON
ShareNodeParams
where
instance
ToJSON
ShareNodeParams
where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
instance
ToSchema
ShareNodeParams
instance
ToSchema
ShareNodeParams
instance
Arbitrary
ShareNodeParams
where
arbitrary
=
elements
[
ShareTeamParams
"user1"
,
SharePublicParams
(
UnsafeMkNodeId
1
)
]
src/Gargantext/API/Node/ShareURL.hs
View file @
a250518a
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Node.ShareURL
where
module
Gargantext.API.Node.ShareURL
where
import
Control.Lens
import
Control.Lens
(
view
,
(
#
))
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
Data.Validity
qualified
as
V
import
Data.Validity
qualified
as
V
import
Gargantext.API.Prelude
import
Gargantext.API.Prelude
(
IsGargServer
)
import
Gargantext.API.Routes.Named.Share
qualified
as
Named
import
Gargantext.API.Routes.Named.Share
qualified
as
Named
import
Gargantext.Core.Config
(
GargConfig
,
gc_frontend_config
,
HasConfig
(
hasConfig
))
import
Gargantext.Core.Config
(
GargConfig
,
gc_frontend_config
,
HasConfig
(
hasConfig
))
import
Gargantext.Core.Config.Types
(
fc_appPort
,
fc_url
)
import
Gargantext.Core.Config.Types
(
fc_appPort
,
fc_url
)
...
...
src/Gargantext/API/Node/Types.hs
View file @
a250518a
...
@@ -13,10 +13,10 @@ Portability : POSIX
...
@@ -13,10 +13,10 @@ Portability : POSIX
module
Gargantext.API.Node.Types
where
module
Gargantext.API.Node.Types
where
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Control.Lens
hiding
(
elements
,
Empty
)
import
Data.Aeson
import
Data.Aeson
(
genericParseJSON
,
genericToJSON
)
import
Data.ByteString
qualified
as
BS
import
Data.ByteString
qualified
as
BS
import
Data.ByteString.Base64
qualified
as
BSB64
import
Data.ByteString.Base64
qualified
as
BSB64
import
Data.Swagger
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
Gargantext.API.Node.Corpus.New.Types
(
FileType
,
FileFormat
)
import
Gargantext.API.Node.Corpus.New.Types
(
FileType
,
FileFormat
)
import
Gargantext.API.Node.Corpus.Types
import
Gargantext.API.Node.Corpus.Types
...
@@ -28,7 +28,7 @@ import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
...
@@ -28,7 +28,7 @@ import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Servant.Job.Utils
(
jsonOptions
)
import
Servant.Job.Utils
(
jsonOptions
)
import
Web.FormUrlEncoded
(
FromForm
,
ToForm
)
import
Web.FormUrlEncoded
(
FromForm
,
ToForm
)
-------------------------------------------------------
-------------------------------------------------------
data
NewWithForm
=
NewWithForm
data
NewWithForm
=
NewWithForm
...
...
src/Gargantext/API/Node/Update.hs
View file @
a250518a
...
@@ -21,7 +21,7 @@ import Gargantext.API.Admin.EnvTypes (Env)
...
@@ -21,7 +21,7 @@ import Gargantext.API.Admin.EnvTypes (Env)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Errors.Types
(
BackendInternalError
)
import
Gargantext.API.Metrics
qualified
as
Metrics
import
Gargantext.API.Metrics
qualified
as
Metrics
import
Gargantext.API.Ngrams.Types
qualified
as
NgramsTypes
import
Gargantext.API.Ngrams.Types
qualified
as
NgramsTypes
import
Gargantext.API.Node.Update.Types
import
Gargantext.API.Node.Update.Types
(
Method
(
..
),
UpdateNodeParams
(
..
),
UpdateNodeConfigGraph
(
..
))
import
Gargantext.API.Prelude
(
GargM
,
simuLogs
)
import
Gargantext.API.Prelude
(
GargM
,
simuLogs
)
import
Gargantext.API.Routes.Named.Node
qualified
as
Named
import
Gargantext.API.Routes.Named.Node
qualified
as
Named
import
Gargantext.API.Worker
(
serveWorkerAPI
)
import
Gargantext.API.Worker
(
serveWorkerAPI
)
...
...
src/Gargantext/API/Node/Update/Types.hs
View file @
a250518a
...
@@ -11,8 +11,6 @@ import Gargantext.Core.Viz.Phylo (PhyloSubConfigAPI(..))
...
@@ -11,8 +11,6 @@ import Gargantext.Core.Viz.Phylo (PhyloSubConfigAPI(..))
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Gargantext.Utils.Aeson
qualified
as
GUA
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
(
arbitrary
)
)
------------------------------------------------------------------------
------------------------------------------------------------------------
data
UpdateNodeParams
=
UpdateNodeParamsList
{
methodList
::
!
Method
}
data
UpdateNodeParams
=
UpdateNodeParamsList
{
methodList
::
!
Method
}
...
@@ -65,44 +63,23 @@ instance ToJSON UpdateNodeParams where
...
@@ -65,44 +63,23 @@ instance ToJSON UpdateNodeParams where
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
toJSON
=
genericToJSON
(
defaultOptions
{
sumEncoding
=
GUA
.
defaultTaggedObject
})
instance
ToSchema
UpdateNodeParams
instance
ToSchema
UpdateNodeParams
instance
Arbitrary
UpdateNodeParams
where
arbitrary
=
do
l
<-
UpdateNodeParamsList
<$>
arbitrary
g
<-
UpdateNodeParamsGraph
<$>
arbitrary
t
<-
UpdateNodeParamsTexts
<$>
arbitrary
b
<-
UpdateNodeParamsBoard
<$>
arbitrary
elements
[
l
,
g
,
t
,
b
]
instance
FromJSON
Method
instance
FromJSON
Method
instance
ToJSON
Method
instance
ToJSON
Method
instance
ToSchema
Method
instance
ToSchema
Method
instance
Arbitrary
Method
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
FromJSON
Granularity
instance
FromJSON
Granularity
instance
ToJSON
Granularity
instance
ToJSON
Granularity
instance
ToSchema
Granularity
instance
ToSchema
Granularity
instance
Arbitrary
Granularity
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
FromJSON
Charts
instance
FromJSON
Charts
instance
ToJSON
Charts
instance
ToJSON
Charts
instance
ToSchema
Charts
instance
ToSchema
Charts
instance
Arbitrary
Charts
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
FromJSON
UpdateNodeConfigGraph
instance
FromJSON
UpdateNodeConfigGraph
instance
ToJSON
UpdateNodeConfigGraph
instance
ToJSON
UpdateNodeConfigGraph
instance
ToSchema
UpdateNodeConfigGraph
instance
ToSchema
UpdateNodeConfigGraph
instance
Arbitrary
UpdateNodeConfigGraph
where
arbitrary
=
do
methodGraphMetric
<-
arbitrary
methodGraphClustering
<-
arbitrary
methodGraphBridgeness
<-
arbitrary
methodGraphEdgesStrength
<-
arbitrary
methodGraphNodeType1
<-
arbitrary
methodGraphNodeType2
<-
arbitrary
return
$
UpdateNodeConfigGraph
methodGraphMetric
methodGraphClustering
methodGraphBridgeness
methodGraphEdgesStrength
methodGraphNodeType1
methodGraphNodeType2
------------------------------------------------------------------------
------------------------------------------------------------------------
src/Gargantext/Core/Notifications/Dispatcher/WebSocket.hs
View file @
a250518a
...
@@ -31,7 +31,7 @@ import Gargantext.Core.Notifications.Dispatcher.Types
...
@@ -31,7 +31,7 @@ import Gargantext.Core.Notifications.Dispatcher.Types
import
Gargantext.Core.Notifications.Dispatcher
(
Dispatcher
,
dispatcherSubscriptions
)
import
Gargantext.Core.Notifications.Dispatcher
(
Dispatcher
,
dispatcherSubscriptions
)
import
Gargantext.Core.Config
(
HasJWTSettings
(
jwtSettings
))
import
Gargantext.Core.Config
(
HasJWTSettings
(
jwtSettings
))
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.System.Logging
(
LogLevel
(
DEBUG
),
logMsg
,
withLogger
,
logM
)
import
Gargantext.System.Logging
(
LogLevel
(
..
),
logMsg
,
withLogger
,
logM
)
import
Network.WebSockets
qualified
as
WS
import
Network.WebSockets
qualified
as
WS
import
Servant
import
Servant
import
Servant.API.WebSocket
qualified
as
WS
(
WebSocketPending
)
import
Servant.API.WebSocket
qualified
as
WS
(
WebSocketPending
)
...
@@ -67,7 +67,9 @@ wsServer = WSAPI { wsAPIServer = streamData }
...
@@ -67,7 +67,9 @@ wsServer = WSAPI { wsAPIServer = streamData }
case
err
of
case
err
of
WS
.
ConnectionClosed
->
logM
DEBUG
$
"[wsServer] connection closed"
WS
.
ConnectionClosed
->
logM
DEBUG
$
"[wsServer] connection closed"
WS
.
CloseRequest
_
_
->
logM
DEBUG
$
"[wsServer] close request"
WS
.
CloseRequest
_
_
->
logM
DEBUG
$
"[wsServer] close request"
_
->
Exc
.
throw
err
]
_
->
do
logM
ERROR
$
"[wsServer] error: "
<>
show
err
Exc
.
throw
err
]
-- | Send a ping control frame periodically, otherwise the
-- | Send a ping control frame periodically, otherwise the
...
@@ -148,13 +150,13 @@ getWSKey pc = do
...
@@ -148,13 +150,13 @@ getWSKey pc = do
-- WebSocket specification says that a pending request should send
-- WebSocket specification says that a pending request should send
-- some unique, Sec-WebSocket-Key string. We use this to compare
-- some unique, Sec-WebSocket-Key string. We use this to compare
-- connections (WS.Connection doesn't implement an Eq instance).
-- connections (WS.Connection doesn't implement an Eq instance).
liftBase
$
withLogger
()
$
\
ioLogger
->
do
logMsg
ioLogger
DEBUG
$
"[wsLoop, getWSKey] headers: "
<>
show
(
WS
.
requestHeaders
reqHead
)
let
mKey
=
head
$
filter
(
\
(
k
,
_
)
->
k
==
"Sec-WebSocket-Key"
)
$
WS
.
requestHeaders
reqHead
let
mKey
=
head
$
filter
(
\
(
k
,
_
)
->
k
==
"Sec-WebSocket-Key"
)
$
WS
.
requestHeaders
reqHead
let
key'
=
snd
$
fromMaybe
(
panicTrace
"Sec-WebSocket-Key not found!"
)
mKey
let
key'
=
snd
$
fromMaybe
(
panicTrace
"Sec-WebSocket-Key not found!"
)
mKey
-- Unfortunately, a single browsers sends the same
-- Unfortunately, a single browsers sends the same
-- Sec-WebSocket-Key so we want to make that even more unique.
-- Sec-WebSocket-Key so we want to make that even more unique.
uuid
<-
liftBase
$
UUID
.
nextRandom
uuid
<-
liftBase
$
UUID
.
nextRandom
let
key
=
key'
<>
"-"
<>
show
uuid
let
key
=
key'
<>
"-"
<>
show
uuid
liftBase
$
withLogger
()
$
\
ioLogger
->
do
logMsg
ioLogger
DEBUG
$
"[wsLoop, getWSKey] request headers: "
<>
(
show
$
WS
.
requestHeaders
reqHead
)
pure
key
pure
key
src/Gargantext/Core/Worker.hs
View file @
a250518a
...
@@ -216,53 +216,82 @@ performAction env _state bm = do
...
@@ -216,53 +216,82 @@ performAction env _state bm = do
let
ji
=
JobInfo
{
_ji_message_id
=
messageId
bm
let
ji
=
JobInfo
{
_ji_message_id
=
messageId
bm
,
_ji_mNode_id
=
getWorkerMNodeId
job
}
,
_ji_mNode_id
=
getWorkerMNodeId
job
}
let
jh
=
WorkerJobHandle
{
_w_job_info
=
ji
}
let
jh
=
WorkerJobHandle
{
_w_job_info
=
ji
}
case
job
of
case
job
of
Ping
->
runWorkerMonad
env
$
do
Ping
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] ping"
$
(
logLocM
)
DEBUG
"[performAction] ping"
liftIO
$
CE
.
notify
(
env
^.
(
to
_w_env_config
)
.
gc_notifications_config
)
CET
.
Ping
liftIO
$
CE
.
notify
(
env
^.
(
to
_w_env_config
)
.
gc_notifications_config
)
CET
.
Ping
-- | flow action for a single contact
AddContact
{
..
}
->
runWorkerMonad
env
$
do
AddContact
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] add contact"
$
(
logLocM
)
DEBUG
$
"[performAction] add contact"
addContact
_ac_user
_ac_node_id
_ac_args
jh
addContact
_ac_user
_ac_node_id
_ac_args
jh
-- | Send a file with documents and index them in corpus
AddCorpusFormAsync
{
..
}
->
runWorkerMonad
env
$
do
AddCorpusFormAsync
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] add corpus form"
$
(
logLocM
)
DEBUG
$
"[performAction] add corpus form"
addToCorpusWithForm
_acf_user
_acf_cid
_acf_args
jh
addToCorpusWithForm
_acf_user
_acf_cid
_acf_args
jh
-- | Perform external API search query and index documents in corpus
AddCorpusWithQuery
{
..
}
->
runWorkerMonad
env
$
do
AddCorpusWithQuery
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] add corpus with query"
$
(
logLocM
)
DEBUG
"[performAction] add corpus with query"
let
limit
=
Just
$
fromIntegral
$
env
^.
hasConfig
.
gc_jobs
.
jc_max_docs_scrapers
let
limit
=
Just
$
fromIntegral
$
env
^.
hasConfig
.
gc_jobs
.
jc_max_docs_scrapers
addToCorpusWithQuery
_acq_user
_acq_cid
_acq_args
limit
jh
addToCorpusWithQuery
_acq_user
_acq_cid
_acq_args
limit
jh
-- | Add to annuaire, from given file (not implemented yet)
AddToAnnuaireWithForm
{
..
}
->
runWorkerMonad
env
$
do
AddToAnnuaireWithForm
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] add to annuaire with form"
$
(
logLocM
)
DEBUG
"[performAction] add to annuaire with form"
Annuaire
.
addToAnnuaireWithForm
_aawf_annuaire_id
_aawf_args
jh
Annuaire
.
addToAnnuaireWithForm
_aawf_annuaire_id
_aawf_args
jh
-- | Saves file to 'data_filepath' (in TOML), adds this file as a node
AddWithFile
{
..
}
->
runWorkerMonad
env
$
do
AddWithFile
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] add with file"
$
(
logLocM
)
DEBUG
"[performAction] add with file"
addWithFile
_awf_authenticatedUser
_awf_node_id
_awf_args
jh
addWithFile
_awf_authenticatedUser
_awf_node_id
_awf_args
jh
-- | For given corpus, get write nodes contents and create documents from it
DocumentsFromWriteNodes
{
..
}
->
runWorkerMonad
env
$
do
DocumentsFromWriteNodes
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] documents from write nodes"
$
(
logLocM
)
DEBUG
"[performAction] documents from write nodes"
documentsFromWriteNodes
_dfwn_authenticatedUser
_dfwn_node_id
_dfwn_args
jh
documentsFromWriteNodes
_dfwn_authenticatedUser
_dfwn_node_id
_dfwn_args
jh
-- | Forgot password task
ForgotPasswordAsync
{
_fpa_args
=
ForgotPasswordAsyncParams
{
email
}
}
->
runWorkerMonad
env
$
do
ForgotPasswordAsync
{
_fpa_args
=
ForgotPasswordAsyncParams
{
email
}
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] forgot password: "
<>
email
$
(
logLocM
)
DEBUG
$
"[performAction] forgot password: "
<>
email
us
<-
getUsersWithEmail
(
T
.
toLower
email
)
us
<-
getUsersWithEmail
(
T
.
toLower
email
)
case
us
of
case
us
of
[
u
]
->
forgotUserPassword
u
[
u
]
->
forgotUserPassword
u
_
->
pure
()
_
->
pure
()
-- | Add given calc frame into corpus (internall, as a TSV file upload)
FrameCalcUpload
{
..
}
->
runWorkerMonad
env
$
do
FrameCalcUpload
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
"[performAction] frame calc upload"
$
(
logLocM
)
DEBUG
"[performAction] frame calc upload"
frameCalcUploadAsync
_fca_authenticatedUser
_fca_node_id
_fca_args
jh
frameCalcUploadAsync
_fca_authenticatedUser
_fca_node_id
_fca_args
jh
-- | Process uploaded JSON file
JSONPost
{
..
}
->
runWorkerMonad
env
$
do
JSONPost
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] json post"
$
(
logLocM
)
DEBUG
$
"[performAction] json post"
void
$
postAsyncJSON
_jp_list_id
_jp_ngrams_list
jh
void
$
postAsyncJSON
_jp_list_id
_jp_ngrams_list
jh
-- | Task for updating metrics charts
NgramsPostCharts
{
..
}
->
runWorkerMonad
env
$
do
NgramsPostCharts
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] ngrams post charts"
$
(
logLocM
)
DEBUG
$
"[performAction] ngrams post charts"
void
$
tableNgramsPostChartsAsync
_npc_args
jh
void
$
tableNgramsPostChartsAsync
_npc_args
jh
-- | Creates node of given type
PostNodeAsync
{
..
}
->
runWorkerMonad
env
$
do
PostNodeAsync
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] post node async"
$
(
logLocM
)
DEBUG
$
"[performAction] post node async"
void
$
postNode'
_pna_authenticatedUser
_pna_node_id
_pna_args
void
$
postNode'
_pna_authenticatedUser
_pna_node_id
_pna_args
-- | Recompute graph (for sigmajs)
RecomputeGraph
{
..
}
->
runWorkerMonad
env
$
do
RecomputeGraph
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] recompute graph"
$
(
logLocM
)
DEBUG
$
"[performAction] recompute graph"
void
$
graphRecompute
_rg_node_id
jh
void
$
graphRecompute
_rg_node_id
jh
-- | Updates a node (which triggers graph)
UpdateNode
{
..
}
->
runWorkerMonad
env
$
do
UpdateNode
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] update node"
$
(
logLocM
)
DEBUG
$
"[performAction] update node"
void
$
updateNode
_un_node_id
_un_args
jh
void
$
updateNode
_un_node_id
_un_args
jh
-- | Upload a document
UploadDocument
{
..
}
->
runWorkerMonad
env
$
do
UploadDocument
{
..
}
->
runWorkerMonad
env
$
do
$
(
logLocM
)
DEBUG
$
"[performAction] upload document"
$
(
logLocM
)
DEBUG
$
"[performAction] upload document"
void
$
documentUploadAsync
_ud_node_id
_ud_args
jh
void
$
documentUploadAsync
_ud_node_id
_ud_args
jh
src/Gargantext/Core/Worker/Jobs.hs
View file @
a250518a
...
@@ -30,10 +30,10 @@ sendJob :: (HasWorkerBroker, HasConfig env)
...
@@ -30,10 +30,10 @@ sendJob :: (HasWorkerBroker, HasConfig env)
->
Cmd'
env
err
MessageId
->
Cmd'
env
err
MessageId
sendJob
job
=
do
sendJob
job
=
do
gcConfig
<-
view
$
hasConfig
gcConfig
<-
view
$
hasConfig
liftBase
$
sendJobCfg
gcConfig
job
liftBase
$
sendJob
With
Cfg
gcConfig
job
sendJobCfg
::
GargConfig
->
Job
->
IO
MessageId
sendJob
With
Cfg
::
GargConfig
->
Job
->
IO
MessageId
sendJobCfg
gcConfig
job
=
do
sendJob
With
Cfg
gcConfig
job
=
do
let
ws
@
WorkerSettings
{
_wsDefinitions
,
_wsDefaultDelay
}
=
gcConfig
^.
gc_worker
let
ws
@
WorkerSettings
{
_wsDefinitions
,
_wsDefaultDelay
}
=
gcConfig
^.
gc_worker
-- TODO Try to guess which worker should get this job
-- TODO Try to guess which worker should get this job
-- let mWd = findDefinitionByName ws workerName
-- let mWd = findDefinitionByName ws workerName
...
@@ -50,6 +50,17 @@ sendJobCfg gcConfig job = do
...
@@ -50,6 +50,17 @@ sendJobCfg gcConfig job = do
-- | We want to fine-tune job metadata parameters, for each job type
-- | We want to fine-tune job metadata parameters, for each job type
updateJobData
::
Job
->
SendJob
->
SendJob
updateJobData
::
Job
->
SendJob
->
SendJob
updateJobData
(
AddCorpusFormAsync
{})
sj
=
sj
{
W
.
timeout
=
300
}
updateJobData
(
AddCorpusFormAsync
{})
sj
=
sj
{
W
.
timeout
=
300
0
}
updateJobData
(
AddCorpusWithQuery
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
AddCorpusWithQuery
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
_
sj
=
sj
{
W
.
resendOnKill
=
False
}
updateJobData
(
AddToAnnuaireWithForm
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
AddWithFile
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
DocumentsFromWriteNodes
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
FrameCalcUpload
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
JSONPost
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
NgramsPostCharts
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
RecomputeGraph
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
UpdateNode
{})
sj
=
sj
{
W
.
timeout
=
3000
}
updateJobData
(
UploadDocument
{})
sj
=
sj
{
W
.
timeout
=
3000
}
-- | ForgotPasswordAsync, PostNodeAsync
updateJobData
_
sj
=
sj
{
W
.
resendOnKill
=
False
,
W
.
timeout
=
60
}
src/Gargantext/Database/Admin/Types/Metrics.hs
View file @
a250518a
{-|
Module : Gargantext.Database.Admin.Types.Metrics
Description :
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TemplateHaskell #-}
module
Gargantext.Database.Admin.Types.Metrics
where
module
Gargantext.Database.Admin.Types.Metrics
where
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
(
ToSchema
(
..
),
genericDeclareNamedSchema
)
import
Data.Swagger
import
Data.Vector
(
Vector
)
import
Data.Vector
(
Vector
)
import
qualified
Data.Vector
as
V
import
Data.Vector
qualified
as
V
import
Protolude
import
Test.QuickCheck.Arbitrary
import
Gargantext.Core.Types
(
ListType
(
..
))
import
Gargantext.Core.Types
(
ListType
(
..
))
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Prelude
import
Test.QuickCheck.Arbitrary
----------------------------------------------------------------------------
----------------------------------------------------------------------------
...
...
test/Test/Instances.hs
View file @
a250518a
...
@@ -24,20 +24,26 @@ import EPO.API.Client.Types qualified as EPO
...
@@ -24,20 +24,26 @@ import EPO.API.Client.Types qualified as EPO
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
..
),
ForgotPasswordAsyncParams
(
..
))
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
..
),
ForgotPasswordAsyncParams
(
..
))
import
Gargantext.API.Errors.Types
qualified
as
Errors
import
Gargantext.API.Errors.Types
qualified
as
Errors
import
Gargantext.API.Ngrams.Types
qualified
as
Ngrams
import
Gargantext.API.Ngrams.Types
qualified
as
Ngrams
import
Gargantext.API.Node.Contact.Types
(
AddContactParams
(
..
))
import
Gargantext.API.Node.Corpus.Annuaire
(
AnnuaireWithForm
(
..
))
import
Gargantext.API.Node.Corpus.Annuaire
(
AnnuaireWithForm
(
..
))
import
Gargantext.API.Node.Corpus.New
(
ApiInfo
(
..
))
import
Gargantext.API.Node.Corpus.New
(
ApiInfo
(
..
))
import
Gargantext.API.Node.Corpus.New.Types
(
FileFormat
(
..
),
FileType
(
..
))
import
Gargantext.API.Node.Corpus.Types
(
Datafield
(
..
),
Database
(
..
))
import
Gargantext.API.Node.DocumentsFromWriteNodes.Types
qualified
as
DFWN
import
Gargantext.API.Node.DocumentsFromWriteNodes.Types
qualified
as
DFWN
import
Gargantext.API.Node.DocumentUpload.Types
(
DocumentUpload
(
..
))
import
Gargantext.API.Node.DocumentUpload.Types
(
DocumentUpload
(
..
))
import
Gargantext.API.Node.FrameCalcUpload.Types
qualified
as
FCU
import
Gargantext.API.Node.FrameCalcUpload.Types
qualified
as
FCU
import
Gargantext.API.Node.Get
(
GetNodeParams
(
..
))
import
Gargantext.API.Node.New.Types
(
PostNode
(
..
))
import
Gargantext.API.Node.Share.Types
(
ShareNodeParams
(
..
))
import
Gargantext.API.Node.Update.Types
qualified
as
NU
import
Gargantext.API.Node.Types
(
NewWithForm
(
..
),
RenameNode
(
..
),
WithQuery
(
..
))
import
Gargantext.API.Node.Types
(
NewWithForm
(
..
),
RenameNode
(
..
),
WithQuery
(
..
))
import
Gargantext.Core.Notifications.CentralExchange.Types
qualified
as
CET
import
Gargantext.Core.Notifications.CentralExchange.Types
qualified
as
CET
import
Gargantext.Core.Notifications.Dispatcher.Types
qualified
as
DET
import
Gargantext.Core.Notifications.Dispatcher.Types
qualified
as
DET
import
Gargantext.Core.Types.Individu
qualified
as
Individu
import
Gargantext.Core.Types.Individu
qualified
as
Individu
import
Gargantext.Core.Types.Main
(
ListType
(
CandidateTerm
,
StopTerm
,
MapTerm
))
import
Gargantext.Core.Types.Main
(
ListType
(
CandidateTerm
,
StopTerm
,
MapTerm
))
import
Gargantext.Core.Worker.Jobs.Types
(
Job
(
..
))
import
Gargantext.Core.Worker.Jobs.Types
(
Job
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
UserId
(
UnsafeMkUserId
))
import
Gargantext.Database.Admin.Types.Hyperdata
qualified
as
Hyperdata
import
Gargantext.Database.Admin.Types.Hyperdata
qualified
as
Hyperdata
import
Gargantext.Database.Admin.Types.Node
(
UserId
(
UnsafeMkUserId
),
NodeType
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
UserId
(
..
),
NodeType
(
..
))
import
Gargantext.Prelude
hiding
(
replace
,
Location
)
import
Gargantext.Prelude
hiding
(
replace
,
Location
)
import
Servant.Job.Core
qualified
as
SJ
import
Servant.Job.Core
qualified
as
SJ
import
Servant.Job.Types
qualified
as
SJ
import
Servant.Job.Types
qualified
as
SJ
...
@@ -114,6 +120,15 @@ instance Arbitrary EPO.Token where
...
@@ -114,6 +120,15 @@ instance Arbitrary EPO.Token where
instance
Arbitrary
ApiInfo
where
instance
Arbitrary
ApiInfo
where
arbitrary
=
ApiInfo
<$>
arbitrary
arbitrary
=
ApiInfo
<$>
arbitrary
instance
Arbitrary
FileFormat
where
arbitrary
=
elements
[
Plain
,
ZIP
]
instance
Arbitrary
FileType
where
arbitrary
=
elements
[
TSV
,
PresseRIS
]
instance
Arbitrary
Database
where
arbitrary
=
arbitraryBoundedEnum
instance
Arbitrary
Datafield
where
arbitrary
=
oneof
[
pure
Gargantext
,
pure
Web
,
pure
Files
,
External
<$>
arbitrary
]
instance
Arbitrary
WithQuery
where
instance
Arbitrary
WithQuery
where
arbitrary
=
do
arbitrary
=
do
...
@@ -135,6 +150,9 @@ instance Arbitrary AnnuaireWithForm where
...
@@ -135,6 +150,9 @@ instance Arbitrary AnnuaireWithForm where
<*>
arbitrary
-- _wf_data
<*>
arbitrary
-- _wf_data
<*>
arbitrary
-- _wf_lang
<*>
arbitrary
-- _wf_lang
instance
Arbitrary
AddContactParams
where
arbitrary
=
elements
[
AddContactParams
"Pierre"
"Dupont"
]
instance
Arbitrary
DFWN
.
Params
where
instance
Arbitrary
DFWN
.
Params
where
arbitrary
=
DFWN
.
Params
<$>
arbitrary
-- id
arbitrary
=
DFWN
.
Params
<$>
arbitrary
-- id
<*>
arbitrary
-- paragraphs
<*>
arbitrary
-- paragraphs
...
@@ -148,6 +166,45 @@ instance Arbitrary FCU.FrameCalcUpload where
...
@@ -148,6 +166,45 @@ instance Arbitrary FCU.FrameCalcUpload where
arbitrary
=
FCU
.
FrameCalcUpload
<$>
arbitrary
-- _wf_lang
arbitrary
=
FCU
.
FrameCalcUpload
<$>
arbitrary
-- _wf_lang
<*>
arbitrary
-- _wf_selection
<*>
arbitrary
-- _wf_selection
instance
Arbitrary
GetNodeParams
where
arbitrary
=
GetNodeParams
<$>
arbitrary
<*>
arbitrary
instance
Arbitrary
PostNode
where
arbitrary
=
elements
[
PostNode
"Node test"
NodeCorpus
]
instance
Arbitrary
ShareNodeParams
where
arbitrary
=
elements
[
ShareTeamParams
"user1"
,
SharePublicParams
(
UnsafeMkNodeId
1
)
]
instance
Arbitrary
NU
.
UpdateNodeParams
where
arbitrary
=
do
l
<-
NU
.
UpdateNodeParamsList
<$>
arbitrary
g
<-
NU
.
UpdateNodeParamsGraph
<$>
arbitrary
t
<-
NU
.
UpdateNodeParamsTexts
<$>
arbitrary
b
<-
NU
.
UpdateNodeParamsBoard
<$>
arbitrary
elements
[
l
,
g
,
t
,
b
]
instance
Arbitrary
NU
.
Method
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
Arbitrary
NU
.
Granularity
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
Arbitrary
NU
.
Charts
where
arbitrary
=
elements
[
minBound
..
maxBound
]
instance
Arbitrary
NU
.
UpdateNodeConfigGraph
where
arbitrary
=
do
methodGraphMetric
<-
arbitrary
methodGraphClustering
<-
arbitrary
methodGraphBridgeness
<-
arbitrary
methodGraphEdgesStrength
<-
arbitrary
methodGraphNodeType1
<-
arbitrary
methodGraphNodeType2
<-
arbitrary
return
$
NU
.
UpdateNodeConfigGraph
methodGraphMetric
methodGraphClustering
methodGraphBridgeness
methodGraphEdgesStrength
methodGraphNodeType1
methodGraphNodeType2
instance
Arbitrary
Ngrams
.
UpdateTableNgramsCharts
where
instance
Arbitrary
Ngrams
.
UpdateTableNgramsCharts
where
arbitrary
=
Ngrams
.
UpdateTableNgramsCharts
<$>
arbitrary
-- _utn_tab_type
arbitrary
=
Ngrams
.
UpdateTableNgramsCharts
<$>
arbitrary
-- _utn_tab_type
<*>
arbitrary
-- _utn_list_id
<*>
arbitrary
-- _utn_list_id
...
...
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