data.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. auth: false,
  77. description: "Log the user in",
  78. requestBody: [
  79. {
  80. name: "email",
  81. type: "String",
  82. desc: "User email address"
  83. },
  84. {
  85. name: "pass",
  86. type: "String",
  87. desc: "User password"
  88. }
  89. ],
  90. responseBody: [{
  91. name: "N/A",
  92. type: "User",
  93. desc: "User object"
  94. }]
  95. },
  96. {
  97. type: "route",
  98. id: "logoutUser",
  99. title: "Log Out",
  100. url: "GET /user/logout",
  101. auth: false,
  102. description: "Log the user out of this device",
  103. responseBody: [{
  104. name: "success",
  105. type: "true",
  106. desc: "Always {success: true} if no error"
  107. }]
  108. }
  109. ]