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
144
Issues
144
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
f785e149
Commit
f785e149
authored
Nov 26, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Renamed CmdM' into CmdBasic"
This reverts commit
ff00345c
parent
ff00345c
Pipeline
#7045
failed with stages
in 69 minutes and 28 seconds
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
28 deletions
+28
-28
Auth.hs
src/Gargantext/API/Admin/Auth.hs
+7
-7
Dev.hs
src/Gargantext/API/Dev.hs
+3
-3
Utils.hs
src/Gargantext/API/GraphQL/Utils.hs
+2
-2
Types.hs
src/Gargantext/API/Ngrams/Types.hs
+2
-2
Jobs.hs
src/Gargantext/Core/Worker/Jobs.hs
+2
-2
Delete.hs
src/Gargantext/Database/Action/Delete.hs
+2
-2
Prelude.hs
src/Gargantext/Database/Prelude.hs
+10
-10
No files found.
src/Gargantext/API/Admin/Auth.hs
View file @
f785e149
...
@@ -61,7 +61,7 @@ import Gargantext.Core.Types.Individu (User(..), Username, GargPassword(..))
...
@@ -61,7 +61,7 @@ import Gargantext.Core.Types.Individu (User(..), Username, GargPassword(..))
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Database.Action.User.New
(
guessUserName
)
import
Gargantext.Database.Action.User.New
(
guessUserName
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
UserId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
UserId
)
import
Gargantext.Database.Prelude
(
SomeCmdBasic
,
CmdCommon
,
DbCmd
'
)
import
Gargantext.Database.Prelude
(
Cmd
'
,
CmdCommon
,
DbCmd
'
)
import
Gargantext.Database.Query.Table.User
import
Gargantext.Database.Query.Table.User
import
Gargantext.Database.Query.Tree
(
isDescendantOf
,
isIn
)
import
Gargantext.Database.Query.Tree
(
isDescendantOf
,
isIn
)
import
Gargantext.Database.Query.Tree.Root
(
getRoot
)
import
Gargantext.Database.Query.Tree.Root
(
getRoot
)
...
@@ -82,7 +82,7 @@ import qualified Gargantext.API.Routes.Named as Named
...
@@ -82,7 +82,7 @@ import qualified Gargantext.API.Routes.Named as Named
makeTokenForUser
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
)
makeTokenForUser
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
)
=>
NodeId
=>
NodeId
->
UserId
->
UserId
->
SomeCmdBasic
env
err
Token
->
Cmd'
env
err
Token
makeTokenForUser
nodeId
userId
=
do
makeTokenForUser
nodeId
userId
=
do
jwtS
<-
view
jwtSettings
jwtS
<-
view
jwtSettings
e
<-
liftBase
$
makeJWT
(
AuthenticatedUser
nodeId
userId
)
jwtS
Nothing
e
<-
liftBase
$
makeJWT
(
AuthenticatedUser
nodeId
userId
)
jwtS
Nothing
...
@@ -237,12 +237,12 @@ forgotPassword = Named.ForgotPasswordAPI
...
@@ -237,12 +237,12 @@ forgotPassword = Named.ForgotPasswordAPI
}
}
forgotPasswordPost
::
(
CmdCommon
env
)
forgotPasswordPost
::
(
CmdCommon
env
)
=>
ForgotPasswordRequest
->
SomeCmdBasic
env
err
ForgotPasswordResponse
=>
ForgotPasswordRequest
->
Cmd'
env
err
ForgotPasswordResponse
forgotPasswordPost
(
ForgotPasswordRequest
_email
)
=
do
forgotPasswordPost
(
ForgotPasswordRequest
_email
)
=
do
pure
$
ForgotPasswordResponse
"ok"
pure
$
ForgotPasswordResponse
"ok"
forgotPasswordGet
::
(
CmdCommon
env
,
HasServerError
err
)
forgotPasswordGet
::
(
CmdCommon
env
,
HasServerError
err
)
=>
Maybe
Text
->
SomeCmdBasic
env
err
ForgotPasswordGet
=>
Maybe
Text
->
Cmd'
env
err
ForgotPasswordGet
forgotPasswordGet
Nothing
=
pure
$
ForgotPasswordGet
""
forgotPasswordGet
Nothing
=
pure
$
ForgotPasswordGet
""
forgotPasswordGet
(
Just
uuid
)
=
do
forgotPasswordGet
(
Just
uuid
)
=
do
let
mUuid
=
fromText
uuid
let
mUuid
=
fromText
uuid
...
@@ -259,7 +259,7 @@ forgotPasswordGet (Just uuid) = do
...
@@ -259,7 +259,7 @@ forgotPasswordGet (Just uuid) = do
---------------------
---------------------
forgotPasswordGetUser
::
(
CmdCommon
env
)
forgotPasswordGetUser
::
(
CmdCommon
env
)
=>
UserLight
->
SomeCmdBasic
env
err
ForgotPasswordGet
=>
UserLight
->
Cmd'
env
err
ForgotPasswordGet
forgotPasswordGetUser
(
UserLight
{
..
})
=
do
forgotPasswordGetUser
(
UserLight
{
..
})
=
do
-- pick some random password
-- pick some random password
password
<-
liftBase
gargPass
password
<-
liftBase
gargPass
...
@@ -278,7 +278,7 @@ forgotPasswordGetUser (UserLight { .. }) = do
...
@@ -278,7 +278,7 @@ forgotPasswordGetUser (UserLight { .. }) = do
pure
$
ForgotPasswordGet
password
pure
$
ForgotPasswordGet
password
forgotUserPassword
::
(
CmdCommon
env
)
forgotUserPassword
::
(
CmdCommon
env
)
=>
UserLight
->
SomeCmdBasic
env
err
()
=>
UserLight
->
Cmd'
env
err
()
forgotUserPassword
(
UserLight
{
..
})
=
do
forgotUserPassword
(
UserLight
{
..
})
=
do
--printDebug "[forgotUserPassword] userLight_id" userLight_id
--printDebug "[forgotUserPassword] userLight_id" userLight_id
--logDebug $ "[forgotUserPassword]" :# ["userLight_id" .= userLight_id]
--logDebug $ "[forgotUserPassword]" :# ["userLight_id" .= userLight_id]
...
@@ -303,7 +303,7 @@ forgotUserPassword (UserLight { .. }) = do
...
@@ -303,7 +303,7 @@ forgotUserPassword (UserLight { .. }) = do
-- Generate a unique (in whole DB) UUID for passwords.
-- Generate a unique (in whole DB) UUID for passwords.
generateForgotPasswordUUID
::
(
CmdCommon
env
)
generateForgotPasswordUUID
::
(
CmdCommon
env
)
=>
SomeCmdBasic
env
err
UUID
=>
Cmd'
env
err
UUID
generateForgotPasswordUUID
=
do
generateForgotPasswordUUID
=
do
uuid
<-
liftBase
$
nextRandom
uuid
<-
liftBase
$
nextRandom
us
<-
getUsersWithForgotPasswordUUID
uuid
us
<-
getUsersWithForgotPasswordUUID
uuid
...
...
src/Gargantext/API/Dev.hs
View file @
f785e149
...
@@ -23,7 +23,7 @@ import Gargantext.API.Prelude ( GargM )
...
@@ -23,7 +23,7 @@ import Gargantext.API.Prelude ( GargM )
import
Gargantext.Core.Config
(
_gc_database_config
)
import
Gargantext.Core.Config
(
_gc_database_config
)
import
Gargantext.Core.Config.Types
(
SettingsFile
(
..
))
import
Gargantext.Core.Config.Types
(
SettingsFile
(
..
))
import
Gargantext.Core.NodeStory
(
fromDBNodeStoryEnv
)
import
Gargantext.Core.NodeStory
(
fromDBNodeStoryEnv
)
import
Gargantext.Database.Prelude
(
SomeCmdBasic
,
Cmd
''
,
connPool
,
runCmd
)
import
Gargantext.Database.Prelude
(
Cmd
'
,
Cmd
''
,
connPool
,
runCmd
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Core.Config.Utils
(
readConfig
)
import
Gargantext.Core.Config.Utils
(
readConfig
)
import
Gargantext.System.Logging
(
withLoggerHoisted
)
import
Gargantext.System.Logging
(
withLoggerHoisted
)
...
@@ -70,10 +70,10 @@ runCmdGargDev :: DevEnv -> GargM DevEnv BackendInternalError a -> IO a
...
@@ -70,10 +70,10 @@ runCmdGargDev :: DevEnv -> GargM DevEnv BackendInternalError a -> IO a
runCmdGargDev
env
cmd
=
runCmdGargDev
env
cmd
=
either
(
fail
.
show
)
pure
=<<
runExceptT
(
runReaderT
cmd
env
)
either
(
fail
.
show
)
pure
=<<
runExceptT
(
runReaderT
cmd
env
)
runCmdDevNoErr
::
DevEnv
->
SomeCmdBasic
DevEnv
()
a
->
IO
a
runCmdDevNoErr
::
DevEnv
->
Cmd'
DevEnv
()
a
->
IO
a
runCmdDevNoErr
=
runCmdDev
runCmdDevNoErr
=
runCmdDev
runCmdDevServantErr
::
DevEnv
->
SomeCmdBasic
DevEnv
ServerError
a
->
IO
a
runCmdDevServantErr
::
DevEnv
->
Cmd'
DevEnv
ServerError
a
->
IO
a
runCmdDevServantErr
=
runCmdDev
runCmdDevServantErr
=
runCmdDev
runCmdReplEasy
::
Cmd''
DevEnv
BackendInternalError
a
->
IO
a
runCmdReplEasy
::
Cmd''
DevEnv
BackendInternalError
a
->
IO
a
...
...
src/Gargantext/API/GraphQL/Utils.hs
View file @
f785e149
...
@@ -16,13 +16,13 @@ import Control.Lens (view)
...
@@ -16,13 +16,13 @@ import Control.Lens (view)
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
..
),
auth_node_id
)
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
..
),
auth_node_id
)
import
Gargantext.Core.Config
(
HasJWTSettings
(
..
))
import
Gargantext.Core.Config
(
HasJWTSettings
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
import
Gargantext.Database.Prelude
(
SomeCmdBasic
)
import
Gargantext.Database.Prelude
(
Cmd
'
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Servant.Auth.Server
(
verifyJWT
,
JWTSettings
)
import
Servant.Auth.Server
(
verifyJWT
,
JWTSettings
)
data
AuthStatus
=
Valid
|
Invalid
data
AuthStatus
=
Valid
|
Invalid
authUser
::
(
HasJWTSettings
env
)
=>
NodeId
->
Text
->
SomeCmdBasic
env
err
AuthStatus
authUser
::
(
HasJWTSettings
env
)
=>
NodeId
->
Text
->
Cmd'
env
err
AuthStatus
authUser
ui_id
token
=
do
authUser
ui_id
token
=
do
let
token'
=
encodeUtf8
token
let
token'
=
encodeUtf8
token
jwtS
<-
view
jwtSettings
jwtS
<-
view
jwtSettings
...
...
src/Gargantext/API/Ngrams/Types.hs
View file @
f785e149
...
@@ -45,7 +45,7 @@ import Gargantext.Core.Types (ListType(..), ListId, NodeId, TODO)
...
@@ -45,7 +45,7 @@ import Gargantext.Core.Types (ListType(..), ListId, NodeId, TODO)
import
Gargantext.Core.Types.Query
(
Limit
,
Offset
,
MaxSize
,
MinSize
)
import
Gargantext.Core.Types.Query
(
Limit
,
Offset
,
MaxSize
,
MinSize
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixUntagged
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Core.Utils.Prefix
(
unPrefix
,
unPrefixUntagged
,
unPrefixSwagger
,
wellNamedSchema
)
import
Gargantext.Database.Admin.Types.Node
(
ContextId
)
import
Gargantext.Database.Admin.Types.Node
(
ContextId
)
import
Gargantext.Database.Prelude
(
fromField'
,
HasConnectionPool
,
Cmd
Basic
)
import
Gargantext.Database.Prelude
(
fromField'
,
HasConnectionPool
,
Cmd
M
'
)
import
Gargantext.Prelude
hiding
(
IsString
,
hash
,
from
,
replace
,
to
)
import
Gargantext.Prelude
hiding
(
IsString
,
hash
,
from
,
replace
,
to
)
import
Gargantext.Prelude.Crypto.Hash
(
IsHashable
(
..
))
import
Gargantext.Prelude.Crypto.Hash
(
IsHashable
(
..
))
import
Gargantext.Utils.Servant
(
TSV
,
ZIP
)
import
Gargantext.Utils.Servant
(
TSV
,
ZIP
)
...
@@ -729,7 +729,7 @@ initRepo = Repo 1 mempty []
...
@@ -729,7 +729,7 @@ initRepo = Repo 1 mempty []
--------------------
--------------------
type
RepoCmdM
env
err
m
=
type
RepoCmdM
env
err
m
=
(
Cmd
Basic
env
err
m
(
Cmd
M'
env
err
m
,
HasConnectionPool
env
,
HasConnectionPool
env
,
HasConfig
env
,
HasConfig
env
)
)
...
...
src/Gargantext/Core/Worker/Jobs.hs
View file @
f785e149
...
@@ -20,14 +20,14 @@ import Gargantext.Core.Config.Worker (WorkerSettings(..), WorkerDefinition(..))
...
@@ -20,14 +20,14 @@ import Gargantext.Core.Config.Worker (WorkerSettings(..), WorkerDefinition(..))
import
Gargantext.Core.Worker.Broker
(
initBrokerWithDBCreate
)
import
Gargantext.Core.Worker.Broker
(
initBrokerWithDBCreate
)
import
Gargantext.Core.Worker.Jobs.Types
(
Job
(
..
))
import
Gargantext.Core.Worker.Jobs.Types
(
Job
(
..
))
import
Gargantext.Core.Worker.PGMQTypes
(
HasWorkerBroker
,
MessageId
,
SendJob
)
import
Gargantext.Core.Worker.PGMQTypes
(
HasWorkerBroker
,
MessageId
,
SendJob
)
import
Gargantext.Database.Prelude
(
SomeCmdBasic
)
import
Gargantext.Database.Prelude
(
Cmd
'
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.System.Logging
(
logMsg
,
withLogger
,
LogLevel
(
..
))
import
Gargantext.System.Logging
(
logMsg
,
withLogger
,
LogLevel
(
..
))
sendJob
::
(
HasWorkerBroker
,
HasConfig
env
)
sendJob
::
(
HasWorkerBroker
,
HasConfig
env
)
=>
Job
=>
Job
->
SomeCmdBasic
env
err
MessageId
->
Cmd'
env
err
MessageId
sendJob
job
=
do
sendJob
job
=
do
gcConfig
<-
view
$
hasConfig
gcConfig
<-
view
$
hasConfig
liftBase
$
sendJobWithCfg
gcConfig
job
liftBase
$
sendJobWithCfg
gcConfig
job
...
...
src/Gargantext/Database/Action/Delete.hs
View file @
f785e149
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Action.User (getUserId)
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Action.User (getUserId)
import
Gargantext.Database.Admin.Types.Hyperdata.File
(
HyperdataFile
(
..
)
)
import
Gargantext.Database.Admin.Types.Hyperdata.File
(
HyperdataFile
(
..
)
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
(
..
)
)
-- (NodeType(..))
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
(
..
)
)
-- (NodeType(..))
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.Prelude
(
SomeCmdBasic
,
CmdCommon
)
import
Gargantext.Database.Prelude
(
Cmd
'
,
CmdCommon
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node
qualified
as
N
(
getNode
,
deleteNode
)
import
Gargantext.Database.Query.Table.Node
qualified
as
N
(
getNode
,
deleteNode
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
...
@@ -41,7 +41,7 @@ import Gargantext.Prelude
...
@@ -41,7 +41,7 @@ import Gargantext.Prelude
deleteNode
::
(
CmdCommon
env
,
HasNodeError
err
)
deleteNode
::
(
CmdCommon
env
,
HasNodeError
err
)
=>
User
=>
User
->
NodeId
->
NodeId
->
SomeCmdBasic
env
err
Int
->
Cmd'
env
err
Int
deleteNode
u
nodeId
=
do
deleteNode
u
nodeId
=
do
node'
<-
N
.
getNode
nodeId
node'
<-
N
.
getNode
nodeId
num
<-
case
(
view
node_typename
node'
)
of
num
<-
case
(
view
node_typename
node'
)
of
...
...
src/Gargantext/Database/Prelude.hs
View file @
f785e149
...
@@ -59,7 +59,7 @@ type CmdM'' env err m =
...
@@ -59,7 +59,7 @@ type CmdM'' env err m =
,
MonadRandom
m
,
MonadRandom
m
)
)
type
Cmd
Basic
env
err
m
=
type
Cmd
M'
env
err
m
=
(
MonadReader
env
m
(
MonadReader
env
m
,
MonadError
err
m
,
MonadError
err
m
,
MonadBaseControl
IO
m
,
MonadBaseControl
IO
m
...
@@ -82,19 +82,19 @@ type CmdCommon env =
...
@@ -82,19 +82,19 @@ type CmdCommon env =
,
CET
.
HasCentralExchangeNotification
env
)
,
CET
.
HasCentralExchangeNotification
env
)
type
CmdM
env
err
m
=
type
CmdM
env
err
m
=
(
Cmd
Basic
env
err
m
(
Cmd
M'
env
err
m
,
CmdCommon
env
,
CmdCommon
env
)
)
type
CmdRandom
env
err
m
=
type
CmdRandom
env
err
m
=
(
Cmd
Basic
env
err
m
(
Cmd
M'
env
err
m
,
DbCommon
env
,
DbCommon
env
,
MonadRandom
m
,
MonadRandom
m
,
HasMail
env
,
HasMail
env
)
)
type
Cmd''
env
err
a
=
forall
m
.
CmdM''
env
err
m
=>
m
a
type
Cmd''
env
err
a
=
forall
m
.
CmdM''
env
err
m
=>
m
a
type
SomeCmdBasic
env
err
a
=
forall
m
.
CmdBasic
env
err
m
=>
m
a
type
Cmd'
env
err
a
=
forall
m
.
CmdM'
env
err
m
=>
m
a
type
Cmd
err
a
=
forall
m
env
.
CmdM
env
err
m
=>
m
a
type
Cmd
err
a
=
forall
m
env
.
CmdM
env
err
m
=>
m
a
type
CmdR
err
a
=
forall
m
env
.
CmdRandom
env
err
m
=>
m
a
type
CmdR
err
a
=
forall
m
env
.
CmdRandom
env
err
m
=>
m
a
type
DBCmd'
env
err
a
=
forall
m
.
DbCmd'
env
err
m
=>
m
a
type
DBCmd'
env
err
a
=
forall
m
.
DbCmd'
env
err
m
=>
m
a
...
@@ -104,7 +104,7 @@ type DBCmd err a = forall m env. DbCmd' env err m => m a
...
@@ -104,7 +104,7 @@ type DBCmd err a = forall m env. DbCmd' env err m => m a
-- to use the Gargantext Database. It's important, to ease testability,
-- to use the Gargantext Database. It's important, to ease testability,
-- that these constraints stays as few as possible.
-- that these constraints stays as few as possible.
type
DbCmd'
env
err
m
=
(
type
DbCmd'
env
err
m
=
(
Cmd
Basic
env
err
m
Cmd
M'
env
err
m
,
DbCommon
env
,
DbCommon
env
)
)
...
...
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