content-dir-consts.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import { 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. }
  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: IPropertyWithId = {
  33. 0: { name: 'name', type: 'string', required: true },
  34. 1: { name: 'description', type: 'string', required: false },
  35. }
  36. export const channelPropertyNamesWithId: IPropertyWithId = {
  37. 0: { name: 'handle', type: 'string', required: true },
  38. 1: { name: 'description', type: 'string', required: false },
  39. 2: { name: 'coverPhotoUrl', type: 'string', required: false },
  40. 3: { name: 'avatarPhotoUrl', type: 'string', required: false },
  41. 4: { name: 'isPublic', type: 'boolean', required: true },
  42. 5: { name: 'isCurated', type: 'boolean', required: false },
  43. 6: { name: 'language', type: 'number', required: false },
  44. }
  45. export const licensePropertyNamesWithId: IPropertyWithId = {
  46. 0: { name: 'knownLicense', type: 'number', required: false },
  47. 1: { name: 'userDefinedLicense', type: 'number', required: false },
  48. 2: { name: 'attribution', type: 'string', required: false },
  49. }
  50. export const knownLicensePropertyNamesWIthId: IPropertyWithId = {
  51. 0: { name: 'code', type: 'string', required: true },
  52. 1: { name: 'name', type: 'string', required: false },
  53. 2: { name: 'description', type: 'string', required: false },
  54. 3: { name: 'url', type: 'string', required: false },
  55. }
  56. export const languagePropertyNamesWIthId: IPropertyWithId = {
  57. 0: { name: 'name', type: 'string', required: true },
  58. 1: { name: 'code', type: 'string', required: true },
  59. }
  60. export const userDefinedLicensePropertyNamesWithId: IPropertyWithId = {
  61. 0: { name: 'content', type: 'string', required: false },
  62. }
  63. export const mediaLocationPropertyNamesWithId: IPropertyWithId = {
  64. 0: { name: 'httpMediaLocation', type: 'number', required: false },
  65. 1: { name: 'joystreamMediaLocation', type: 'number', required: false },
  66. }
  67. export const joystreamMediaLocationPropertyNamesWithId: IPropertyWithId = {
  68. 0: { name: 'dataObjectId', type: 'string', required: true },
  69. }
  70. export const httpMediaLocationPropertyNamesWithId: IPropertyWithId = {
  71. 0: { name: 'url', type: 'string', required: false },
  72. 1: { name: 'port', type: 'number', required: false },
  73. }
  74. export const videoMediaEncodingPropertyNamesWithId: IPropertyWithId = {
  75. 0: { name: 'name', type: 'string', required: true },
  76. }
  77. export const videoMediaPropertyNamesWithId: IPropertyWithId = {
  78. 0: { name: 'encoding', type: 'number', required: true },
  79. 1: { name: 'pixelWidth', type: 'number', required: true },
  80. 2: { name: 'pixelHeight', type: 'number', required: true },
  81. 3: { name: 'size', type: 'number', required: false },
  82. 4: { name: 'location', type: 'number', required: true },
  83. }
  84. export const videoPropertyNamesWithId: IPropertyWithId = {
  85. // referenced entity's id
  86. 0: { name: 'channel', type: 'number', required: true },
  87. // referenced entity's id
  88. 1: { name: 'category', type: 'number', required: true },
  89. 2: { name: 'title', type: 'string', required: false },
  90. 3: { name: 'description', type: 'string', required: false },
  91. 4: { name: 'duration', type: 'number', required: true },
  92. 5: { name: 'skippableIntroDuration', type: 'number', required: false },
  93. 6: { name: 'thumbnailUrl', type: 'string', required: true },
  94. 7: { name: 'language', type: 'number', required: false },
  95. // referenced entity's id
  96. 8: { name: 'media', type: 'number', required: true },
  97. 9: { name: 'hasMarketing', type: 'boolean', required: false },
  98. 10: { name: 'publishedBeforeJoystream', type: 'number', required: false },
  99. 11: { name: 'isPublic', type: 'boolean', required: true },
  100. 12: { name: 'isExplicit', type: 'boolean', required: true },
  101. 13: { name: 'license', type: 'number', required: true },
  102. 14: { name: 'isCurated', type: 'boolean', required: true },
  103. }