data.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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: "object",
  195. title: "Session",
  196. id: "session",
  197. auth: false,
  198. description: "An instance of a workout",
  199. properties: [
  200. {
  201. name: "id",
  202. type: "String",
  203. desc: "Unique ID of the session"
  204. },
  205. {
  206. name: "start",
  207. type: "Date",
  208. desc: "Date/Time when session started"
  209. },
  210. {
  211. name: "end",
  212. type: "Date",
  213. desc: "Date/Time when session finished"
  214. },
  215. {
  216. name: "exercises",
  217. type: "[Object]",
  218. desc: "List of flexible objects. Structure of each object based on the type of exercise"
  219. }
  220. ]
  221. },
  222. {
  223. type: "route",
  224. id: "createSession",
  225. title: "Create",
  226. url: "POST /session",
  227. auth: true,
  228. description: "Create a new workout session",
  229. requestBody: [
  230. {
  231. name: "workout",
  232. type: "String",
  233. desc: "ID of the workout this is part of"
  234. },
  235. {
  236. name: "start",
  237. type: "Date",
  238. desc: "Date/Time of session start"
  239. },
  240. {
  241. name: "end",
  242. type: "Date",
  243. desc: "Date/Time of session end"
  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. {
  258. type: "route",
  259. id: "getSessions",
  260. title: "Get",
  261. url: "GET /session/:workoutId",
  262. auth: true,
  263. description: "Retrieve the previous 5 sessions recorded for a specific workout",
  264. responseBody: [{
  265. name: "N/A",
  266. type: "[Session]",
  267. desc: "List of Session objects"
  268. }]
  269. }
  270. ]