content-dir-consts.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. import { IPropertyIdWithName } 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. }
  17. // Predefined content-directory classes, classId may change after the runtime seeding
  18. export const contentDirectoryClassNamesWithId: { classId: number; name: string }[] = [
  19. { name: ContentDirectoryKnownClasses.CHANNEL, classId: 1 },
  20. { name: ContentDirectoryKnownClasses.CATEGORY, classId: 2 },
  21. { name: ContentDirectoryKnownClasses.HTTPMEDIALOCATION, classId: 3 },
  22. { name: ContentDirectoryKnownClasses.JOYSTREAMMEDIALOCATION, classId: 4 },
  23. { name: ContentDirectoryKnownClasses.KNOWNLICENSE, classId: 5 },
  24. { name: ContentDirectoryKnownClasses.LANGUAGE, classId: 6 },
  25. { name: ContentDirectoryKnownClasses.LICENSE, classId: 7 },
  26. { name: ContentDirectoryKnownClasses.MEDIALOCATION, classId: 8 },
  27. { name: ContentDirectoryKnownClasses.USERDEFINEDLICENSE, classId: 9 },
  28. { name: ContentDirectoryKnownClasses.VIDEO, classId: 10 },
  29. { name: ContentDirectoryKnownClasses.VIDEOMEDIA, classId: 11 },
  30. { name: ContentDirectoryKnownClasses.VIDEOMEDIAENCODING, classId: 12 },
  31. ]
  32. export const CategoryPropertyNamesWithId: IPropertyIdWithName = {
  33. 0: 'name',
  34. 1: 'description',
  35. }
  36. export const channelPropertyNamesWithId: IPropertyIdWithName = {
  37. 0: 'title',
  38. 1: 'description',
  39. 2: 'coverPhotoURL',
  40. 3: 'avatarPhotoURL',
  41. 4: 'isPublic',
  42. 5: 'isCurated',
  43. 6: 'language',
  44. }
  45. export const licensePropertyNamesWithId: IPropertyIdWithName = {
  46. 0: 'knownLicense',
  47. 1: 'userDefinedLicense',
  48. }
  49. export const knownLicensePropertyNamesWIthId: IPropertyIdWithName = {
  50. 0: 'code',
  51. 1: 'name',
  52. 2: 'description',
  53. 3: 'url',
  54. }
  55. export const languagePropertyNamesWIthId: IPropertyIdWithName = {
  56. 0: 'name',
  57. 1: 'code',
  58. }
  59. export const userDefinedLicensePropertyNamesWithId: IPropertyIdWithName = {
  60. 0: 'content',
  61. }
  62. export const mediaLocationPropertyNamesWithId: IPropertyIdWithName = {
  63. 0: 'httpMediaLocation',
  64. 1: 'joystreamMediaLocation',
  65. }
  66. export const joystreamMediaLocationPropertyNamesWithId: IPropertyIdWithName = {
  67. 0: 'dataObjectId',
  68. }
  69. export const httpMediaLocationPropertyNamesWithId: IPropertyIdWithName = {
  70. 0: 'url',
  71. 1: 'port',
  72. }
  73. export const videoMediaEncodingPropertyNamesWithId: IPropertyIdWithName = {
  74. 0: 'name',
  75. }
  76. export const videoMediaPropertyNamesWithId: IPropertyIdWithName = {
  77. 0: 'encoding',
  78. 1: 'pixelWidth',
  79. 2: 'pixelHeight',
  80. 3: 'size',
  81. 4: 'location',
  82. }
  83. export const videoPropertyNamesWithId: IPropertyIdWithName = {
  84. // referenced entity's id
  85. 0: 'channel',
  86. // referenced entity's id
  87. 1: 'category',
  88. 2: 'title',
  89. 3: 'description',
  90. 4: 'duration',
  91. 5: 'skippableIntroDuration',
  92. 6: 'thumbnailURL',
  93. 7: 'language',
  94. // referenced entity's id
  95. 8: 'media',
  96. 9: 'hasMarketing',
  97. 10: 'publishedBeforeJoystream',
  98. 11: 'isPublic',
  99. 12: 'isExplicit',
  100. 13: 'license',
  101. 14: 'isCurated',
  102. }