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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
8524a635
Commit
8524a635
authored
Dec 02, 2024
by
Grégoire Locqueville
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed `DbCmd'` -> `IsDBCmd`
parent
18ae58ab
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
27 deletions
+27
-27
Auth.hs
src/Gargantext/API/Admin/Auth.hs
+4
-4
Subcorpus.hs
src/Gargantext/API/Node/Corpus/Subcorpus.hs
+2
-2
Update.hs
src/Gargantext/API/Node/Corpus/Update.hs
+2
-2
Table.hs
src/Gargantext/API/Table.hs
+2
-2
Types.hs
src/Gargantext/Core/NodeStory/Types.hs
+2
-2
Flow.hs
src/Gargantext/Database/Action/Flow.hs
+10
-10
Utils.hs
src/Gargantext/Database/Action/Flow/Utils.hs
+2
-2
Prelude.hs
src/Gargantext/Database/Prelude.hs
+3
-3
No files found.
src/Gargantext/API/Admin/Auth.hs
View file @
8524a635
...
...
@@ -62,7 +62,7 @@ import Gargantext.Core.Types.Individu (User(..), Username, GargPassword(..))
import
Gargantext.Core.Worker.Jobs.Types
qualified
as
Jobs
import
Gargantext.Database.Action.User.New
(
guessUserName
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
UserId
)
import
Gargantext.Database.Prelude
(
Cmd
'
,
IsDBEnvExtra
,
DbCmd
'
)
import
Gargantext.Database.Prelude
(
Cmd
'
,
IsDBEnvExtra
,
IsDBCmd
)
import
Gargantext.Database.Query.Table.User
import
Gargantext.Database.Query.Tree
(
isDescendantOf
,
isIn
)
import
Gargantext.Database.Query.Tree.Root
(
getRoot
)
...
...
@@ -89,7 +89,7 @@ makeTokenForUser nodeId userId = do
either
(
authenticationError
.
LoginFailed
nodeId
userId
)
(
pure
.
toStrict
.
LE
.
decodeUtf8
)
e
-- TODO not sure about the encoding...
checkAuthRequest
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
,
DbCmd'
env
err
m
)
checkAuthRequest
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
,
IsDBCmd
env
err
m
)
=>
Username
->
GargPassword
->
m
CheckAuth
...
...
@@ -114,7 +114,7 @@ checkAuthRequest couldBeEmail (GargPassword p) = do
token
<-
makeTokenForUser
nodeId
userLight_id
pure
$
Valid
token
nodeId
userLight_id
auth
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
,
DbCmd'
env
err
m
)
auth
::
(
HasJWTSettings
env
,
HasAuthenticationError
err
,
IsDBCmd
env
err
m
)
=>
AuthRequest
->
m
AuthResponse
auth
(
AuthRequest
u
p
)
=
do
checkAuthRequest'
<-
checkAuthRequest
u
p
...
...
@@ -138,7 +138,7 @@ authCheck _env (BasicAuthData login password) = pure $
maybe Indefinite Authenticated $ TODO
-}
withAccessM
::
(
DbCmd'
env
err
m
)
withAccessM
::
(
IsDBCmd
env
err
m
)
=>
AuthenticatedUser
->
PathId
->
m
a
...
...
src/Gargantext/API/Node/Corpus/Subcorpus.hs
View file @
8524a635
...
...
@@ -10,13 +10,13 @@ import Gargantext.Core.Text.Corpus (makeSubcorpusFromQuery)
import
Gargantext.Core.Text.Corpus.Query
(
RawQuery
(
..
),
parseQuery
)
import
Gargantext.Core.Types
(
UserId
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Prelude
(
DbCmd
'
)
import
Gargantext.Database.Prelude
(
IsDBCmd
)
import
Servant.Server.Generic
(
AsServerT
)
makeSubcorpus
::
(
HasNodeStoryEnv
env
,
HasNLPServer
env
,
DbCmd'
env
BackendInternalError
m
,
IsDBCmd
env
BackendInternalError
m
)
=>
UserId
->
MakeSubcorpusAPI
(
AsServerT
m
)
...
...
src/Gargantext/API/Node/Corpus/Update.hs
View file @
8524a635
...
...
@@ -19,7 +19,7 @@ import Control.Lens (over)
import
Gargantext.Core
(
Lang
)
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
(
HyperdataCorpus
,
_hc_lang
)
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
)
import
Gargantext.Database.Prelude
(
DbCmd
'
)
import
Gargantext.Database.Prelude
(
IsDBCmd
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Database.Query.Table.Node.UpdateOpaleye
(
updateHyperdata
)
...
...
@@ -29,7 +29,7 @@ import Gargantext.Utils.Jobs.Monad (MonadJobStatus)
-- | Updates the 'HyperdataCorpus' with the input 'Lang'.
addLanguageToCorpus
::
(
HasNodeError
err
,
DbCmd'
env
err
m
,
MonadJobStatus
m
)
addLanguageToCorpus
::
(
HasNodeError
err
,
IsDBCmd
env
err
m
,
MonadJobStatus
m
)
=>
CorpusId
->
Lang
->
m
()
...
...
src/Gargantext/API/Table.hs
View file @
8524a635
...
...
@@ -41,7 +41,7 @@ import Gargantext.Core.Types.Query (Offset, Limit)
import
Gargantext.Database.Action.Learn
(
FavOrTrash
(
..
),
moreLike
)
import
Gargantext.Database.Action.Search
(
searchCountInCorpus
,
searchInCorpus
)
import
Gargantext.Database.Admin.Types.Node
(
ContactId
,
CorpusId
,
NodeId
)
import
Gargantext.Database.Prelude
(
CmdM
,
DbCmd
'
,
DBCmd
)
import
Gargantext.Database.Prelude
(
CmdM
,
IsDBCmd
,
DBCmd
)
import
Gargantext.Database.Query.Facet
(
FacetDoc
,
runViewDocuments
,
runCountDocuments
,
OrderBy
(
..
),
runViewAuthorsDoc
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
)
import
Gargantext.Prelude
...
...
@@ -107,7 +107,7 @@ getTableHashApi cId tabType = do
HashedResponse
{
hash
=
h
}
<-
getTableApi
cId
tabType
Nothing
Nothing
Nothing
Nothing
Nothing
pure
h
searchInCorpus'
::
(
DbCmd'
env
err
m
,
MonadLogger
m
)
searchInCorpus'
::
(
IsDBCmd
env
err
m
,
MonadLogger
m
)
=>
CorpusId
->
Bool
->
RawQuery
...
...
src/Gargantext/Core/NodeStory/Types.hs
View file @
8524a635
...
...
@@ -58,7 +58,7 @@ import Gargantext.Database.Admin.Types.Node ( NodeId(..) )
import
Gargantext.Core.Text.Ngrams
qualified
as
Ngrams
import
Gargantext.Core.Utils.Prefix
(
unPrefix
)
import
Gargantext.Database.Admin.Config
()
import
Gargantext.Database.Prelude
(
DbCmd
'
)
import
Gargantext.Database.Prelude
(
IsDBCmd
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
())
import
Gargantext.Prelude
hiding
(
to
)
import
Opaleye
(
DefaultFromField
(
..
),
SqlJsonb
,
fromPGSFromField
)
...
...
@@ -197,7 +197,7 @@ data NodeStoryEnv = NodeStoryEnv
}
deriving
(
Generic
)
type
HasNodeStory
env
err
m
=
(
DbCmd'
env
err
m
type
HasNodeStory
env
err
m
=
(
IsDBCmd
env
err
m
,
MonadReader
env
m
,
MonadError
err
m
,
HasNodeStoryEnv
env
...
...
src/Gargantext/Database/Action/Flow.hs
View file @
8524a635
...
...
@@ -94,7 +94,7 @@ import Gargantext.Database.Admin.Types.Hyperdata.Contact ( HyperdataContact )
import
Gargantext.Database.Admin.Types.Hyperdata.Corpus
(
HyperdataAnnuaire
,
HyperdataCorpus
(
_hc_lang
)
)
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
ToHyperdataDocument
(
toHyperdataDocument
)
)
import
Gargantext.Database.Admin.Types.Node
hiding
(
DEBUG
)
-- (HyperdataDocument(..), NodeType(..), NodeId, UserId, ListId, CorpusId, RootId, MasterCorpusId, MasterUserId)
import
Gargantext.Database.Prelude
(
DbCmd
'
,
DBCmd
'
)
import
Gargantext.Database.Prelude
(
IsDBCmd
,
DBCmd
'
)
import
Gargantext.Database.Query.Table.ContextNodeNgrams2
(
ContextNodeNgrams2Poly
(
..
),
insertContextNodeNgrams2
)
import
Gargantext.Database.Query.Table.Node
(
MkCorpus
,
insertDefaultNodeIfNotExists
,
getOrMkList
,
getNodeWith
)
import
Gargantext.Database.Query.Table.Node.Document.Add
qualified
as
Doc
(
add
)
...
...
@@ -161,7 +161,7 @@ getDataText_Debug a l q li = do
-------------------------------------------------------------------------------
flowDataText
::
forall
env
err
m
.
(
DbCmd'
env
err
m
(
IsDBCmd
env
err
m
,
HasNodeStory
env
err
m
,
MonadLogger
m
,
HasNLPServer
env
...
...
@@ -191,7 +191,7 @@ flowDataText u (DataNew (mLen, txtC)) tt cid mfslw jobHandle = do
------------------------------------------------------------------------
-- TODO use proxy
flowAnnuaire
::
(
DbCmd'
env
err
m
flowAnnuaire
::
(
IsDBCmd
env
err
m
,
HasNodeStory
env
err
m
,
MonadLogger
m
,
HasNLPServer
env
...
...
@@ -210,7 +210,7 @@ flowAnnuaire mkCorpusUser l filePath jobHandle = do
flow
(
Nothing
::
Maybe
HyperdataAnnuaire
)
mkCorpusUser
l
Nothing
(
fromIntegral
$
length
docs
,
yieldMany
docs
)
jobHandle
------------------------------------------------------------------------
flowCorpusFile
::
(
DbCmd'
env
err
m
flowCorpusFile
::
(
IsDBCmd
env
err
m
,
HasNodeStory
env
err
m
,
MonadLogger
m
,
HasNLPServer
env
...
...
@@ -239,7 +239,7 @@ flowCorpusFile mkCorpusUser _l la ft ff fp mfslw jobHandle = do
------------------------------------------------------------------------
-- | TODO improve the needed type to create/update a corpus
-- (For now, Either is enough)
flowCorpus
::
(
DbCmd'
env
err
m
flowCorpus
::
(
IsDBCmd
env
err
m
,
HasNodeStory
env
err
m
,
MonadLogger
m
,
HasNLPServer
env
...
...
@@ -258,7 +258,7 @@ flowCorpus = flow (Nothing :: Maybe HyperdataCorpus)
flow
::
forall
env
err
m
a
c
.
(
DbCmd'
env
err
m
(
IsDBCmd
env
err
m
,
HasNodeStory
env
err
m
,
MonadLogger
m
,
HasNLPServer
env
...
...
@@ -300,7 +300,7 @@ flow c mkCorpusUser la mfslw (count, docsC) jobHandle = do
-- | Given a list of corpus documents and a 'NodeId' identifying the 'CorpusId', adds
-- the given documents to the corpus. Returns the Ids of the inserted documents.
addDocumentsToHyperCorpus
::
(
DbCmd'
env
err
m
addDocumentsToHyperCorpus
::
(
IsDBCmd
env
err
m
,
HasNodeError
err
,
FlowCorpus
document
,
MkCorpus
corpus
...
...
@@ -317,7 +317,7 @@ addDocumentsToHyperCorpus ncs mb_hyper la corpusId docs = do
pure
ids
------------------------------------------------------------------------
createNodes
::
(
DbCmd'
env
err
m
,
HasNodeError
err
createNodes
::
(
IsDBCmd
env
err
m
,
HasNodeError
err
,
MkCorpus
c
,
HasCentralExchangeNotification
env
)
...
...
@@ -410,7 +410,7 @@ buildSocialList l user userCorpusId listId ctype mfslw = do
pure
()
insertMasterDocs
::
(
DbCmd'
env
err
m
insertMasterDocs
::
(
IsDBCmd
env
err
m
,
HasNodeError
err
,
FlowCorpus
a
,
MkCorpus
c
...
...
@@ -443,7 +443,7 @@ insertMasterDocs ncs c lang hs = do
-- _cooc <- insertDefaultNode NodeListCooc lId masterUserId
pure
$
map
contextId2NodeId
ids'
saveDocNgramsWith
::
(
DbCmd'
env
err
m
)
saveDocNgramsWith
::
(
IsDBCmd
env
err
m
)
=>
ListId
->
HashMap
.
HashMap
ExtractedNgrams
(
Map
NgramsType
(
Map
NodeId
(
Int
,
TermsCount
)))
->
m
()
...
...
src/Gargantext/Database/Action/Flow/Utils.hs
View file @
8524a635
...
...
@@ -33,7 +33,7 @@ import Gargantext.Data.HashMap.Strict.Utils qualified as HashMap
import
Gargantext.Database.Action.Flow.Types
(
DocumentIdWithNgrams
(
..
),
FlowInsertDB
)
import
Gargantext.Database.Admin.Types.Hyperdata.Document
(
HyperdataDocument
,
hd_abstract
,
hd_title
)
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
(
DBCmd
,
DbCmd
'
)
import
Gargantext.Database.Prelude
(
DBCmd
,
IsDBCmd
)
import
Gargantext.Database.Query.Table.ContextNodeNgrams
(
ContextNodeNgramsPoly
(
..
),
insertContextNodeNgrams
)
import
Gargantext.Database.Query.Table.Node.Document.Add
qualified
as
Doc
(
add
)
import
Gargantext.Database.Query.Table.Node.Document.Insert
(
ReturnId
,
addUniqId
,
insertDb
,
reId
,
reInserted
,
reUniqId
)
...
...
@@ -119,7 +119,7 @@ mapNodeIdNgrams = HashMap.unionsWith (DM.unionWith (DM.unionWith addTuples)) . f
-- TODO Type NodeDocumentUnicised
insertDocs
::
(
DbCmd'
env
err
m
insertDocs
::
(
IsDBCmd
env
err
m
-- , FlowCorpus a
,
FlowInsertDB
a
,
HasNodeError
err
...
...
src/Gargantext/Database/Prelude.hs
View file @
8524a635
...
...
@@ -97,13 +97,13 @@ type Cmd'' env err a = forall m. CmdM'' env err m => m a
type
Cmd'
env
err
a
=
forall
m
.
IsCmd
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
DBCmd'
env
err
a
=
forall
m
.
DbCmd'
env
err
m
=>
m
a
type
DBCmd
err
a
=
forall
m
env
.
DbCmd'
env
err
m
=>
m
a
type
DBCmd'
env
err
a
=
forall
m
.
IsDBCmd
env
err
m
=>
m
a
type
DBCmd
err
a
=
forall
m
env
.
IsDBCmd
env
err
m
=>
m
a
-- | Only the /minimum/ amount of class constraints required
-- to use the Gargantext Database. It's important, to ease testability,
-- that these constraints stays as few as possible.
type
DbCmd'
env
err
m
=
(
type
IsDBCmd
env
err
m
=
(
IsCmd
env
err
m
,
IsDBEnv
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