data.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: "workouts",
  21. type: [Object],
  22. desc: "List of workouts. Includes name of the workout and list of exercises"
  23. },
  24. {
  25. name: "workouts.name",
  26. type: "String",
  27. desc: "Name of the workout"
  28. },
  29. {
  30. name: "workouts.exercises",
  31. type: "[String]",
  32. desc: "List of strings, each one being the name of an exercise"
  33. }
  34. ]
  35. },
  36. {
  37. type: "route",
  38. id: "createUser",
  39. title: "Create",
  40. url: "POST /user",
  41. auth: false,
  42. description: "Create a new user",
  43. requestBody: [
  44. {
  45. name: "name",
  46. type: "String",
  47. desc: "User name"
  48. },
  49. {
  50. name: "email",
  51. type: "String",
  52. desc: "User email address"
  53. },
  54. {
  55. name: "pass",
  56. type: "String",
  57. desc: "User password"
  58. },
  59. {
  60. name: "confirmPass",
  61. type: "String",
  62. desc: "Confirmation password"
  63. }
  64. ],
  65. responseBody: [{
  66. name: "success",
  67. type: "true",
  68. desc: "Always '{success: true} if no error'"
  69. }]
  70. },
  71. {
  72. type: "route",
  73. id: "loginUser",
  74. title: "Log In",
  75. url: "PUT /user/login",
  76. description: "Log the user in",
  77. requestBody: [
  78. {
  79. name: "email",
  80. type: "String",
  81. desc: "User email address"
  82. },
  83. {
  84. name: "pass",
  85. type: "String",
  86. desc: "User password"
  87. }
  88. ],
  89. responseBody: [{
  90. name: "N/A",
  91. type: "User",
  92. desc: "User object"
  93. }]
  94. }
  95. ]