data.js 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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>, type: <ExerciseType>}"
  229. }],
  230. responseBody: [{
  231. name: "N/A",
  232. type: "Workout",
  233. desc: "Workout object"
  234. }]
  235. },
  236. {
  237. type: "route",
  238. id: "deleteWorkout",
  239. title: "Delete",
  240. url: "DELETE /workout/:workoutId",
  241. auth: true,
  242. description: "Delete a workout and all sessions associated with the workout",
  243. responseBody: [{
  244. name: "success",
  245. type: "true",
  246. desc: "Always '{success: true}' if no error"
  247. }]
  248. },
  249. {
  250. type: "object",
  251. title: "Session",
  252. id: "session",
  253. auth: false,
  254. description: "An instance of a workout",
  255. properties: [
  256. {
  257. name: "id",
  258. type: "String",
  259. desc: "Unique ID of the session"
  260. },
  261. {
  262. name: "start",
  263. type: "Date",
  264. desc: "Date/Time when session started"
  265. },
  266. {
  267. name: "end",
  268. type: "Date",
  269. desc: "Date/Time when session finished"
  270. },
  271. {
  272. name: "exercises",
  273. type: "[Object]",
  274. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  275. }
  276. ]
  277. },
  278. {
  279. type: "route",
  280. id: "createSession",
  281. title: "Create",
  282. url: "POST /session",
  283. auth: true,
  284. description: "Create a new workout session",
  285. requestBody: [
  286. {
  287. name: "workout",
  288. type: "String",
  289. desc: "ID of the workout this is part of"
  290. },
  291. {
  292. name: "start",
  293. type: "Date",
  294. desc: "Date/Time of session start"
  295. },
  296. {
  297. name: "end",
  298. type: "Date",
  299. desc: "Date/Time of session end"
  300. },
  301. {
  302. name: "exercises",
  303. type: "[Object]",
  304. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  305. }
  306. ],
  307. responeBody: [{
  308. name: "N/A",
  309. type: "Session",
  310. desc: "Session object"
  311. }]
  312. },
  313. {
  314. type: "route",
  315. id: "getSessions",
  316. title: "Get",
  317. url: "GET /session/:workoutId",
  318. auth: true,
  319. description: "Retrieve the previous 5 sessions recorded for a specific workout",
  320. responseBody: [{
  321. name: "N/A",
  322. type: "[Session]",
  323. desc: "List of Session objects"
  324. }]
  325. }
  326. ]