content.graphql 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. "Category of media channel"
  2. type ChannelCategory @entity {
  3. id: ID!
  4. "The name of the category"
  5. name: String @fulltext(query: "channelCategoriesByName")
  6. channels: [Channel!]! @derivedFrom(field: "category")
  7. createdInBlock: Int!
  8. }
  9. "Asset availability representation"
  10. enum AssetAvailability {
  11. "Asset is available in storage"
  12. ACCEPTED,
  13. "Asset is being uploaded to storage"
  14. PENDING,
  15. "Invalid storage (meta)data used"
  16. INVALID,
  17. }
  18. "The decision of the storage provider when it acts as liaison"
  19. enum LiaisonJudgement {
  20. "Content awaits for a judgment"
  21. PENDING,
  22. "Content accepted"
  23. ACCEPTED,
  24. }
  25. "Manages content ids, type and storage provider decision about it"
  26. type DataObject @entity {
  27. "Content owner"
  28. owner: DataObjectOwner!
  29. "Content added at"
  30. createdInBlock: Int!
  31. "Content type id"
  32. typeId: Int!
  33. "Content size in bytes"
  34. size: Int!
  35. "Storage provider id of the liaison"
  36. liaison: Worker # liaison is unset until storage provider accepts or rejects the content
  37. "Storage provider as liaison judgment"
  38. liaisonJudgement: LiaisonJudgement!
  39. "IPFS content id"
  40. ipfsContentId: String!
  41. "Joystream runtime content"
  42. joystreamContentId: String!
  43. }
  44. "Owner type for storage object"
  45. union DataObjectOwner = DataObjectOwnerMember
  46. | DataObjectOwnerChannel
  47. | DataObjectOwnerDao
  48. | DataObjectOwnerCouncil
  49. | DataObjectOwnerWorkingGroup
  50. "Asset owned by a member"
  51. type DataObjectOwnerMember @variant {
  52. # use `Int` instead of `Membership` before variant relations are featured in Hydra
  53. # TODO: setup proper relations
  54. #"Member identifier"
  55. #memberId: Membership!
  56. "Member identifier"
  57. member: Int!
  58. "Variant needs to have at least one property. This value is not used."
  59. dummy: Int
  60. }
  61. "Asset owned by a channel"
  62. type DataObjectOwnerChannel @variant {
  63. # use `Int` instead of `Channel` before variant relations are featured in Hydra
  64. #"Channel identifier"
  65. #channel: Channel!
  66. "Channel identifier"
  67. channel: Int!
  68. "Variant needs to have at least one property. This value is not used."
  69. dummy: Int
  70. }
  71. "Asset owned by a DAO"
  72. type DataObjectOwnerDao @variant {
  73. "DAO identifier"
  74. dao: Int!
  75. }
  76. "Asset owned by the Council"
  77. type DataObjectOwnerCouncil @variant {
  78. "Variant needs to have at least one property. This value is not used."
  79. dummy: Int
  80. }
  81. "Asset owned by a WorkingGroup"
  82. type DataObjectOwnerWorkingGroup @variant {
  83. "Working group identifier"
  84. workingGroup: Int!
  85. }
  86. #### High Level Derivative Entities ####
  87. type Language @entity {
  88. "Runtime entity identifier (EntityId)"
  89. id: ID!
  90. "Language identifier ISO 639-1"
  91. iso: String!
  92. createdInBlock: Int!
  93. }
  94. type Channel @entity {
  95. "Runtime entity identifier (EntityId)"
  96. id: ID!
  97. "Member owning the channel (if any)"
  98. ownerMember: Membership
  99. "Curator group owning the channel (if any)"
  100. ownerCuratorGroup: CuratorGroup
  101. category: ChannelCategory
  102. "Reward account where revenue is sent if set."
  103. rewardAccount: String
  104. "The title of the Channel"
  105. title: String @fulltext(query: "search")
  106. "The description of a Channel"
  107. description: String
  108. ### Cover photo asset ###
  109. # Channel's cover (background) photo. Recommended ratio: 16:9.
  110. "Asset's data object"
  111. coverPhotoDataObject: DataObject
  112. "URLs where the asset content can be accessed (if any)"
  113. coverPhotoUrls: [String!]
  114. "Availability meta information"
  115. coverPhotoAvailability: AssetAvailability!
  116. ### Avatar photo asset ###
  117. # Channel's avatar photo.
  118. "Asset's data object"
  119. avatarPhotoDataObject: DataObject
  120. "URLs where the asset content can be accessed (if any)"
  121. avatarPhotoUrls: [String!]
  122. "Availability meta information"
  123. avatarPhotoAvailability: AssetAvailability!
  124. ##########################
  125. "Flag signaling whether a channel is public."
  126. isPublic: Boolean
  127. "Flag signaling whether a channel is censored."
  128. isCensored: Boolean!
  129. "The primary langauge of the channel's content"
  130. language: Language
  131. videos: [Video!]! @derivedFrom(field: "channel")
  132. createdInBlock: Int!
  133. }
  134. type CuratorGroup @entity {
  135. "Runtime identifier"
  136. id: ID!
  137. "Curators belonging to this group"
  138. curatorIds: [Int!]!
  139. "Is group active or not"
  140. isActive: Boolean!
  141. channels: [Channel!]! @derivedFrom(field: "ownerCuratorGroup")
  142. }
  143. type VideoCategory @entity {
  144. "Runtime identifier"
  145. id: ID!
  146. "The name of the category"
  147. name: String @fulltext(query: "videoCategoriesByName")
  148. videos: [Video!]! @derivedFrom(field: "category")
  149. createdInBlock: Int!
  150. }
  151. type Video @entity {
  152. "Runtime identifier"
  153. id: ID!
  154. "Reference to member's channel"
  155. channel: Channel
  156. "Reference to a video category"
  157. category: VideoCategory
  158. "The title of the video"
  159. title: String @fulltext(query: "search")
  160. "The description of the Video"
  161. description: String
  162. "Video duration in seconds"
  163. duration: Int
  164. ### Thumbnail asset ###
  165. # Video thumbnail (recommended ratio: 16:9)
  166. "Asset's data object"
  167. thumbnailPhotoDataObject: DataObject
  168. "URLs where the asset content can be accessed (if any)"
  169. thumbnailPhotoUrls: [String!]
  170. "Availability meta information"
  171. thumbnailPhotoAvailability: AssetAvailability!
  172. ##########################
  173. "Video's main langauge"
  174. language: Language
  175. "Whether or not Video contains marketing"
  176. hasMarketing: Boolean
  177. "If the Video was published on other platform before beeing published on Joystream - the original publication date"
  178. publishedBeforeJoystream: DateTime
  179. "Whether the Video is supposed to be publically displayed"
  180. isPublic: Boolean
  181. "Flag signaling whether a video is censored."
  182. isCensored: Boolean!
  183. "Whether the Video contains explicit material."
  184. isExplicit: Boolean
  185. "License under the video is published"
  186. license: License
  187. ### Media asset ###
  188. # Reference to video asset
  189. "Asset's data object"
  190. mediaDataObject: DataObject
  191. "URLs where the asset content can be accessed (if any)"
  192. mediaUrls: [String!]
  193. "Availability meta information"
  194. mediaAvailability: AssetAvailability!
  195. ##########################
  196. "Video file metadata"
  197. mediaMetadata: VideoMediaMetadata
  198. createdInBlock: Int!
  199. "Is video featured or not"
  200. isFeatured: Boolean!
  201. }
  202. type VideoMediaMetadata @entity {
  203. "Unique identifier"
  204. id: ID!
  205. "Encoding of the video media object"
  206. encoding: VideoMediaEncoding
  207. "Video media width in pixels"
  208. pixelWidth: Int
  209. "Video media height in pixels"
  210. pixelHeight: Int
  211. "Video media size in bytes"
  212. size: Int
  213. video: Video @derivedFrom(field: "mediaMetadata")
  214. createdInBlock: Int!
  215. }
  216. type VideoMediaEncoding @entity {
  217. "Encoding of the video media object"
  218. codecName: String
  219. "Media container format"
  220. container: String
  221. "Content MIME type"
  222. mimeMediaType: String
  223. }
  224. type License @entity {
  225. "Unique identifier"
  226. id: ID!
  227. "License code defined by Joystream"
  228. code: Int
  229. "Attribution (if required by the license)"
  230. attribution: String
  231. "Custom license content"
  232. custom_text: String
  233. }
  234. enum WorkerType {
  235. GATEWAY
  236. STORAGE
  237. }
  238. type Worker @entity {
  239. "Unique identifier"
  240. id: ID!
  241. "Sign of worker still being active"
  242. isActive: Boolean!
  243. "Runtime identifier"
  244. workerId: String!
  245. "Associated working group"
  246. type: WorkerType!
  247. "Custom metadata set by provider"
  248. metadata: String
  249. dataObjects: [DataObject!]! @derivedFrom(field: "liaison")
  250. }
  251. type NextEntityId @entity {
  252. "Unique identifier"
  253. id: ID!
  254. "Next deterministic id for entities without custom id"
  255. nextId: Int!
  256. }