gargantext-0.0.7.1.5.3: Search, map, share
Copyright(c) CNRS 2017-Present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Gargantext.API.Node

Description

  • - TODO-SECURITY: Critical
  • - TODO-ACCESS: CanGetNode
  • - TODO-EVENTS: No events as this is a read only query. Node API
  • ------------------------------------------------------------------
  • - TODO-ACCESS: access by admin only.
  • - At first let's just have an isAdmin check.
  • - Later: check userId CanDeleteNodes Nothing
  • - TODO-EVENTS: DeletedNodes [NodeId]
  • - {"tag": DeletedNodes, "nodes": [Int*]}
Synopsis

Documentation

type NodesAPI = Delete '[JSON] Int #

Admin NodesAPI TODO

nodesAPI :: [NodeId] -> GargServer NodesAPI #

Delete Nodes Be careful: really delete nodes Access by admin only

type Roots = Get '[JSON] [Node HyperdataUser] :<|> Put '[JSON] Int #

TODO-ACCESS: access by admin only. At first let's just have an isAdmin check. Later: CanAccessAnyNode or (CanGetAnyNode, CanPutAnyNode) To manage the Users roots TODO-EVENTS: PutNode ? TODO needs design discussion.

roots :: GargServer Roots #

TODO: access by admin only

