data.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. window.data = [
  2. {
  3. type: "object",
  4. title: "User",
  5. id: "user",
  6. auth: false,
  7. description: "User object",
  8. properties: [
  9. {
  10. name: "id",
  11. type: "String",
  12. desc: "Unique user ID"
  13. },
  14. {
  15. name: "name",
  16. type: "String",
  17. desc: "User name"
  18. },
  19. {
  20. name: "email",
  21. type: "String",
  22. desc: "User email address"
  23. }
  24. ]
  25. },
  26. {
  27. type: "route",
  28. id: "createUser",
  29. title: "Create",
  30. url: "POST /user",
  31. auth: false,
  32. description: "Create a new user",
  33. requestBody: [
  34. {
  35. name: "name",
  36. type: "String",
  37. desc: "User name"
  38. },
  39. {
  40. name: "email",
  41. type: "String",
  42. desc: "User email address"
  43. },
  44. {
  45. name: "pass",
  46. type: "String",
  47. desc: "User password"
  48. },
  49. {
  50. name: "confirmPass",
  51. type: "String",
  52. desc: "Confirmation password"
  53. }
  54. ],
  55. responseBody: [{
  56. name: "success",
  57. type: "true",
  58. desc: "Always '{success: true} if no error'"
  59. }]
  60. },
  61. {
  62. type: "route",
  63. id: "loginUser",
  64. title: "Log In",
  65. url: "PUT /user/login",
  66. auth: false,
  67. description: "Log the user in",
  68. requestBody: [
  69. {
  70. name: "email",
  71. type: "String",
  72. desc: "User email address"
  73. },
  74. {
  75. name: "pass",
  76. type: "String",
  77. desc: "User password"
  78. }
  79. ],
  80. responseBody: [{
  81. name: "N/A",
  82. type: "User",
  83. desc: "User object"
  84. }]
  85. },
  86. {
  87. type: "route",
  88. id: "logoutUser",
  89. title: "Log Out",
  90. url: "GET /user/logout",
  91. auth: false,
  92. description: "Log the user out of this device",
  93. responseBody: [{
  94. name: "success",
  95. type: "true",
  96. desc: "Always {success: true} if no error"
  97. }]
  98. },
  99. {
  100. type: "object",
  101. title: "Workout",
  102. id: "workout",
  103. auth: false,
  104. description: "A workout plan that the user creates",
  105. properties: [
  106. {
  107. name: "id",
  108. type: "String",
  109. desc: "Unique ID of the workout"
  110. },
  111. {
  112. name: "exercises",
  113. type: "[Object]",
  114. desc: "A list of all exercises for this workout. Contains a name and an enum 'type'"
  115. },
  116. {
  117. name: "exercises.id",
  118. type: "String",
  119. desc: "Unique ID of the exercise"
  120. },
  121. {
  122. name: "exercises.name",
  123. type: "String",
  124. desc: "User given name of the exercise"
  125. },
  126. {
  127. name: "exercises.type",
  128. type: "String",
  129. desc: "Enum describing what type of exercise it is",
  130. options: ["weights"]
  131. }
  132. ]
  133. },
  134. {
  135. type: "route",
  136. id: "createWorkout",
  137. title: "Create",
  138. url: "POST /workout",
  139. auth: true,
  140. description: "Create a new workout for a user",
  141. requestBody: [
  142. {
  143. name: "name",
  144. type: "String",
  145. desc: "Name of the workout"
  146. },
  147. {
  148. name: "exercises",
  149. type: "[Object]",
  150. desc: "List of all exercises for the workout. Contains a name and an enum 'type'"
  151. },
  152. {
  153. name: "exercises.name",
  154. type: "String",
  155. desc: "Name of the exercise"
  156. },
  157. {
  158. name: "exercises.type",
  159. type: "String",
  160. desc: "Enum describing what type of exercise it is",
  161. options: ["weights"]
  162. }
  163. ],
  164. responseBody: [{
  165. name: "N/A",
  166. type: "Workout",
  167. desc: "Workout object"
  168. }]
  169. },
  170. {
  171. type: "route",
  172. id: "getWorkouts",
  173. title: "Get",
  174. url: "GET /workout",
  175. auth: true,
  176. description: "Retrieve all of the workouts for logged in user",
  177. responseBody: [{
  178. name: "N/A",
  179. type: "[Workout]",
  180. desc: "List of workouts for the logged in user"
  181. }]
  182. },
  183. {
  184. type: "object",
  185. title: "Session",
  186. id: "session",
  187. auth: false,
  188. description: "An instance of a workout",
  189. properties: [
  190. {
  191. name: "id",
  192. type: "String",
  193. desc: "Unique ID of the session"
  194. },
  195. {
  196. name: "start",
  197. type: "Date",
  198. desc: "Date/Time when session started"
  199. },
  200. {
  201. name: "end",
  202. type: "Date",
  203. desc: "Date/Time when session finished"
  204. },
  205. {
  206. name: "notes",
  207. type: "String",
  208. desc: "Notes from the user about the session"
  209. },
  210. {
  211. name: "exercises",
  212. type: "[Object]",
  213. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  214. }
  215. ]
  216. },
  217. {
  218. type: "route",
  219. id: "createSession",
  220. title: "Create",
  221. url: "POST /session",
  222. auth: true,
  223. description: "Create a new workout session",
  224. requestBody: [
  225. {
  226. name: "workout",
  227. type: "String",
  228. desc: "ID of the workout this is part of"
  229. },
  230. {
  231. name: "start",
  232. type: "Date",
  233. desc: "Date/Time of session start"
  234. },
  235. {
  236. name: "end",
  237. type: "Date",
  238. desc: "Date/Time of session end"
  239. },
  240. {
  241. name: "notes",
  242. type: "String, (optional)",
  243. desc: "Any notes from user about the session"
  244. },
  245. {
  246. name: "exercises",
  247. type: "[Object]",
  248. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  249. }
  250. ],
  251. responeBody: [{
  252. name: "N/A",
  253. type: "Session",
  254. desc: "Session object"
  255. }]
  256. }
  257. ]