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
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
97996ee1
Verified
Commit
97996ee1
authored
May 12, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[API] small refactoring to get explicit constructors
This makes it easier for me to grep code
parent
6814d9da
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
17 deletions
+18
-17
gargantext.cabal
gargantext.cabal
+0
-1
List.hs
src/Gargantext/API/Ngrams/List.hs
+7
-4
Node.hs
src/Gargantext/API/Node.hs
+11
-12
No files found.
gargantext.cabal
View file @
97996ee1
...
@@ -704,7 +704,6 @@ executable gargantext
...
@@ -704,7 +704,6 @@ executable gargantext
, gargantext
, gargantext
, gargantext-prelude
, gargantext-prelude
, haskell-bee
, haskell-bee
, lens >= 5.2.2 && < 5.3
, MonadRandom ^>= 0.6
, MonadRandom ^>= 0.6
, optparse-applicative
, optparse-applicative
, postgresql-simple >= 0.6.4 && <= 0.7.0.0
, postgresql-simple >= 0.6.4 && <= 0.7.0.0
...
...
src/Gargantext/API/Ngrams/List.hs
View file @
97996ee1
...
@@ -61,10 +61,13 @@ import Servant.Server.Generic (AsServerT)
...
@@ -61,10 +61,13 @@ import Servant.Server.Generic (AsServerT)
getAPI
::
Named
.
GETAPI
(
AsServerT
(
GargM
Env
BackendInternalError
))
getAPI
::
Named
.
GETAPI
(
AsServerT
(
GargM
Env
BackendInternalError
))
getAPI
=
Named
.
GETAPI
$
\
listId
->
Named
.
ListEndpoints
getAPI
=
Named
.
GETAPI
{
listJSONEp
=
getJson
listId
{
,
listJSONZipEp
=
getJsonZip
listId
getListEp
=
\
listId
->
Named
.
ListEndpoints
,
listTSVEp
=
getTsv
listId
{
listJSONEp
=
getJson
listId
,
listJSONZipEp
=
getJsonZip
listId
,
listTSVEp
=
getTsv
listId
}
}
}
--
--
...
...
src/Gargantext/API/Node.hs
View file @
97996ee1
...
@@ -249,11 +249,11 @@ genericNodeAPI' :: forall a proxy. ( HyperdataC a )
...
@@ -249,11 +249,11 @@ genericNodeAPI' :: forall a proxy. ( HyperdataC a )
->
Named
.
NodeAPI
a
(
AsServerT
(
GargM
Env
BackendInternalError
))
->
Named
.
NodeAPI
a
(
AsServerT
(
GargM
Env
BackendInternalError
))
genericNodeAPI'
_
authenticatedUser
targetNode
=
Named
.
NodeAPI
genericNodeAPI'
_
authenticatedUser
targetNode
=
Named
.
NodeAPI
{
nodeNodeAPI
=
withNamedPolicyT
authenticatedUser
(
nodeReadChecks
targetNode
)
$
{
nodeNodeAPI
=
withNamedPolicyT
authenticatedUser
(
nodeReadChecks
targetNode
)
$
Named
.
NodeNodeAPI
$
runDBQuery
(
getNodeWith
targetNode
(
Proxy
::
Proxy
a
))
Named
.
NodeNodeAPI
{
getNodeEp
=
runDBQuery
$
getNodeWith
targetNode
(
Proxy
::
Proxy
a
)
}
,
renameAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
,
renameAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
Named
.
RenameAPI
$
rename
loggedInUserId
targetNode
Named
.
RenameAPI
{
renameEp
=
rename
loggedInUserId
targetNode
}
,
postNodeAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
,
postNodeAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
Named
.
PostNodeAPI
$
postNode
authenticatedUser
targetNode
Named
.
PostNodeAPI
{
postWithParentEp
=
postNode
authenticatedUser
targetNode
}
,
postNodeAsyncAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
,
postNodeAsyncAPI
=
withNamedPolicyT
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
postNodeAsyncAPI
authenticatedUser
targetNode
postNodeAsyncAPI
authenticatedUser
targetNode
,
frameCalcUploadAPI
=
FrameCalcUpload
.
api
authenticatedUser
targetNode
,
frameCalcUploadAPI
=
FrameCalcUpload
.
api
authenticatedUser
targetNode
...
@@ -262,30 +262,29 @@ genericNodeAPI' _ authenticatedUser targetNode = Named.NodeAPI
...
@@ -262,30 +262,29 @@ genericNodeAPI' _ authenticatedUser targetNode = Named.NodeAPI
Update
.
api
targetNode
Update
.
api
targetNode
,
deleteEp
=
withPolicy
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
,
deleteEp
=
withPolicy
authenticatedUser
(
nodeWriteChecks
targetNode
)
$
Action
.
deleteNode
userRootId
targetNode
Action
.
deleteNode
userRootId
targetNode
,
childrenAPI
=
Named
.
ChildrenAPI
$
\
mb_nty
mb_off
mb_lim
->
,
childrenAPI
=
Named
.
ChildrenAPI
{
summaryChildrenEp
=
\
nt
o
l
->
runDBQuery
$
getChildren
targetNode
(
Proxy
::
Proxy
a
)
nt
o
l
}
runDBQuery
$
getChildren
targetNode
(
Proxy
::
Proxy
a
)
mb_nty
mb_off
mb_lim
,
tableAPI
=
tableApi
targetNode
,
tableAPI
=
tableApi
targetNode
,
tableNgramsAPI
=
apiNgramsTableCorpus
targetNode
,
tableNgramsAPI
=
apiNgramsTableCorpus
targetNode
,
catAPI
=
Named
.
CatAPI
$
catApi
targetNode
,
catAPI
=
Named
.
CatAPI
{
categoriseEp
=
catApi
targetNode
}
,
scoreAPI
=
Named
.
ScoreAPI
$
scoreApi
targetNode
,
scoreAPI
=
Named
.
ScoreAPI
{
scoreNodesEp
=
scoreApi
targetNode
}
,
searchAPI
=
Search
.
api
targetNode
,
searchAPI
=
Search
.
api
targetNode
,
shareAPI
=
Named
.
ShareNode
$
Share
.
api
userRootId
targetNode
,
shareAPI
=
Named
.
ShareNode
{
shareNodeEp
=
Share
.
api
userRootId
targetNode
}
,
unshareEp
=
Share
.
unShare
targetNode
,
unshareEp
=
Share
.
unShare
targetNode
,
publishAPI
=
withNamedPolicyT
authenticatedUser
(
publishChecks
targetNode
)
$
,
publishAPI
=
withNamedPolicyT
authenticatedUser
(
publishChecks
targetNode
)
$
Named
.
PublishAPI
$
\
Named
.
PublishRequest
{
pubrq_policy
}
->
runDBTx
$
U
.
publish
loggedInUserId
targetNode
pubrq_policy
Named
.
PublishAPI
{
publishEp
=
\
Named
.
PublishRequest
{
pubrq_policy
}
->
runDBTx
$
U
.
publish
loggedInUserId
targetNode
pubrq_policy
}
---- Pairing utilities
---- Pairing utilities
,
pairWithEp
=
pairWith
targetNode
,
pairWithEp
=
pairWith
targetNode
,
pairsEp
=
pairs
targetNode
,
pairsEp
=
pairs
targetNode
,
pairingEp
=
Named
.
PairingAPI
$
getPair
targetNode
,
pairingEp
=
Named
.
PairingAPI
{
getPairingEp
=
getPair
targetNode
}
---- VIZ
---- VIZ
,
scatterAPI
=
scatterApi
targetNode
,
scatterAPI
=
scatterApi
targetNode
,
chartAPI
=
chartApi
targetNode
,
chartAPI
=
chartApi
targetNode
,
pieAPI
=
pieApi
targetNode
,
pieAPI
=
pieApi
targetNode
,
treeAPI
=
treeApi
targetNode
,
treeAPI
=
treeApi
targetNode
,
phyloAPI
=
phyloAPI
targetNode
,
phyloAPI
=
phyloAPI
targetNode
,
moveAPI
=
Named
.
MoveAPI
$
\
parentId
->
,
moveAPI
=
Named
.
MoveAPI
{
moveNodeEp
=
\
parentId
->
withPolicy
authenticatedUser
(
moveChecks
(
SourceId
targetNode
)
(
TargetId
parentId
))
$
withPolicy
authenticatedUser
(
moveChecks
(
SourceId
targetNode
)
(
TargetId
parentId
))
$
moveNode
loggedInUserId
targetNode
parentId
moveNode
loggedInUserId
targetNode
parentId
}
,
fileAPI
=
Named
.
FileAPI
{
fileDownloadEp
=
fileApi
targetNode
}
,
fileAPI
=
Named
.
FileAPI
{
fileDownloadEp
=
fileApi
targetNode
}
,
fileAsyncAPI
=
fileAsyncApi
authenticatedUser
targetNode
,
fileAsyncAPI
=
fileAsyncApi
authenticatedUser
targetNode
,
dfwnAPI
=
DFWN
.
api
authenticatedUser
targetNode
,
dfwnAPI
=
DFWN
.
api
authenticatedUser
targetNode
...
...
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