gargantext-0.0.4.9.5: Search, map, share
Copyright(c) CNRS 2017-Present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
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 Source #

Admin NodesAPI TODO

nodesAPI :: [NodeId] -> GargServer NodesAPI Source #

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

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

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 Source #

TODO: access by admin only

type NodeAPI a = Get '[JSON] (Node 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))))))))))))))))))))))))))) Source #

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]) Source #

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

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

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

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

nodeAPI :: forall proxy a. (JSONB a, FromJSON a, ToJSON a, MimeRender JSON a, MimeUnrender JSON a) => proxy a -> UserId -> NodeId -> GargServer (NodeAPI a) Source #

data RenameNode Source #

Constructors

RenameNode 

Fields

Instances

Instances details
Generic RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep RenameNode :: Type -> Type #

Arbitrary RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

ToJSON RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

FromJSON RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

ToSchema RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

type Rep RenameNode Source # 
Instance details

Defined in Gargantext.API.Node

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

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

data NodesToCategory Source #

Constructors

NodesToCategory 

Instances

Instances details
Generic NodesToCategory Source # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep NodesToCategory :: Type -> Type #

ToJSON NodesToCategory Source # 
Instance details

Defined in Gargantext.API.Node

FromJSON NodesToCategory Source # 
Instance details

Defined in Gargantext.API.Node

ToSchema NodesToCategory Source # 
Instance details

Defined in Gargantext.API.Node

type Rep NodesToCategory Source # 
Instance details

Defined in Gargantext.API.Node

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

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

data NodesToScore Source #

Constructors

NodesToScore 

Fields

Instances

Instances details
Generic NodesToScore Source # 
Instance details

Defined in Gargantext.API.Node

Associated Types

type Rep NodesToScore :: Type -> Type #

ToJSON NodesToScore Source # 
Instance details

Defined in Gargantext.API.Node

FromJSON NodesToScore Source # 
Instance details

Defined in Gargantext.API.Node

ToSchema NodesToScore Source # 
Instance details

Defined in Gargantext.API.Node

type Rep NodesToScore Source # 
Instance details

Defined in Gargantext.API.Node

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

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

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

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

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

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

TODO Check if the name is less than 255 char

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

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