content-dir-consts.ts 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { IKnownClass, IPropertyWithId } from '../types'
  2. // Content directory predefined class names
  3. export enum ContentDirectoryKnownClasses {
  4. CHANNEL = 'Channel',
  5. CATEGORY = 'Category',
  6. HTTPMEDIALOCATION = 'HttpMediaLocation',
  7. JOYSTREAMMEDIALOCATION = 'JoystreamMediaLocation',
  8. KNOWNLICENSE = 'KnownLicense',
  9. LANGUAGE = 'Language',
  10. LICENSE = 'License',
  11. MEDIALOCATION = 'MediaLocation',
  12. USERDEFINEDLICENSE = 'UserDefinedLicense',
  13. VIDEO = 'Video',
  14. VIDEOMEDIA = 'VideoMedia',
  15. VIDEOMEDIAENCODING = 'VideoMediaEncoding',
  16. FEATUREDVIDEOS = 'FeaturedVideo',
  17. }
  18. // Predefined content-directory classes, classId may change after the runtime seeding
  19. export const contentDirectoryClassNamesWithId: IKnownClass[] = [
  20. { name: ContentDirectoryKnownClasses.CHANNEL, classId: 1 },
  21. { name: ContentDirectoryKnownClasses.CATEGORY, classId: 2 },
  22. { name: ContentDirectoryKnownClasses.HTTPMEDIALOCATION, classId: 3 },
  23. { name: ContentDirectoryKnownClasses.JOYSTREAMMEDIALOCATION, classId: 4 },
  24. { name: ContentDirectoryKnownClasses.KNOWNLICENSE, classId: 5 },
  25. { name: ContentDirectoryKnownClasses.LANGUAGE, classId: 6 },
  26. { name: ContentDirectoryKnownClasses.LICENSE, classId: 7 },
  27. { name: ContentDirectoryKnownClasses.MEDIALOCATION, classId: 8 },
  28. { name: ContentDirectoryKnownClasses.USERDEFINEDLICENSE, classId: 9 },
  29. { name: ContentDirectoryKnownClasses.VIDEO, classId: 10 },
  30. { name: ContentDirectoryKnownClasses.VIDEOMEDIA, classId: 11 },
  31. { name: ContentDirectoryKnownClasses.VIDEOMEDIAENCODING, classId: 12 },
  32. { name: ContentDirectoryKnownClasses.FEATUREDVIDEOS, classId: 13 },
  33. ]
  34. export const categoryPropertyNamesWithId: IPropertyWithId = {
  35. 0: { name: 'name', type: 'string', required: true },
  36. 1: { name: 'description', type: 'string', required: false },
  37. }
  38. export const channelPropertyNamesWithId: IPropertyWithId = {
  39. 0: { name: 'handle', type: 'string', required: true },
  40. 1: { name: 'description', type: 'string', required: false },
  41. 2: { name: 'coverPhotoUrl', type: 'string', required: false },
  42. 3: { name: 'avatarPhotoUrl', type: 'string', required: false },
  43. 4: { name: 'isPublic', type: 'boolean', required: true },
  44. 5: { name: 'isCurated', type: 'boolean', required: false },
  45. 6: { name: 'language', type: 'number', required: false },
  46. }
  47. export const licensePropertyNamesWithId: IPropertyWithId = {
  48. 0: { name: 'knownLicense', type: 'number', required: false },
  49. 1: { name: 'userDefinedLicense', type: 'number', required: false },
  50. 2: { name: 'attribution', type: 'string', required: false },
  51. }
  52. export const knownLicensePropertyNamesWIthId: IPropertyWithId = {
  53. 0: { name: 'code', type: 'string', required: true },
  54. 1: { name: 'name', type: 'string', required: false },
  55. 2: { name: 'description', type: 'string', required: false },
  56. 3: { name: 'url', type: 'string', required: false },
  57. }
  58. export const languagePropertyNamesWIthId: IPropertyWithId = {
  59. 0: { name: 'name', type: 'string', required: true },
  60. 1: { name: 'code', type: 'string', required: true },
  61. }
  62. export const userDefinedLicensePropertyNamesWithId: IPropertyWithId = {
  63. 0: { name: 'content', type: 'string', required: false },
  64. }
  65. export const mediaLocationPropertyNamesWithId: IPropertyWithId = {
  66. 0: { name: 'httpMediaLocation', type: 'number', required: false },
  67. 1: { name: 'joystreamMediaLocation', type: 'number', required: false },
  68. }
  69. export const joystreamMediaLocationPropertyNamesWithId: IPropertyWithId = {
  70. 0: { name: 'dataObjectId', type: 'string', required: true },
  71. }
  72. export const httpMediaLocationPropertyNamesWithId: IPropertyWithId = {
  73. 0: { name: 'url', type: 'string', required: false },
  74. 1: { name: 'port', type: 'number', required: false },
  75. }
  76. export const videoMediaEncodingPropertyNamesWithId: IPropertyWithId = {
  77. 0: { name: 'name', type: 'string', required: true },
  78. }
  79. export const videoMediaPropertyNamesWithId: IPropertyWithId = {
  80. 0: { name: 'encoding', type: 'number', required: true },
  81. 1: { name: 'pixelWidth', type: 'number', required: true },
  82. 2: { name: 'pixelHeight', type: 'number', required: true },
  83. 3: { name: 'size', type: 'number', required: false },
  84. 4: { name: 'location', type: 'number', required: true },
  85. }
  86. export const videoPropertyNamesWithId: IPropertyWithId = {
  87. // referenced entity's id
  88. 0: { name: 'channel', type: 'number', required: true },
  89. // referenced entity's id
  90. 1: { name: 'category', type: 'number', required: true },
  91. 2: { name: 'title', type: 'string', required: false },
  92. 3: { name: 'description', type: 'string', required: false },
  93. 4: { name: 'duration', type: 'number', required: true },
  94. 5: { name: 'skippableIntroDuration', type: 'number', required: false },
  95. 6: { name: 'thumbnailUrl', type: 'string', required: true },
  96. 7: { name: 'language', type: 'number', required: false },
  97. // referenced entity's id
  98. 8: { name: 'media', type: 'number', required: true },
  99. 9: { name: 'hasMarketing', type: 'boolean', required: false },
  100. 10: { name: 'publishedBeforeJoystream', type: 'number', required: false },
  101. 11: { name: 'isPublic', type: 'boolean', required: true },
  102. 12: { name: 'isExplicit', type: 'boolean', required: true },
  103. 13: { name: 'license', type: 'number', required: true },
  104. 14: { name: 'isCurated', type: 'boolean', required: true },
  105. }
  106. export const featuredVideoPropertyNamesWithId: IPropertyWithId = {
  107. 0: { name: 'video', type: 'number', required: true },
  108. }