]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Types/Node.hs
[Annuanire][Contact] Route + script.
[gargantext.git] / src / Gargantext / Database / Types / Node.hs
1 {-|
2 Module : Gargantext.Database.Types.Nodes
3 Description : Main Types of Nodes in Database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 {-# OPTIONS_GHC -fno-warn-orphans #-}
13
14 {-# LANGUAGE BangPatterns #-}
15 {-# LANGUAGE DeriveGeneric #-}
16 {-# LANGUAGE FlexibleInstances #-}
17 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
18 {-# LANGUAGE NoImplicitPrelude #-}
19 {-# LANGUAGE OverloadedStrings #-}
20 {-# LANGUAGE TemplateHaskell #-}
21 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
22
23 -- {-# LANGUAGE DuplicateRecordFields #-}
24
25 module Gargantext.Database.Types.Node
26 where
27
28 import Prelude (Enum, Bounded, minBound, maxBound)
29
30 import GHC.Generics (Generic)
31
32 import Control.Lens hiding (elements, (&))
33 import Control.Applicative ((<*>))
34 import Control.Monad (mzero)
35
36 import Data.Aeson
37 import Data.Aeson.Types (emptyObject)
38 import Data.Aeson (Object, toJSON)
39 import Data.Aeson.TH (deriveJSON)
40 import Data.ByteString.Lazy (ByteString)
41 import Data.Either
42 import Data.Eq (Eq)
43 import Data.Monoid (mempty)
44 import Data.Text (Text, unpack)
45 import Data.Time (UTCTime)
46 import Data.Swagger
47
48 import Text.Read (read)
49 import Text.Show (Show())
50
51 import Database.PostgreSQL.Simple.ToField (ToField, toField, toJSONField)
52 import Database.PostgreSQL.Simple.FromField (FromField, fromField)
53 import Servant
54
55 import Test.QuickCheck.Arbitrary
56 import Test.QuickCheck (elements)
57 import Test.QuickCheck.Instances.Time ()
58 import Test.QuickCheck.Instances.Text ()
59
60 import Gargantext.Prelude
61 import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
62 import Gargantext.Viz.Phylo (Phylo)
63 --import Gargantext.Database.Utils
64 ------------------------------------------------------------------------
65 newtype NodeId = NodeId Int
66 deriving (Show, Read, Generic, Num, Eq, Ord, Enum, ToJSONKey, FromJSONKey, ToJSON, FromJSON)
67
68 instance ToField NodeId where
69 toField (NodeId n) = toField n
70
71
72 instance FromField NodeId where
73 fromField field mdata = do
74 n <- fromField field mdata
75 if (n :: Int) > 0
76 then return $ NodeId n
77 else mzero
78
79 instance ToSchema NodeId
80
81 type NodeTypeId = Int
82 type NodeName = Text
83 type TSVector = Text
84
85 ------------------------------------------------------------------------
86 data NodePoly id typename userId
87 parentId name date
88 hyperdata = Node { _node_id :: id
89 , _node_typename :: typename
90
91 , _node_userId :: userId
92 , _node_parentId :: parentId
93
94 , _node_name :: name
95 , _node_date :: date
96
97 , _node_hyperdata :: hyperdata
98 } deriving (Show, Generic)
99 $(deriveJSON (unPrefix "_node_") ''NodePoly)
100 $(makeLenses ''NodePoly)
101
102 -- | NodePoly indicates that Node has a Polymorphism Type
103 type Node json = NodePoly NodeId NodeTypeId UserId (Maybe ParentId) NodeName UTCTime json
104
105
106
107 ------------------------------------------------------------------------
108
109
110 instance FromHttpApiData NodeId where
111 parseUrlPiece n = pure $ NodeId $ (read . cs) n
112
113 instance ToParamSchema NodeId
114 instance Arbitrary NodeId where
115 arbitrary = NodeId <$> arbitrary
116
117 type ParentId = NodeId
118 type CorpusId = NodeId
119 type ListId = NodeId
120 type DocumentId = NodeId
121 type DocId = NodeId
122 type RootId = NodeId
123 type MasterCorpusId = CorpusId
124 type UserCorpusId = CorpusId
125
126 type GraphId = NodeId
127 type PhyloId = NodeId
128 type AnnuaireId = NodeId
129 type ContactId = NodeId
130
131 type UserId = Int
132 type MasterUserId = UserId
133
134 id2int :: NodeId -> Int
135 id2int (NodeId n) = n
136
137 ------------------------------------------------------------------------
138 data Status = Status { status_failed :: !Int
139 , status_succeeded :: !Int
140 , status_remaining :: !Int
141 } deriving (Show, Generic)
142 $(deriveJSON (unPrefix "status_") ''Status)
143
144 instance Arbitrary Status where
145 arbitrary = Status <$> arbitrary <*> arbitrary <*> arbitrary
146
147 ------------------------------------------------------------------------
148 data StatusV3 = StatusV3 { statusV3_error :: !(Maybe Text)
149 , statusV3_action :: !(Maybe Text)
150 } deriving (Show, Generic)
151 $(deriveJSON (unPrefix "statusV3_") ''StatusV3)
152 ------------------------------------------------------------------------
153
154 -- Only Hyperdata types should be member of this type class.
155
156 ------------------------------------------------------------------------
157 data HyperdataDocumentV3 = HyperdataDocumentV3 { hyperdataDocumentV3_publication_day :: !(Maybe Int)
158 , hyperdataDocumentV3_language_iso2 :: !(Maybe Text)
159 , hyperdataDocumentV3_publication_second :: !(Maybe Int)
160 , hyperdataDocumentV3_publication_minute :: !(Maybe Int)
161 , hyperdataDocumentV3_publication_month :: !(Maybe Int)
162 , hyperdataDocumentV3_publication_hour :: !(Maybe Int)
163 , hyperdataDocumentV3_error :: !(Maybe Text)
164 , hyperdataDocumentV3_language_iso3 :: !(Maybe Text)
165 , hyperdataDocumentV3_authors :: !(Maybe Text)
166 , hyperdataDocumentV3_publication_year :: !(Maybe Int)
167 , hyperdataDocumentV3_publication_date :: !(Maybe Text)
168 , hyperdataDocumentV3_language_name :: !(Maybe Text)
169 , hyperdataDocumentV3_statuses :: !(Maybe [StatusV3])
170 , hyperdataDocumentV3_realdate_full_ :: !(Maybe Text)
171 , hyperdataDocumentV3_source :: !(Maybe Text)
172 , hyperdataDocumentV3_abstract :: !(Maybe Text)
173 , hyperdataDocumentV3_title :: !(Maybe Text)
174 } deriving (Show, Generic)
175 $(deriveJSON (unPrefix "hyperdataDocumentV3_") ''HyperdataDocumentV3)
176
177 class Hyperdata a
178 instance Hyperdata HyperdataDocumentV3
179
180 ------------------------------------------------------------------------
181 data HyperdataDocument = HyperdataDocument { _hyperdataDocument_bdd :: !(Maybe Text)
182 , _hyperdataDocument_doi :: !(Maybe Text)
183 , _hyperdataDocument_url :: !(Maybe Text)
184 , _hyperdataDocument_uniqId :: !(Maybe Text)
185 , _hyperdataDocument_uniqIdBdd :: !(Maybe Text)
186 , _hyperdataDocument_page :: !(Maybe Int)
187 , _hyperdataDocument_title :: !(Maybe Text)
188 , _hyperdataDocument_authors :: !(Maybe Text)
189 , _hyperdataDocument_institutes :: !(Maybe Text)
190 , _hyperdataDocument_source :: !(Maybe Text)
191 , _hyperdataDocument_abstract :: !(Maybe Text)
192 , _hyperdataDocument_publication_date :: !(Maybe Text)
193 , _hyperdataDocument_publication_year :: !(Maybe Int)
194 , _hyperdataDocument_publication_month :: !(Maybe Int)
195 , _hyperdataDocument_publication_day :: !(Maybe Int)
196 , _hyperdataDocument_publication_hour :: !(Maybe Int)
197 , _hyperdataDocument_publication_minute :: !(Maybe Int)
198 , _hyperdataDocument_publication_second :: !(Maybe Int)
199 , _hyperdataDocument_language_iso2 :: !(Maybe Text)
200 } deriving (Show, Generic)
201
202 $(deriveJSON (unPrefix "_hyperdataDocument_") ''HyperdataDocument)
203 $(makeLenses ''HyperdataDocument)
204
205 class ToHyperdataDocument a where
206 toHyperdataDocument :: a -> HyperdataDocument
207
208 instance ToHyperdataDocument HyperdataDocument
209 where
210 toHyperdataDocument = identity
211
212 instance Eq HyperdataDocument where
213 (==) h1 h2 = (==) (_hyperdataDocument_uniqId h1) (_hyperdataDocument_uniqId h2)
214
215 instance Ord HyperdataDocument where
216 compare h1 h2 = compare (_hyperdataDocument_publication_date h1) (_hyperdataDocument_publication_date h2)
217
218 instance Hyperdata HyperdataDocument
219
220 instance ToField HyperdataDocument where
221 toField = toJSONField
222
223 instance Arbitrary HyperdataDocument where
224 arbitrary = elements arbitraryHyperdataDocuments
225
226 arbitraryHyperdataDocuments :: [HyperdataDocument]
227 arbitraryHyperdataDocuments =
228 map toHyperdataDocument' ([ ("AI is big but less than crypto", "Troll System journal")
229 , ("Crypto is big but less than AI", "System Troll review" )
230 , ("Science is magic" , "Closed Source review")
231 , ("Open science for all" , "No Time" )
232 , ("Closed science for me" , "No Space" )
233 ] :: [(Text, Text)])
234 where
235 toHyperdataDocument' (t1,t2) =
236 HyperdataDocument Nothing Nothing Nothing Nothing Nothing Nothing (Just t1)
237 Nothing Nothing (Just t2) Nothing Nothing Nothing Nothing Nothing
238 Nothing Nothing Nothing Nothing
239
240 ------------------------------------------------------------------------
241 data LanguageNodes = LanguageNodes { languageNodes___unknown__ :: [Int]}
242 deriving (Show, Generic)
243 $(deriveJSON (unPrefix "languageNodes_") ''LanguageNodes)
244
245 ------------------------------------------------------------------------
246 -- level: debug | dev (fatal = critical)
247 data EventLevel = CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG
248 deriving (Show, Generic, Enum, Bounded)
249
250 instance FromJSON EventLevel
251 instance ToJSON EventLevel
252
253 instance Arbitrary EventLevel where
254 arbitrary = elements [minBound..maxBound]
255
256 instance ToSchema EventLevel where
257 declareNamedSchema proxy = genericDeclareNamedSchema defaultSchemaOptions proxy
258
259 ------------------------------------------------------------------------
260
261 data Event = Event { event_level :: !EventLevel
262 , event_message :: !Text
263 , event_date :: !UTCTime
264 } deriving (Show, Generic)
265 $(deriveJSON (unPrefix "event_") ''Event)
266
267 instance Arbitrary Event where
268 arbitrary = Event <$> arbitrary <*> arbitrary <*> arbitrary
269
270 instance ToSchema Event where
271 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "event_")
272
273 ------------------------------------------------------------------------
274
275 data Resource = Resource { resource_path :: !(Maybe Text)
276 , resource_scraper :: !(Maybe Text)
277 , resource_query :: !(Maybe Text)
278 , resource_events :: !([Event])
279 , resource_status :: !Status
280 , resource_date :: !UTCTime
281 } deriving (Show, Generic)
282 $(deriveJSON (unPrefix "resource_") ''Resource)
283
284 instance Arbitrary Resource where
285 arbitrary = Resource <$> arbitrary
286 <*> arbitrary
287 <*> arbitrary
288 <*> arbitrary
289 <*> arbitrary
290 <*> arbitrary
291
292 instance ToSchema Resource where
293 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "resource_")
294
295 ------------------------------------------------------------------------
296 data HyperdataUser = HyperdataUser { hyperdataUser_language :: Maybe Text
297 } deriving (Show, Generic)
298 $(deriveJSON (unPrefix "hyperdataUser_") ''HyperdataUser)
299
300 instance Hyperdata HyperdataUser
301 ------------------------------------------------------------------------
302 data HyperdataFolder = HyperdataFolder { hyperdataFolder_desc :: Maybe Text
303 } deriving (Show, Generic)
304 $(deriveJSON (unPrefix "hyperdataFolder_") ''HyperdataFolder)
305
306 instance Hyperdata HyperdataFolder
307 ------------------------------------------------------------------------
308 data HyperdataCorpus = HyperdataCorpus { hyperdataCorpus_title :: !(Maybe Text)
309 , hyperdataCorpus_desc :: !(Maybe Text)
310 , hyperdataCorpus_query :: !(Maybe Text)
311 , hyperdataCorpus_authors :: !(Maybe Text)
312 , hyperdataCorpus_resources :: !(Maybe [Resource])
313 } deriving (Show, Generic)
314 $(deriveJSON (unPrefix "hyperdataCorpus_") ''HyperdataCorpus)
315
316 instance Hyperdata HyperdataCorpus
317
318 corpusExample :: ByteString
319 corpusExample = "" -- TODO
320
321 defaultCorpus :: HyperdataCorpus
322 defaultCorpus = (HyperdataCorpus (Just "Title") (Just "Descr") (Just "Bool query") (Just "Authors") Nothing)
323
324 hyperdataCorpus :: HyperdataCorpus
325 hyperdataCorpus = case decode corpusExample of
326 Just hp -> hp
327 Nothing -> defaultCorpus
328
329 instance Arbitrary HyperdataCorpus where
330 arbitrary = pure hyperdataCorpus -- TODO
331
332 ------------------------------------------------------------------------
333
334 data HyperdataList = HyperdataList {hd_list :: !(Maybe Text)
335 } deriving (Show, Generic)
336 $(deriveJSON (unPrefix "hd_") ''HyperdataList)
337
338 instance Hyperdata HyperdataList
339
340 ------------------------------------------------------------------------
341 data HyperdataAnnuaire = HyperdataAnnuaire { hyperdataAnnuaire_title :: !(Maybe Text)
342 , hyperdataAnnuaire_desc :: !(Maybe Text)
343 } deriving (Show, Generic)
344 $(deriveJSON (unPrefix "hyperdataAnnuaire_") ''HyperdataAnnuaire)
345
346 instance Hyperdata HyperdataAnnuaire
347
348 hyperdataAnnuaire :: HyperdataAnnuaire
349 hyperdataAnnuaire = HyperdataAnnuaire (Just "Annuaire Title") (Just "Annuaire Description")
350
351 instance Arbitrary HyperdataAnnuaire where
352 arbitrary = pure hyperdataAnnuaire -- TODO
353
354 ------------------------------------------------------------------------
355 newtype HyperdataAny = HyperdataAny Object
356 deriving (Show, Generic, ToJSON, FromJSON)
357
358 instance Hyperdata HyperdataAny
359
360 instance Arbitrary HyperdataAny where
361 arbitrary = pure $ HyperdataAny mempty -- TODO produce arbitrary objects
362 ------------------------------------------------------------------------
363
364 {-
365 instance Arbitrary HyperdataList' where
366 arbitrary = elements [HyperdataList' (Just "from list A")]
367 -}
368
369 ----
370 data HyperdataListModel = HyperdataListModel { _hlm_params :: !(Int, Int)
371 , _hlm_path :: !Text
372 , _hlm_score :: !(Maybe Double)
373 } deriving (Show, Generic)
374
375 instance Hyperdata HyperdataListModel
376 instance Arbitrary HyperdataListModel where
377 arbitrary = elements [HyperdataListModel (100,100) "models/example.model" Nothing]
378
379 $(deriveJSON (unPrefix "_hlm_") ''HyperdataListModel)
380 $(makeLenses ''HyperdataListModel)
381
382 ------------------------------------------------------------------------
383 data HyperdataScore = HyperdataScore { hyperdataScore_preferences :: !(Maybe Text)
384 } deriving (Show, Generic)
385 $(deriveJSON (unPrefix "hyperdataScore_") ''HyperdataScore)
386
387 instance Hyperdata HyperdataScore
388
389 ------------------------------------------------------------------------
390
391 data HyperdataResource = HyperdataResource { hyperdataResource_preferences :: !(Maybe Text)
392 } deriving (Show, Generic)
393 $(deriveJSON (unPrefix "hyperdataResource_") ''HyperdataResource)
394
395 instance Hyperdata HyperdataResource
396
397 ------------------------------------------------------------------------
398 data HyperdataDashboard = HyperdataDashboard { hyperdataDashboard_preferences :: !(Maybe Text)
399 } deriving (Show, Generic)
400 $(deriveJSON (unPrefix "hyperdataDashboard_") ''HyperdataDashboard)
401
402 instance Hyperdata HyperdataDashboard
403
404 -- TODO add the Graph Structure here
405 data HyperdataGraph = HyperdataGraph { hyperdataGraph_preferences :: !(Maybe Text)
406 } deriving (Show, Generic)
407 $(deriveJSON (unPrefix "hyperdataGraph_") ''HyperdataGraph)
408
409 instance Hyperdata HyperdataGraph
410
411 ------------------------------------------------------------------------
412
413 -- TODO add the Graph Structure here
414 data HyperdataPhylo = HyperdataPhylo { hyperdataPhylo_preferences :: !(Maybe Text)
415 , hyperdataPhylo_data :: !(Maybe Phylo)
416 } deriving (Show, Generic)
417 $(deriveJSON (unPrefix "hyperdataPhylo_") ''HyperdataPhylo)
418
419 instance Hyperdata HyperdataPhylo
420
421 ------------------------------------------------------------------------
422 -- | TODO FEATURE: Notebook saved in the node
423 data HyperdataNotebook = HyperdataNotebook { hyperdataNotebook_preferences :: !(Maybe Text)
424 } deriving (Show, Generic)
425 $(deriveJSON (unPrefix "hyperdataNotebook_") ''HyperdataNotebook)
426
427 instance Hyperdata HyperdataNotebook
428
429
430 -- | TODO CLEAN
431 data HyperData = HyperdataTexts { hd_preferences :: Maybe Text }
432 | HyperdataList' { hd_preferences :: Maybe Text}
433 deriving (Show, Generic)
434
435 $(deriveJSON (unPrefix "hd_") ''HyperData)
436
437 instance Hyperdata HyperData
438
439
440
441 ------------------------------------------------------------------------
442 -- | Then a Node can be either a Folder or a Corpus or a Document
443 data NodeType = NodeUser
444 | NodeFolderPrivate
445 | NodeFolderShared | NodeTeam
446 | NodeFolderPublic
447 | NodeFolder
448
449 | NodeCorpus | NodeCorpusV3 | NodeTexts | NodeDocument
450 | NodeAnnuaire | NodeContact
451 | NodeGraph | NodePhylo
452 | NodeDashboard | NodeChart | NodeNoteBook
453 | NodeList | NodeListModel
454 deriving (Show, Read, Eq, Generic, Bounded, Enum)
455
456
457 {-
458 -- | Metrics
459 -- | NodeOccurrences
460 -- | Classification
461 -}
462
463 allNodeTypes :: [NodeType]
464 allNodeTypes = [minBound ..]
465
466 instance FromJSON NodeType
467 instance ToJSON NodeType
468
469 instance FromHttpApiData NodeType
470 where
471 parseUrlPiece = Right . read . unpack
472
473 instance ToParamSchema NodeType
474 instance ToSchema NodeType
475
476
477 data NodePolySearch id typename userId
478 parentId name date
479 hyperdata search = NodeSearch { _ns_id :: id
480 , _ns_typename :: typename
481 , _ns_userId :: userId
482 -- , nodeUniqId :: hashId
483 , _ns_parentId :: parentId
484 , _ns_name :: name
485 , _ns_date :: date
486
487 , _ns_hyperdata :: hyperdata
488 , _ns_search :: search
489 } deriving (Show, Generic)
490 $(deriveJSON (unPrefix "_ns_") ''NodePolySearch)
491 $(makeLenses ''NodePolySearch)
492
493 type NodeSearch json = NodePolySearch NodeId NodeTypeId UserId (Maybe ParentId) NodeName UTCTime json (Maybe TSVector)
494 ------------------------------------------------------------------------
495
496
497 instance (Arbitrary hyperdata
498 ,Arbitrary nodeId
499 ,Arbitrary nodeTypeId
500 ,Arbitrary userId
501 ,Arbitrary nodeParentId
502 ) => Arbitrary (NodePoly nodeId nodeTypeId userId nodeParentId
503 NodeName UTCTime hyperdata) where
504 --arbitrary = Node 1 1 (Just 1) 1 "name" (jour 2018 01 01) (arbitrary) (Just "")
505 arbitrary = Node <$> arbitrary <*> arbitrary <*> arbitrary
506 <*> arbitrary <*> arbitrary <*> arbitrary
507 <*> arbitrary
508
509 instance (Arbitrary hyperdata
510 ,Arbitrary nodeId
511 ,Arbitrary nodeTypeId
512 ,Arbitrary userId
513 ,Arbitrary nodeParentId
514 ) => Arbitrary (NodePolySearch nodeId nodeTypeId userId nodeParentId
515 NodeName UTCTime hyperdata (Maybe TSVector)) where
516 --arbitrary = Node 1 1 (Just 1) 1 "name" (jour 2018 01 01) (arbitrary) (Just "")
517 arbitrary = NodeSearch <$> arbitrary <*> arbitrary <*> arbitrary
518 <*> arbitrary <*> arbitrary <*> arbitrary
519 <*> arbitrary <*> arbitrary
520
521
522 ------------------------------------------------------------------------
523 hyperdataDocument :: HyperdataDocument
524 hyperdataDocument = case decode docExample of
525 Just hp -> hp
526 Nothing -> HyperdataDocument Nothing Nothing Nothing Nothing
527 Nothing Nothing Nothing Nothing
528 Nothing Nothing Nothing Nothing
529 Nothing Nothing Nothing Nothing
530 Nothing Nothing Nothing
531 docExample :: ByteString
532 docExample = "{\"doi\":\"sdfds\",\"publication_day\":6,\"language_iso2\":\"en\",\"publication_minute\":0,\"publication_month\":7,\"language_iso3\":\"eng\",\"publication_second\":0,\"authors\":\"Nils Hovdenak, Kjell Haram\",\"publication_year\":2012,\"publication_date\":\"2012-07-06 00:00:00+00:00\",\"language_name\":\"English\",\"realdate_full_\":\"2012 01 12\",\"source\":\"European journal of obstetrics, gynecology, and reproductive biology\",\"abstract\":\"The literature was searched for publications on minerals and vitamins during pregnancy and the possible influence of supplements on pregnancy outcome.\",\"title\":\"Influence of mineral and vitamin supplements on pregnancy outcome.\",\"publication_hour\":0}"
533
534 instance ToSchema HyperdataCorpus where
535 declareNamedSchema proxy =
536 genericDeclareNamedSchema (unPrefixSwagger "hyperdataCorpus_") proxy
537 & mapped.schema.description ?~ "a corpus"
538 & mapped.schema.example ?~ toJSON hyperdataCorpus
539
540 instance ToSchema HyperdataAnnuaire where
541 declareNamedSchema proxy =
542 genericDeclareNamedSchema (unPrefixSwagger "hyperdataAnnuaire_") proxy
543 & mapped.schema.description ?~ "an annuaire"
544 & mapped.schema.example ?~ toJSON hyperdataAnnuaire
545
546 instance ToSchema HyperdataDocument where
547 declareNamedSchema proxy =
548 genericDeclareNamedSchema (unPrefixSwagger "_hyperdataDocument_") proxy
549 & mapped.schema.description ?~ "a document"
550 & mapped.schema.example ?~ toJSON hyperdataDocument
551
552 instance ToSchema HyperdataAny where
553 declareNamedSchema proxy =
554 pure $ genericNameSchema defaultSchemaOptions proxy mempty
555 & schema.description ?~ "a node"
556 & schema.example ?~ emptyObject -- TODO
557
558
559 instance ToSchema hyperdata =>
560 ToSchema (NodePoly NodeId NodeTypeId
561 (Maybe UserId)
562 ParentId NodeName
563 UTCTime hyperdata
564 ) where
565 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_node_")
566
567 instance ToSchema hyperdata =>
568 ToSchema (NodePoly NodeId NodeTypeId
569 UserId
570 (Maybe ParentId) NodeName
571 UTCTime hyperdata
572 ) where
573 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_node_")
574
575
576 instance ToSchema hyperdata =>
577 ToSchema (NodePolySearch NodeId NodeTypeId
578 (Maybe UserId)
579 ParentId NodeName
580 UTCTime hyperdata (Maybe TSVector)
581 ) where
582 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_ns_")
583
584 instance ToSchema hyperdata =>
585 ToSchema (NodePolySearch NodeId NodeTypeId
586 UserId
587 (Maybe ParentId) NodeName
588 UTCTime hyperdata (Maybe TSVector)
589 ) where
590 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "_ns_")
591
592
593 instance ToSchema Status where
594 declareNamedSchema = genericDeclareNamedSchema (unPrefixSwagger "status_")
595
596