type NodeAPI a = PolicyChecked (NodeNodeAPI a) :<|> (("rename" :> RenameApi) :<|> (PostNodeApi :<|> (PostNodeAsync :<|> (API :<|> ((ReqBody '[JSON] a :> Put '[JSON] Int) :<|> (("update" :> API) :<|> (Delete '[JSON] Int :<|> (("children" :> ChildrenApi a) :<|> (("table" :> TableApi) :<|> (("ngrams" :> TableNgramsApi) :<|> (("category" :> CatApi) :<|> (("score" :> ScoreApi) :<|> (("search" :> API SearchResult) :<|> (("share" :> API) :<|> (("pairwith" :> PairWith) :<|> (("pairs" :> Pairs) :<|> (("pairing" :> PairingApi) :<|> (("metrics" :> ScatterAPI) :<|> (("chart" :> ChartApi) :<|> (("pie" :> PieApi) :<|> (("tree" :> TreeApi) :<|> (("phylo" :> PhyloAPI) :<|> (("move" :> MoveAPI) :<|> (("unpublish" :> Unpublish) :<|> (("file" :> FileApi) :<|> (("async" :> FileAsyncApi) :<|> (("documents-from-write-nodes" :> API) :<|> API))))))))))))))))))))))))))) #

Node API Types management TODO-ACCESS : access by users No ownership check is needed if we strictly follow the capability model.

CanGetNode (Node, Children, TableApi, TableNgramsApiGet, PairingApi, ChartApi, SearchAPI) CanRenameNode (or part of CanEditNode?) CanCreateChildren (PostNodeApi) CanEditNode / CanPutNode TODO not implemented yet CanDeleteNode CanPatch (TableNgramsApi) CanFavorite CanMoveToTrash

type RenameApi = Summary " Rename Node" :> (ReqBody '[JSON] RenameNode :> Put '[JSON] [Int]) #

type PostNodeApi = Summary " PostNode Node with ParentId as {id}" :> (ReqBody '[JSON] PostNode :> Post '[JSON] [NodeId]) #

type ChildrenApi a = Summary " Summary children" :> (QueryParam "type" NodeType :> (QueryParam "offset" Offset :> (QueryParam "limit" Limit :> Get '[JSON] (NodeTableResult a)))) #

type NodeNodeAPI a = Get '[JSON] (Node a) #

nodeNodeAPI :: forall proxy a. (JSONB a, ToJSON a) => proxy a -> AuthenticatedUser -> CorpusId -> NodeId -> GargServer (NodeNodeAPI a) #

data RenameNode #

Constructors

RenameNode 

Fields

Instances

Instances details
Arbitrary RenameNode # 
Instance details

Defined in Gargantext.API.Node

FromJSON RenameNode # 
Instance details

Defined in Gargantext.API.Node

ToJSON RenameNode # 
Instance details

Defined in Gargantext.API.Node

Generic RenameNode # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep RenameNode :: Type -> Type #

ToSchema RenameNode # 
Instance details

Defined in Gargantext.API.Node

HasSwagger (WithCustomErrorScheme GargAPI) # 
Instance details

Defined in Gargantext.API.Routes

type Rep RenameNode # 
Instance details

Defined in Gargantext.API.Node

type Rep RenameNode = D1 ('MetaData "RenameNode" "Gargantext.API.Node" "gargantext-0.0.7.1.5.3-inplace" 'False) (C1 ('MetaCons "RenameNode" 'PrefixI 'True) (S1 ('MetaSel ('Just "r_name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))

type CatApi = Summary " To Categorize NodeNodes: 0 for delete, 1/null neutral, 2 favorite" :> (ReqBody '[JSON] NodesToCategory :> Put '[JSON] [Int]) #

data NodesToCategory #

Constructors

NodesToCategory 

Instances

Instances details
FromJSON NodesToCategory # 
Instance details

Defined in Gargantext.API.Node

ToJSON NodesToCategory # 
Instance details

Defined in Gargantext.API.Node

Generic NodesToCategory # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep NodesToCategory :: Type -> Type #

ToSchema NodesToCategory # 
Instance details

Defined in Gargantext.API.Node

HasSwagger (WithCustomErrorScheme GargAPI) # 
Instance details

Defined in Gargantext.API.Routes

type Rep NodesToCategory # 
Instance details

Defined in Gargantext.API.Node

type Rep NodesToCategory = D1 ('MetaData "NodesToCategory" "Gargantext.API.Node" "gargantext-0.0.7.1.5.3-inplace" 'False) (C1 ('MetaCons "NodesToCategory" 'PrefixI 'True) (S1 ('MetaSel ('Just "ntc_nodesId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NodeId]) :*: S1 ('MetaSel ('Just "ntc_category") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

type ScoreApi = Summary " To Score NodeNodes" :> (ReqBody '[JSON] NodesToScore :> Put '[JSON] [Int]) #

data NodesToScore #

Constructors

NodesToScore 

Fields

Instances

Instances details
FromJSON NodesToScore # 
Instance details

Defined in Gargantext.API.Node

ToJSON NodesToScore # 
Instance details

Defined in Gargantext.API.Node

Generic NodesToScore # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep NodesToScore :: Type -> Type #

ToSchema NodesToScore # 
Instance details

Defined in Gargantext.API.Node

HasSwagger (WithCustomErrorScheme GargAPI) # 
Instance details

Defined in Gargantext.API.Routes

type Rep NodesToScore # 
Instance details

Defined in Gargantext.API.Node

type Rep NodesToScore = D1 ('MetaData "NodesToScore" "Gargantext.API.Node" "gargantext-0.0.7.1.5.3-inplace" 'False) (C1 ('MetaCons "NodesToScore" 'PrefixI 'True) (S1 ('MetaSel ('Just "nts_nodesId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NodeId]) :*: S1 ('MetaSel ('Just "nts_score") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

type PairingApi = Summary " Pairing API" :> (QueryParam "view" TabType :> (QueryParam "offset" Offset :> (QueryParam "limit" Limit :> (QueryParam "order" OrderBy :> Get '[JSON] [FacetDoc])))) #

type Pairs = Summary "List of Pairs" :> Get '[JSON] [AnnuaireId] #

type PairWith = Summary "Pair a Corpus with an Annuaire" :> ("annuaire" :> (Capture "annuaire_id" AnnuaireId :> (QueryParam "list_id" ListId :> Post '[JSON] [Int]))) #

type TreeAPI = (QueryParams "type" NodeType :> Get '[JSON] (Tree NodeTree)) :<|> ("first-level" :> (QueryParams "type" NodeType :> Get '[JSON] (Tree NodeTree))) #

rename :: NodeId -> RenameNode -> Cmd err [Int] #

TODO Check if the name is less than 255 char

putNode :: forall err a. (HasNodeError err, HyperdataC a) => NodeId -> a -> Cmd err Int #

type MoveAPI = Summary "Move Node endpoint" :> (Capture "parent_id" ParentId :> Put '[JSON] [Int]) #

moveNode :: User -> NodeId -> ParentId -> Cmd err [Int] #