data.js 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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.notes",
  128. type: "String",
  129. desc: "User created notes for the exercise"
  130. },
  131. {
  132. name: "exercises.type",
  133. type: "String",
  134. desc: "Enum describing what type of exercise it is",
  135. options: ["weights"]
  136. }
  137. ]
  138. },
  139. {
  140. type: "route",
  141. id: "createWorkout",
  142. title: "Create",
  143. url: "POST /workout",
  144. auth: true,
  145. description: "Create a new workout for a user",
  146. requestBody: [
  147. {
  148. name: "name",
  149. type: "String",
  150. desc: "Name of the workout"
  151. },
  152. {
  153. name: "exercises",
  154. type: "[Object]",
  155. desc: "List of all exercises for the workout. Contains a name and an enum 'type'"
  156. },
  157. {
  158. name: "exercises.name",
  159. type: "String",
  160. desc: "Name of the exercise"
  161. },
  162. {
  163. name: "exercises.notes",
  164. type: "String (optional)",
  165. desc: "User created notes for the exercise"
  166. },
  167. {
  168. name: "exercises.type",
  169. type: "String",
  170. desc: "Enum describing what type of exercise it is",
  171. options: ["weights"]
  172. }
  173. ],
  174. responseBody: [{
  175. name: "N/A",
  176. type: "Workout",
  177. desc: "Workout object"
  178. }]
  179. },
  180. {
  181. type: "route",
  182. id: "getWorkouts",
  183. title: "Get",
  184. url: "GET /workout",
  185. auth: true,
  186. description: "Retrieve all of the workouts for logged in user",
  187. responseBody: [{
  188. name: "N/A",
  189. type: "[Workout]",
  190. desc: "List of workouts for the logged in user"
  191. }]
  192. },
  193. {
  194. type: "route",
  195. id: "updateWorkoutNote",
  196. title: "Update Note",
  197. url: "PUT /workout/:workoutId/note",
  198. auth: true,
  199. description: "Create a note for a specific exercise",
  200. requestBody: [
  201. {
  202. name: "exercise",
  203. type: "String",
  204. desc: "ID of the exercise to update the note for"
  205. },
  206. {
  207. name: "note",
  208. type: "String",
  209. desc: "User created note for exercise"
  210. }
  211. ],
  212. responseBody: [{
  213. name: "N/A",
  214. type: "Workout",
  215. desc: "Workout object"
  216. }]
  217. },
  218. {
  219. type: "route",
  220. id: "updateWorkout",
  221. title: "Update",
  222. url: "PUT /workout/:workoutId",
  223. auth: true,
  224. description: "Update a workout. Specifically the exercises in the workout",
  225. requestBody: [{
  226. name: "existingExercises",
  227. type: "[Object]",
  228. desc: "List of exercises in order. Existing exercises should be {id: <ExerciseId>} and new exercises should be {new: <ExerciseName>}"
  229. }],
  230. responseBody: [{
  231. name: "N/A",
  232. type: "Workout",
  233. desc: "Workout object"
  234. }]
  235. },
  236. {
  237. type: "object",
  238. title: "Session",
  239. id: "session",
  240. auth: false,
  241. description: "An instance of a workout",
  242. properties: [
  243. {
  244. name: "id",
  245. type: "String",
  246. desc: "Unique ID of the session"
  247. },
  248. {
  249. name: "start",
  250. type: "Date",
  251. desc: "Date/Time when session started"
  252. },
  253. {
  254. name: "end",
  255. type: "Date",
  256. desc: "Date/Time when session finished"
  257. },
  258. {
  259. name: "exercises",
  260. type: "[Object]",
  261. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  262. }
  263. ]
  264. },
  265. {
  266. type: "route",
  267. id: "createSession",
  268. title: "Create",
  269. url: "POST /session",
  270. auth: true,
  271. description: "Create a new workout session",
  272. requestBody: [
  273. {
  274. name: "workout",
  275. type: "String",
  276. desc: "ID of the workout this is part of"
  277. },
  278. {
  279. name: "start",
  280. type: "Date",
  281. desc: "Date/Time of session start"
  282. },
  283. {
  284. name: "end",
  285. type: "Date",
  286. desc: "Date/Time of session end"
  287. },
  288. {
  289. name: "exercises",
  290. type: "[Object]",
  291. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  292. }
  293. ],
  294. responeBody: [{
  295. name: "N/A",
  296. type: "Session",
  297. desc: "Session object"
  298. }]
  299. },
  300. {
  301. type: "route",
  302. id: "getSessions",
  303. title: "Get",
  304. url: "GET /session/:workoutId",
  305. auth: true,
  306. description: "Retrieve the previous 5 sessions recorded for a specific workout",
  307. responseBody: [{
  308. name: "N/A",
  309. type: "[Session]",
  310. desc: "List of Session objects"
  311. }]
  312. }
  313. ]