content-dir-consts.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import { IPropertyIdWithName } from '../types'
  2. // Content directory predefined class names
  3. export enum ContentDirectoryKnownClasses {
  4. CHANNEL = 'Channel',
  5. CATEGORY = 'Category',
  6. KNOWNLICENSE = 'KnownLicense',
  7. USERDEFINEDLICENSE = 'UserDefinedLicense',
  8. JOYSTREAMMEDIALOCATION = 'JoystreamMediaLocation',
  9. HTTPMEDIALOCATION = 'HttpMediaLocation',
  10. VIDEOMEDIA = 'VideoMedia',
  11. VIDEO = 'Video',
  12. LANGUAGE = 'Language',
  13. VIDEOMEDIAENCODING = 'VideoMediaEncoding',
  14. }
  15. // Predefined content-directory classes, classId may change after the runtime seeding
  16. export const contentDirectoryClassNamesWithId: { classId: number; name: string }[] = [
  17. { name: ContentDirectoryKnownClasses.CHANNEL, classId: 1 },
  18. { name: ContentDirectoryKnownClasses.CATEGORY, classId: 2 },
  19. { name: ContentDirectoryKnownClasses.HTTPMEDIALOCATION, classId: 3 },
  20. { name: ContentDirectoryKnownClasses.JOYSTREAMMEDIALOCATION, classId: 4 },
  21. { name: ContentDirectoryKnownClasses.KNOWNLICENSE, classId: 5 },
  22. { name: ContentDirectoryKnownClasses.LANGUAGE, classId: 6 },
  23. { name: ContentDirectoryKnownClasses.USERDEFINEDLICENSE, classId: 9 },
  24. { name: ContentDirectoryKnownClasses.VIDEO, classId: 10 },
  25. { name: ContentDirectoryKnownClasses.VIDEOMEDIA, classId: 11 },
  26. { name: ContentDirectoryKnownClasses.VIDEOMEDIAENCODING, classId: 12 },
  27. ]
  28. export const CategoryPropertyNamesWithId: IPropertyIdWithName = {
  29. 0: 'name',
  30. 1: 'description',
  31. }
  32. export const channelPropertyNamesWithId: IPropertyIdWithName = {
  33. 0: 'title',
  34. 1: 'description',
  35. 2: 'coverPhotoURL',
  36. 3: 'avatarPhotoURL',
  37. 4: 'isPublic',
  38. 5: 'isCurated',
  39. 6: 'language',
  40. }
  41. export const knownLicensePropertyNamesWIthId: IPropertyIdWithName = {
  42. 0: 'code',
  43. 1: 'name',
  44. 2: 'description',
  45. 3: 'url',
  46. }
  47. export const languagePropertyNamesWIthId: IPropertyIdWithName = {
  48. 0: 'name',
  49. 1: 'code',
  50. }
  51. export const userDefinedLicensePropertyNamesWithId: IPropertyIdWithName = {
  52. 0: 'content',
  53. }
  54. export const joystreamMediaLocationPropertyNamesWithId: IPropertyIdWithName = {
  55. 0: 'dataObjectId',
  56. }
  57. export const httpMediaLocationPropertyNamesWithId: IPropertyIdWithName = {
  58. 0: 'url',
  59. 1: 'port',
  60. }
  61. export const videoMediaEncodingPropertyNamesWithId: IPropertyIdWithName = {
  62. 0: 'name',
  63. }
  64. export const videoMediaPropertyNamesWithId: IPropertyIdWithName = {
  65. 0: 'encoding',
  66. 1: 'pixelWidth',
  67. 2: 'pixelHeight',
  68. 3: 'size',
  69. 4: 'location',
  70. }
  71. export const videoPropertyNamesWithId: IPropertyIdWithName = {
  72. // referenced entity's id
  73. 0: 'channel',
  74. // referenced entity's id
  75. 1: 'category',
  76. 2: 'title',
  77. 3: 'description',
  78. 4: 'duration',
  79. 5: 'skippableIntroDuration',
  80. 6: 'thumbnailURL',
  81. 7: 'language',
  82. // referenced entity's id
  83. 8: 'media',
  84. 9: 'hasMarketing',
  85. 10: 'publishedBeforeJoystream',
  86. 11: 'isPublic',
  87. 12: 'isExplicit',
  88. 13: 'license',
  89. 14: 'isCurated',
  90. }