data.js 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  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: "object",
  220. title: "Session",
  221. id: "session",
  222. auth: false,
  223. description: "An instance of a workout",
  224. properties: [
  225. {
  226. name: "id",
  227. type: "String",
  228. desc: "Unique ID of the session"
  229. },
  230. {
  231. name: "start",
  232. type: "Date",
  233. desc: "Date/Time when session started"
  234. },
  235. {
  236. name: "end",
  237. type: "Date",
  238. desc: "Date/Time when session finished"
  239. },
  240. {
  241. name: "exercises",
  242. type: "[Object]",
  243. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  244. }
  245. ]
  246. },
  247. {
  248. type: "route",
  249. id: "createSession",
  250. title: "Create",
  251. url: "POST /session",
  252. auth: true,
  253. description: "Create a new workout session",
  254. requestBody: [
  255. {
  256. name: "workout",
  257. type: "String",
  258. desc: "ID of the workout this is part of"
  259. },
  260. {
  261. name: "start",
  262. type: "Date",
  263. desc: "Date/Time of session start"
  264. },
  265. {
  266. name: "end",
  267. type: "Date",
  268. desc: "Date/Time of session end"
  269. },
  270. {
  271. name: "exercises",
  272. type: "[Object]",
  273. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  274. }
  275. ],
  276. responeBody: [{
  277. name: "N/A",
  278. type: "Session",
  279. desc: "Session object"
  280. }]
  281. },
  282. {
  283. type: "route",
  284. id: "getSessions",
  285. title: "Get",
  286. url: "GET /session/:workoutId",
  287. auth: true,
  288. description: "Retrieve the previous 5 sessions recorded for a specific workout",
  289. responseBody: [{
  290. name: "N/A",
  291. type: "[Session]",
  292. desc: "List of Session objects"
  293. }]
  294. }
  295. ]