Advertisement
Guest User

Untitled

a guest
Aug 30th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. /**
  2. * @todo range and string regex validations
  3. */
  4.  
  5. const string_required_null = {
  6. required: true,
  7. type: 'string',
  8. default: null,
  9. };
  10.  
  11. const string_not_required_null = {
  12. required: false,
  13. type: 'string',
  14. default: null,
  15. };
  16.  
  17. const boolean_not_required_false = {
  18. required: false,
  19. type: 'boolean',
  20. default: false,
  21. };
  22.  
  23. const number_required_null = {
  24. required: true,
  25. type: 'number',
  26. default: null,
  27. };
  28.  
  29. module.exports = {
  30. COMMENT_ADD: {
  31. user_key: string_required_null,
  32. application_key: string_required_null,
  33. movie_id: number_required_null,
  34. comment_text: string_required_null,
  35. },
  36. COMMENT_DELETE: {
  37. user_key: string_required_null,
  38. application_key: string_required_null,
  39. comment_id: number_required_null,
  40. },
  41. COMMENT_LIKE: {
  42. user_key: string_required_null,
  43. application_key: string_required_null,
  44. comment_id: number_required_null,
  45. },
  46. COMMENT_REPORT: {
  47. user_key: string_required_null,
  48. application_key: string_required_null,
  49. comment_id: number_required_null,
  50. },
  51. LIKE_MOVIE: {
  52. user_key: string_required_null,
  53. application_key: string_required_null,
  54. movie_id: number_required_null,
  55. },
  56. LIST_MOVIES: {
  57. limit: {
  58. required: false,
  59. type: 'number',
  60. default: 20,
  61. },
  62. page: {
  63. required: false,
  64. type: 'number',
  65. default: 1,
  66. },
  67. quality: {
  68. required: false,
  69. type: 'string',
  70. default: 'all',
  71. },
  72. minimum_rating: {
  73. required: false,
  74. type: 'number',
  75. default: 0,
  76. },
  77. query_term: {
  78. required: false,
  79. type: 'number',
  80. default: 0,
  81. },
  82. genre: {
  83. required: false,
  84. type: 'string',
  85. default: 'all',
  86. },
  87. sort_by: {
  88. required: false,
  89. type: 'string',
  90. default: 'date_added',
  91. },
  92. order_by: {
  93. required: false,
  94. type: 'string',
  95. default: 'desc',
  96. },
  97. with_rt_ratings: boolean_not_required_false,
  98. },
  99. MOVIE_BOOKMARK_ADD: {
  100. user_key: string_required_null,
  101. application_key: string_required_null,
  102. movie_id: number_required_null,
  103. },
  104. MOVIE_BOOKMARK_DELETE: {
  105. user_key: string_required_null,
  106. application_key: string_required_null,
  107. movie_id: number_required_null,
  108. },
  109. MOVIE_BOOKMARK_GET: {
  110. user_key: string_required_null,
  111. with_rt_ratings: boolean_not_required_false,
  112. },
  113. MOVIE_COMMENTS: {
  114. movie_id: number_required_null,
  115. },
  116. MOVIE_DETAILS: {
  117. movie_id: number_required_null,
  118. with_images: boolean_not_required_false,
  119. with_cast: boolean_not_required_false,
  120. },
  121. MOVIE_PARENTAL_GUIDES: {
  122. movie_id: number_required_null,
  123. },
  124. MOVIE_REVIEWS: {
  125. movie_id: number_required_null,
  126. },
  127. MOVIE_SUGGESTIONS: {
  128. movie_id: number_required_null,
  129. },
  130. REQUEST_MAKE: {
  131. user_key: string_required_null,
  132. application_key: string_required_null,
  133. movie_title: string_required_null,
  134. request_message: string_not_required_null,
  135. },
  136. USER_DETAILS: {
  137. user_id: number_required_null,
  138. with_recently_downloaded: boolean_not_required_false,
  139. },
  140. USER_FORGOT_PASSWORD: {
  141. application_key: string_required_null,
  142. email: string_required_null,
  143. },
  144. USER_KEY: {
  145. application_key: string_required_null,
  146. username: string_required_null,
  147. password: string_required_null,
  148. },
  149. USER_PROFILE: {
  150. user_key: string_required_null,
  151. },
  152. USER_REGISTER: {
  153. application_key: string_required_null,
  154. username: string_required_null,
  155. password: string_required_null,
  156. email: string_required_null,
  157. },
  158. USER_RESET_PASSWORD: {
  159. application_key: string_required_null,
  160. reset_code: string_required_null,
  161. new_password: string_required_null,
  162. },
  163. /**
  164. * @todo add avatar_image parameter of type image
  165. * */
  166. USER_SETTINGS_EDIT: {
  167. user_key: string_required_null,
  168. application_key: string_required_null,
  169. new_password: string_not_required_null,
  170. about_text: string_not_required_null,
  171. },
  172. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement