sidechat.js 2.5.5 → 2.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/classes/SidechatAPIClient.d.ts +9 -1
  2. package/dist/classes/SidechatAPIClient.d.ts.map +1 -1
  3. package/dist/index.cjs +33 -5
  4. package/dist/index.mjs +33 -5
  5. package/docs/sidechat.js/2.5.6/SidechatAPIClient.html +3 -0
  6. package/docs/sidechat.js/2.5.6/SidechatAPIError.html +3 -0
  7. package/docs/sidechat.js/2.5.6/SidechatColorList.html +3 -0
  8. package/docs/sidechat.js/{2.4.6 → 2.5.6}/classes_SidechatAPIClient.js.html +181 -11
  9. package/docs/sidechat.js/2.5.6/classes_SidechatAPIError.js.html +16 -0
  10. package/docs/sidechat.js/2.5.6/classes_SidechatColorList.js.html +79 -0
  11. package/docs/sidechat.js/2.5.6/data/search.json +1 -0
  12. package/docs/sidechat.js/2.5.6/global.html +3 -0
  13. package/docs/sidechat.js/2.5.6/index.html +4 -0
  14. package/docs/sidechat.js/2.5.6/tutorial-Authentication.html +14 -0
  15. package/docs/sidechat.js/2.5.6/tutorial-Email Registration.html +6 -0
  16. package/docs/sidechat.js/{2.4.6 → 2.5.6}/types_SidechatTypes.js.html +23 -3
  17. package/jsdoc.json +10 -0
  18. package/package.json +2 -2
  19. package/src/classes/SidechatAPIClient.js +33 -5
  20. package/docs/sidechat.js/1.0.0/data/search.json +0 -1
  21. package/docs/sidechat.js/1.0.0/global.html +0 -3
  22. package/docs/sidechat.js/1.0.0/index.html +0 -4
  23. package/docs/sidechat.js/1.0.0/index.js.html +0 -363
  24. package/docs/sidechat.js/1.0.0/scripts/core.js +0 -702
  25. package/docs/sidechat.js/1.0.0/scripts/core.min.js +0 -23
  26. package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-base.css +0 -975
  27. package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-dark.css +0 -407
  28. package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-light.css +0 -388
  29. package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme.min.css +0 -1
  30. package/docs/sidechat.js/1.0.0/types_SidechatTypes.js.html +0 -82
  31. package/docs/sidechat.js/2.0.0-alpha.0/SidechatAPIClient.html +0 -3
  32. package/docs/sidechat.js/2.0.0-alpha.0/SidechatAPIError.html +0 -3
  33. package/docs/sidechat.js/2.0.0-alpha.0/classes_SidechatAPIClient.js.html +0 -418
  34. package/docs/sidechat.js/2.0.0-alpha.0/classes_SidechatAPIError.js.html +0 -16
  35. package/docs/sidechat.js/2.0.0-alpha.0/data/search.json +0 -1
  36. package/docs/sidechat.js/2.0.0-alpha.0/fonts/Inconsolata-Regular.ttf +0 -0
  37. package/docs/sidechat.js/2.0.0-alpha.0/fonts/OpenSans-Regular.ttf +0 -0
  38. package/docs/sidechat.js/2.0.0-alpha.0/fonts/WorkSans-Bold.ttf +0 -0
  39. package/docs/sidechat.js/2.0.0-alpha.0/global.html +0 -3
  40. package/docs/sidechat.js/2.0.0-alpha.0/index.html +0 -4
  41. package/docs/sidechat.js/2.0.0-alpha.0/scripts/core.js +0 -702
  42. package/docs/sidechat.js/2.0.0-alpha.0/scripts/core.min.js +0 -23
  43. package/docs/sidechat.js/2.0.0-alpha.0/scripts/resize.js +0 -90
  44. package/docs/sidechat.js/2.0.0-alpha.0/scripts/search.js +0 -265
  45. package/docs/sidechat.js/2.0.0-alpha.0/scripts/search.min.js +0 -6
  46. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/Apache-License-2.0.txt +0 -202
  47. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/fuse.js +0 -9
  48. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/hljs-line-num-original.js +0 -369
  49. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/hljs-line-num.js +0 -1
  50. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/hljs-original.js +0 -5171
  51. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/hljs.js +0 -1
  52. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/popper.js +0 -5
  53. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/tippy.js +0 -1
  54. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/tocbot.js +0 -672
  55. package/docs/sidechat.js/2.0.0-alpha.0/scripts/third-party/tocbot.min.js +0 -1
  56. package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-base.css +0 -975
  57. package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-dark.css +0 -407
  58. package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-light.css +0 -388
  59. package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme.min.css +0 -1
  60. package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Authentication.html +0 -13
  61. package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Email Registration.html +0 -6
  62. package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Email Verification.html +0 -6
  63. package/docs/sidechat.js/2.0.0-alpha.0/types_SidechatTypes.js.html +0 -98
  64. package/docs/sidechat.js/2.4.0/SidechatAPIClient.html +0 -3
  65. package/docs/sidechat.js/2.4.0/SidechatAPIError.html +0 -3
  66. package/docs/sidechat.js/2.4.0/SidechatColorList.html +0 -3
  67. package/docs/sidechat.js/2.4.0/classes_SidechatAPIClient.js.html +0 -956
  68. package/docs/sidechat.js/2.4.0/classes_SidechatAPIError.js.html +0 -16
  69. package/docs/sidechat.js/2.4.0/classes_SidechatColorList.js.html +0 -79
  70. package/docs/sidechat.js/2.4.0/data/search.json +0 -1
  71. package/docs/sidechat.js/2.4.0/fonts/Inconsolata-Regular.ttf +0 -0
  72. package/docs/sidechat.js/2.4.0/fonts/OpenSans-Regular.ttf +0 -0
  73. package/docs/sidechat.js/2.4.0/fonts/WorkSans-Bold.ttf +0 -0
  74. package/docs/sidechat.js/2.4.0/global.html +0 -3
  75. package/docs/sidechat.js/2.4.0/index.html +0 -4
  76. package/docs/sidechat.js/2.4.0/scripts/core.js +0 -702
  77. package/docs/sidechat.js/2.4.0/scripts/core.min.js +0 -23
  78. package/docs/sidechat.js/2.4.0/scripts/resize.js +0 -90
  79. package/docs/sidechat.js/2.4.0/scripts/search.js +0 -265
  80. package/docs/sidechat.js/2.4.0/scripts/search.min.js +0 -6
  81. package/docs/sidechat.js/2.4.0/scripts/third-party/Apache-License-2.0.txt +0 -202
  82. package/docs/sidechat.js/2.4.0/scripts/third-party/fuse.js +0 -9
  83. package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-line-num-original.js +0 -369
  84. package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-line-num.js +0 -1
  85. package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-original.js +0 -5171
  86. package/docs/sidechat.js/2.4.0/scripts/third-party/hljs.js +0 -1
  87. package/docs/sidechat.js/2.4.0/scripts/third-party/popper.js +0 -5
  88. package/docs/sidechat.js/2.4.0/scripts/third-party/tippy.js +0 -1
  89. package/docs/sidechat.js/2.4.0/scripts/third-party/tocbot.js +0 -672
  90. package/docs/sidechat.js/2.4.0/scripts/third-party/tocbot.min.js +0 -1
  91. package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-base.css +0 -975
  92. package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-dark.css +0 -407
  93. package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-light.css +0 -388
  94. package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme.min.css +0 -1
  95. package/docs/sidechat.js/2.4.0/tutorial-Authentication.html +0 -14
  96. package/docs/sidechat.js/2.4.0/tutorial-Email Registration.html +0 -6
  97. package/docs/sidechat.js/2.4.0/types_SidechatTypes.js.html +0 -134
  98. package/docs/sidechat.js/2.4.4/SidechatAPIClient.html +0 -3
  99. package/docs/sidechat.js/2.4.4/SidechatAPIError.html +0 -3
  100. package/docs/sidechat.js/2.4.4/SidechatColorList.html +0 -3
  101. package/docs/sidechat.js/2.4.4/classes_SidechatAPIClient.js.html +0 -1100
  102. package/docs/sidechat.js/2.4.4/classes_SidechatAPIError.js.html +0 -16
  103. package/docs/sidechat.js/2.4.4/classes_SidechatColorList.js.html +0 -79
  104. package/docs/sidechat.js/2.4.4/data/search.json +0 -1
  105. package/docs/sidechat.js/2.4.4/fonts/Inconsolata-Regular.ttf +0 -0
  106. package/docs/sidechat.js/2.4.4/fonts/OpenSans-Regular.ttf +0 -0
  107. package/docs/sidechat.js/2.4.4/fonts/WorkSans-Bold.ttf +0 -0
  108. package/docs/sidechat.js/2.4.4/global.html +0 -3
  109. package/docs/sidechat.js/2.4.4/index.html +0 -4
  110. package/docs/sidechat.js/2.4.4/scripts/core.js +0 -726
  111. package/docs/sidechat.js/2.4.4/scripts/core.min.js +0 -23
  112. package/docs/sidechat.js/2.4.4/scripts/resize.js +0 -90
  113. package/docs/sidechat.js/2.4.4/scripts/search.js +0 -265
  114. package/docs/sidechat.js/2.4.4/scripts/search.min.js +0 -6
  115. package/docs/sidechat.js/2.4.4/scripts/third-party/Apache-License-2.0.txt +0 -202
  116. package/docs/sidechat.js/2.4.4/scripts/third-party/fuse.js +0 -9
  117. package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-line-num-original.js +0 -369
  118. package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-line-num.js +0 -1
  119. package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-original.js +0 -5171
  120. package/docs/sidechat.js/2.4.4/scripts/third-party/hljs.js +0 -1
  121. package/docs/sidechat.js/2.4.4/scripts/third-party/popper.js +0 -5
  122. package/docs/sidechat.js/2.4.4/scripts/third-party/tippy.js +0 -1
  123. package/docs/sidechat.js/2.4.4/scripts/third-party/tocbot.js +0 -672
  124. package/docs/sidechat.js/2.4.4/scripts/third-party/tocbot.min.js +0 -1
  125. package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme-base.css +0 -1161
  126. package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
  127. package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme.min.css +0 -1
  128. package/docs/sidechat.js/2.4.4/tutorial-Authentication.html +0 -14
  129. package/docs/sidechat.js/2.4.4/tutorial-Email Registration.html +0 -6
  130. package/docs/sidechat.js/2.4.4/types_SidechatTypes.js.html +0 -160
  131. package/docs/sidechat.js/2.4.6/SidechatAPIClient.html +0 -3
  132. package/docs/sidechat.js/2.4.6/SidechatAPIError.html +0 -3
  133. package/docs/sidechat.js/2.4.6/SidechatColorList.html +0 -3
  134. package/docs/sidechat.js/2.4.6/classes_SidechatAPIError.js.html +0 -16
  135. package/docs/sidechat.js/2.4.6/classes_SidechatColorList.js.html +0 -79
  136. package/docs/sidechat.js/2.4.6/data/search.json +0 -1
  137. package/docs/sidechat.js/2.4.6/fonts/Inconsolata-Regular.ttf +0 -0
  138. package/docs/sidechat.js/2.4.6/fonts/OpenSans-Regular.ttf +0 -0
  139. package/docs/sidechat.js/2.4.6/fonts/WorkSans-Bold.ttf +0 -0
  140. package/docs/sidechat.js/2.4.6/global.html +0 -3
  141. package/docs/sidechat.js/2.4.6/index.html +0 -4
  142. package/docs/sidechat.js/2.4.6/scripts/core.js +0 -726
  143. package/docs/sidechat.js/2.4.6/scripts/core.min.js +0 -23
  144. package/docs/sidechat.js/2.4.6/scripts/resize.js +0 -90
  145. package/docs/sidechat.js/2.4.6/scripts/search.js +0 -265
  146. package/docs/sidechat.js/2.4.6/scripts/search.min.js +0 -6
  147. package/docs/sidechat.js/2.4.6/scripts/third-party/Apache-License-2.0.txt +0 -202
  148. package/docs/sidechat.js/2.4.6/scripts/third-party/fuse.js +0 -9
  149. package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-line-num-original.js +0 -369
  150. package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-line-num.js +0 -1
  151. package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-original.js +0 -5171
  152. package/docs/sidechat.js/2.4.6/scripts/third-party/hljs.js +0 -1
  153. package/docs/sidechat.js/2.4.6/scripts/third-party/popper.js +0 -5
  154. package/docs/sidechat.js/2.4.6/scripts/third-party/tippy.js +0 -1
  155. package/docs/sidechat.js/2.4.6/scripts/third-party/tocbot.js +0 -672
  156. package/docs/sidechat.js/2.4.6/scripts/third-party/tocbot.min.js +0 -1
  157. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-base.css +0 -1161
  158. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-dark.css +0 -412
  159. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-light.css +0 -482
  160. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-scrollbar.css +0 -30
  161. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
  162. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme.min.css +0 -1
  163. package/docs/sidechat.js/2.4.6/tutorial-Authentication.html +0 -14
  164. package/docs/sidechat.js/2.4.6/tutorial-Email Registration.html +0 -6
  165. package/docs/sidechat.js/2.4.7/SidechatAPIClient.html +0 -3
  166. package/docs/sidechat.js/2.4.7/SidechatAPIError.html +0 -3
  167. package/docs/sidechat.js/2.4.7/SidechatColorList.html +0 -3
  168. package/docs/sidechat.js/2.4.7/classes_SidechatAPIClient.js.html +0 -1099
  169. package/docs/sidechat.js/2.4.7/classes_SidechatAPIError.js.html +0 -16
  170. package/docs/sidechat.js/2.4.7/classes_SidechatColorList.js.html +0 -79
  171. package/docs/sidechat.js/2.4.7/data/search.json +0 -1
  172. package/docs/sidechat.js/2.4.7/fonts/Inconsolata-Regular.ttf +0 -0
  173. package/docs/sidechat.js/2.4.7/fonts/OpenSans-Regular.ttf +0 -0
  174. package/docs/sidechat.js/2.4.7/fonts/WorkSans-Bold.ttf +0 -0
  175. package/docs/sidechat.js/2.4.7/global.html +0 -3
  176. package/docs/sidechat.js/2.4.7/index.html +0 -4
  177. package/docs/sidechat.js/2.4.7/scripts/resize.js +0 -90
  178. package/docs/sidechat.js/2.4.7/scripts/search.js +0 -265
  179. package/docs/sidechat.js/2.4.7/scripts/search.min.js +0 -6
  180. package/docs/sidechat.js/2.4.7/scripts/third-party/Apache-License-2.0.txt +0 -202
  181. package/docs/sidechat.js/2.4.7/scripts/third-party/fuse.js +0 -9
  182. package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-line-num-original.js +0 -369
  183. package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-line-num.js +0 -1
  184. package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-original.js +0 -5171
  185. package/docs/sidechat.js/2.4.7/scripts/third-party/hljs.js +0 -1
  186. package/docs/sidechat.js/2.4.7/scripts/third-party/popper.js +0 -5
  187. package/docs/sidechat.js/2.4.7/scripts/third-party/tippy.js +0 -1
  188. package/docs/sidechat.js/2.4.7/scripts/third-party/tocbot.js +0 -672
  189. package/docs/sidechat.js/2.4.7/scripts/third-party/tocbot.min.js +0 -1
  190. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-dark.css +0 -412
  191. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-light.css +0 -482
  192. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-scrollbar.css +0 -30
  193. package/docs/sidechat.js/2.4.7/tutorial-Authentication.html +0 -14
  194. package/docs/sidechat.js/2.4.7/tutorial-Email Registration.html +0 -6
  195. package/docs/sidechat.js/2.4.7/types_SidechatTypes.js.html +0 -160
  196. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/Inconsolata-Regular.ttf +0 -0
  197. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/OpenSans-Regular.ttf +0 -0
  198. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/WorkSans-Bold.ttf +0 -0
  199. /package/docs/sidechat.js/{2.4.7 → 2.5.6}/scripts/core.js +0 -0
  200. /package/docs/sidechat.js/{2.4.7 → 2.5.6}/scripts/core.min.js +0 -0
  201. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/resize.js +0 -0
  202. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/search.js +0 -0
  203. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/search.min.js +0 -0
  204. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/Apache-License-2.0.txt +0 -0
  205. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/fuse.js +0 -0
  206. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-line-num-original.js +0 -0
  207. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-line-num.js +0 -0
  208. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-original.js +0 -0
  209. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs.js +0 -0
  210. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/popper.js +0 -0
  211. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tippy.js +0 -0
  212. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tocbot.js +0 -0
  213. /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tocbot.min.js +0 -0
  214. /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme-base.css +0 -0
  215. /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-dark.css +0 -0
  216. /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-light.css +0 -0
  217. /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-scrollbar.css +0 -0
  218. /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
  219. /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme.min.css +0 -0
@@ -1,1099 +0,0 @@
1
- <!DOCTYPE html><html lang="en" style="font-size:16px"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Source: classes/SidechatAPIClient.js</title><!--[if lt IE 9]>
2
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
3
- <![endif]--><script src="scripts/third-party/hljs.js" defer="defer"></script><script src="scripts/third-party/hljs-line-num.js" defer="defer"></script><script src="scripts/third-party/popper.js" defer="defer"></script><script src="scripts/third-party/tippy.js" defer="defer"></script><script src="scripts/third-party/tocbot.min.js"></script><script>var baseURL="/",locationPathname="";baseURL=(baseURL=(baseURL="https://micahlindley.com/sidechat.js/").replace(/https?:\/\//i,"")).substr(baseURL.indexOf("/"))</script><link rel="stylesheet" href="styles/clean-jsdoc-theme.min.css"><svg aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none"><defs><symbol id="copy-icon" viewbox="0 0 488.3 488.3"><g><path d="M314.25,85.4h-227c-21.3,0-38.6,17.3-38.6,38.6v325.7c0,21.3,17.3,38.6,38.6,38.6h227c21.3,0,38.6-17.3,38.6-38.6V124 C352.75,102.7,335.45,85.4,314.25,85.4z M325.75,449.6c0,6.4-5.2,11.6-11.6,11.6h-227c-6.4,0-11.6-5.2-11.6-11.6V124 c0-6.4,5.2-11.6,11.6-11.6h227c6.4,0,11.6,5.2,11.6,11.6V449.6z"/><path d="M401.05,0h-227c-21.3,0-38.6,17.3-38.6,38.6c0,7.5,6,13.5,13.5,13.5s13.5-6,13.5-13.5c0-6.4,5.2-11.6,11.6-11.6h227 c6.4,0,11.6,5.2,11.6,11.6v325.7c0,6.4-5.2,11.6-11.6,11.6c-7.5,0-13.5,6-13.5,13.5s6,13.5,13.5,13.5c21.3,0,38.6-17.3,38.6-38.6 V38.6C439.65,17.3,422.35,0,401.05,0z"/></g></symbol><symbol id="search-icon" viewBox="0 0 512 512"><g><g><path d="M225.474,0C101.151,0,0,101.151,0,225.474c0,124.33,101.151,225.474,225.474,225.474 c124.33,0,225.474-101.144,225.474-225.474C450.948,101.151,349.804,0,225.474,0z M225.474,409.323 c-101.373,0-183.848-82.475-183.848-183.848S124.101,41.626,225.474,41.626s183.848,82.475,183.848,183.848 S326.847,409.323,225.474,409.323z"/></g></g><g><g><path d="M505.902,476.472L386.574,357.144c-8.131-8.131-21.299-8.131-29.43,0c-8.131,8.124-8.131,21.306,0,29.43l119.328,119.328 c4.065,4.065,9.387,6.098,14.715,6.098c5.321,0,10.649-2.033,14.715-6.098C514.033,497.778,514.033,484.596,505.902,476.472z"/></g></g></symbol><symbol id="font-size-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11.246 15H4.754l-2 5H.6L7 4h2l6.4 16h-2.154l-2-5zm-.8-2L8 6.885 5.554 13h4.892zM21 12.535V12h2v8h-2v-.535a4 4 0 1 1 0-6.93zM19 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/></symbol><symbol id="add-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"/></symbol><symbol id="minus-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M5 11h14v2H5z"/></symbol><symbol id="dark-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol><symbol id="light-theme-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol><symbol id="reset-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M18.537 19.567A9.961 9.961 0 0 1 12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10c0 2.136-.67 4.116-1.81 5.74L17 12h3a8 8 0 1 0-2.46 5.772l.997 1.795z"/></symbol><symbol id="down-icon" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></symbol><symbol id="codepen-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M16.5 13.202L13 15.535v3.596L19.197 15 16.5 13.202zM14.697 12L12 10.202 9.303 12 12 13.798 14.697 12zM20 10.869L18.303 12 20 13.131V10.87zM19.197 9L13 4.869v3.596l3.5 2.333L19.197 9zM7.5 10.798L11 8.465V4.869L4.803 9 7.5 10.798zM4.803 15L11 19.131v-3.596l-3.5-2.333L4.803 15zM4 13.131L5.697 12 4 10.869v2.262zM2 9a1 1 0 0 1 .445-.832l9-6a1 1 0 0 1 1.11 0l9 6A1 1 0 0 1 22 9v6a1 1 0 0 1-.445.832l-9 6a1 1 0 0 1-1.11 0l-9-6A1 1 0 0 1 2 15V9z"/></symbol><symbol id="close-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"/></symbol><symbol id="menu-icon" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"/></symbol></defs></svg></head><body data-theme="dark"><div class="sidebar-container"><div class="sidebar" id="sidebar"><div class="sidebar-items-container"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-Authentication.html">Authentication</a></div><div class="sidebar-section-children"><a href="tutorial-Email Registration.html">Email Registration</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="SidechatAPIClient.html">SidechatAPIClient</a></div><div class="sidebar-section-children"><a href="SidechatAPIError.html">SidechatAPIError</a></div><div class="sidebar-section-children"><a href="SidechatColorList.html">SidechatColorList</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#SidechatAssetMetadata">SidechatAssetMetadata</a></div><div class="sidebar-section-children"><a href="global.html#SidechatAuthToken">SidechatAuthToken</a></div><div class="sidebar-section-children"><a href="global.html#SidechatColor">SidechatColor</a></div><div class="sidebar-section-children"><a href="global.html#SidechatCurrentUser">SidechatCurrentUser</a></div><div class="sidebar-section-children"><a href="global.html#SidechatCursorString">SidechatCursorString</a></div><div class="sidebar-section-children"><a href="global.html#SidechatDirectMessage">SidechatDirectMessage</a></div><div class="sidebar-section-children"><a href="global.html#SidechatDirectThread">SidechatDirectThread</a></div><div class="sidebar-section-children"><a href="global.html#SidechatGroup">SidechatGroup</a></div><div class="sidebar-section-children"><a href="global.html#SidechatIdentity">SidechatIdentity</a></div><div class="sidebar-section-children"><a href="global.html#SidechatLibraryAsset">SidechatLibraryAsset</a></div><div class="sidebar-section-children"><a href="global.html#SidechatMembership">SidechatMembership</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPostOrComment">SidechatPostOrComment</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPostsAndCursor">SidechatPostsAndCursor</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPrivateAssetURL">SidechatPrivateAssetURL</a></div><div class="sidebar-section-children"><a href="global.html#SidechatSimpleAsset">SidechatSimpleAsset</a></div><div class="sidebar-section-children"><a href="global.html#SidechatVoteString">SidechatVoteString</a></div></div></div></div></div><div class="navbar-container" id="VuAckcnZhf"><nav class="navbar"><div class="navbar-left-items"><div class="navbar-item"><a id="" href="https://offsides.micahlindley.com" target="_blank">Offsides (Sidechat for Android)</a></div></div><div class="navbar-right-items"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div><nav></nav></nav></div><div class="toc-container"><div class="toc-content"><span class="bold">On this page</span><div id="eed4d2a0bfd64539bb9df78095dec881"></div></div></div><div class="body-wrapper"><div class="main-content"><div class="main-wrapper"><section id="source-page" class="source-page"><header><h1 id="title" class="has-anchor">classes_SidechatAPIClient.js</h1></header><article><pre class="prettyprint source lang-js"><code>import "../types/SidechatTypes.js";
4
- import SidechatAPIError from "../classes/SidechatAPIError.js";
5
-
6
- /**
7
- * API client class for making requests to Sidechat's private API. You'll need to [authenticate]{@tutorial Authentication} before using most of the methods.
8
- * @class
9
- * @since 2.0.0-alpha.0
10
- */
11
- class SidechatAPIClient {
12
- /**
13
- * User bearer token
14
- * @type {SidechatAuthToken}
15
- * */
16
- userToken;
17
-
18
- /**
19
- * Default headers for every API request
20
- * @type {Object}
21
- * @static
22
- * @constant
23
- */
24
- defaultHeaders = {
25
- Accept: "application/json",
26
- "Content-Type": "application/json",
27
- "App-Version": "6.0.0",
28
- Dnt: 1,
29
- };
30
-
31
- /**
32
- * Root URL for every API request
33
- * @type {String}
34
- * @default "https://api.sidechat.lol"
35
- */
36
- apiRoot = "https://api.sidechat.lol";
37
-
38
- /**
39
- * Create a new instance of the API client
40
- * @param {SidechatAuthToken} [token] - user bearer token
41
- * @param {String} rootUrl - custom API root URL for mocking or using other server
42
- */
43
- constructor(token = "", rootUrl = "") {
44
- if (token) {
45
- this.userToken = token;
46
- }
47
- if (rootUrl) {
48
- this.apiRoot = rootUrl;
49
- }
50
- }
51
-
52
- /**
53
- * Manually set the currently signed in user's token. Generally try to avoid this and instead either pass a token to the constructor or login automatically through the auth functions
54
- * @method
55
- * @param {SidechatAuthToken} token - user bearer token
56
- */
57
- setToken = (token) => {
58
- this.userToken = token;
59
- };
60
-
61
- /**
62
- * Manually set the root URL for all API requests. This can be used for mocking requests or redirecting them to a different server
63
- * @method
64
- * @param {String} url - new root URL to set
65
- * @since 2.3.9
66
- */
67
- setAPIRoot = (url) => {
68
- this.apiRoot = url;
69
- };
70
-
71
- /**
72
- * Initiate the login process with a phone number. Should be followed up with verifySMSCode().
73
- * @method
74
- * @since 1.0.0
75
- * @param {Number} phoneNumber - US phone number (WITHOUT +1) to send verification code to
76
- */
77
- loginViaSMS = async (phoneNumber) => {
78
- try {
79
- const res = await fetch(`${this.apiRoot}/v1/login_register`, {
80
- method: "POST",
81
- headers: this.defaultHeaders,
82
- body: JSON.stringify({
83
- phone_number: `+1${phoneNumber}`,
84
- version: 3,
85
- }),
86
- });
87
- const json = await res.json();
88
- return json;
89
- } catch (err) {
90
- console.error(err);
91
- throw new SidechatAPIError("Failed to request SMS verification.");
92
- }
93
- };
94
-
95
- /**
96
- * Verify the code sent via SMS with loginViaSMS(). If this function succeeds, the user will be authenticated for future requests.
97
- * @method
98
- * @since 1.0.0
99
- * @param {Number} phoneNumber - US phone number (WITHOUT +1) that verification code was sent to
100
- * @param {String} code - the verification code
101
- */
102
- verifySMSCode = async (phoneNumber, code) => {
103
- try {
104
- const res = await fetch(`${this.apiRoot}/v1/verify_phone_number`, {
105
- method: "POST",
106
- headers: this.defaultHeaders,
107
- body: JSON.stringify({
108
- phone_number: `+1${phoneNumber}`,
109
- code: code.toUpperCase(),
110
- }),
111
- });
112
- const json = await res.json();
113
- if (json?.logged_in_user?.token) {
114
- this.userToken = json.logged_in_user.token;
115
- }
116
- return json;
117
- } catch (err) {
118
- console.error(err);
119
- throw new SidechatAPIError("Failed verify this code.");
120
- }
121
- };
122
-
123
- /**
124
- * Set the user's age. If this function succeeds, the user will be authenticated for future requests.
125
- * @method
126
- * @since 1.0.0
127
- * @param {Number} age - user's age in years
128
- * @param {String} registrationID - the registration ID generated by verifySMSCode()
129
- */
130
- setAge = async (age, registrationID) => {
131
- if (age &lt; 13) {
132
- throw new SidechatAPIError("You're too young to use Offsides.");
133
- }
134
- try {
135
- const res = await fetch(`${this.apiRoot}/v1/complete_registration`, {
136
- method: "POST",
137
- headers: this.defaultHeaders,
138
- body: JSON.stringify({
139
- age: Number(age),
140
- registration_id: registrationID,
141
- }),
142
- });
143
- const json = await res.json();
144
- if (json.token) {
145
- this.userToken = json.token;
146
- }
147
- return json;
148
- } catch (err) {
149
- console.error(err);
150
- throw new SidechatAPIError("Failed verify this code.");
151
- }
152
- };
153
-
154
- /**
155
- * Initiate the email setup process. Should be followed up with checkEmailVerification().
156
- * @method
157
- * @since 1.0.0
158
- * @param {String} email - school email address to send verification code to
159
- * @tutorial Email Registration
160
- */
161
- registerEmail = async (email) => {
162
- if (!this.userToken) {
163
- throw new SidechatAPIError("User is not authenticated.");
164
- }
165
- try {
166
- const res = await fetch(`${this.apiRoot}/v2/users/register_email`, {
167
- method: "POST",
168
- headers: {
169
- ...this.defaultHeaders,
170
- Authorization: `Bearer ${this.userToken}`,
171
- },
172
- body: JSON.stringify({
173
- email: email,
174
- }),
175
- });
176
- const json = await res.json();
177
- if (json.message) {
178
- throw new SidechatAPIError(json.message);
179
- }
180
- return json;
181
- } catch (err) {
182
- console.error(error);
183
- throw new SidechatAPIError("Failed to request email verification.");
184
- }
185
- };
186
-
187
- /**
188
- * Check is the user's email is verified.
189
- * @method
190
- * @since 1.0.0
191
- */
192
- checkEmailVerification = async () => {
193
- if (!this.userToken) {
194
- throw new SidechatAPIError("User is not authenticated.");
195
- }
196
- try {
197
- const res = await fetch(`${this.apiRoot}/v1/users/check_email_verified`, {
198
- method: "GET",
199
- headers: {
200
- ...this.defaultHeaders,
201
- Authorization: `Bearer ${this.userToken}`,
202
- },
203
- });
204
- const json = await res.json();
205
- if (json.verified_email_updates_response) {
206
- return json.verified_email_updates_response;
207
- } else {
208
- throw new SidechatAPIError(json?.message || "Email is not verified.");
209
- }
210
- } catch (err) {
211
- console.error(error);
212
- throw new SidechatAPIError("Email is not verified.");
213
- }
214
- };
215
-
216
- /**
217
- * Set the device ID of the current user
218
- * @method
219
- * @since 1.0.0
220
- * @param {String} deviceId - the device ID to set
221
- */
222
- setDeviceID = async (deviceID) => {
223
- if (!this.userToken) {
224
- throw new SidechatAPIError("User is not authenticated.");
225
- }
226
- try {
227
- const res = await fetch(`${this.apiRoot}/v1/register_device_token`, {
228
- method: "POST",
229
- headers: {
230
- ...this.defaultHeaders,
231
- Authorization: `Bearer ${this.userToken}`,
232
- },
233
- body: JSON.stringify({
234
- build_type: "release",
235
- bundle_id: "com.flowerave.sidechat",
236
- device_token: deviceID,
237
- }),
238
- });
239
- const json = await res.json();
240
- return json;
241
- } catch (err) {
242
- console.error(err);
243
- throw new SidechatAPIError("Failed verify this code.");
244
- }
245
- };
246
-
247
- /**
248
- * Get updated status for user and group
249
- * @method
250
- * @since 1.0.0
251
- * @deprecated since 2.1.0, will be removed by 3.0.0. Please use `getUpdates` instead!
252
- * @param {String} [groupID] - ID of a specific group to retrieve info from. Falls back to user's primary group.
253
- */
254
- getUserAndGroup = async (groupID = "") => {
255
- const json = await this.getUpdates(groupID);
256
- return json;
257
- };
258
-
259
- /**
260
- * Get updated status for user and group
261
- * @method
262
- * @since 2.1.0
263
- * @param {String} [groupID] - ID of a specific group to retrieve info from. Falls back to user's primary group.
264
- */
265
- getUpdates = async (groupID = "") => {
266
- if (!this.userToken) {
267
- throw new SidechatAPIError("User is not authenticated.");
268
- }
269
- try {
270
- const res = await fetch(
271
- `${this.apiRoot}/v1/updates?group_id=${groupID}`,
272
- {
273
- method: "GET",
274
- headers: {
275
- ...this.defaultHeaders,
276
- Authorization: `Bearer ${this.userToken}`,
277
- },
278
- }
279
- );
280
- const json = await res.json();
281
- return json;
282
- } catch (err) {
283
- console.error(err);
284
- throw new SidechatAPIError(`Failed to get posts from group.`);
285
- }
286
- };
287
-
288
- /**
289
- * Fetches posts from the specified category in a group
290
- * @method
291
- * @since 1.0.0
292
- * @param {String} groupID - group ID
293
- * @param {"hot"|"recent"|"top"} category - category to filter posts
294
- * @param {SidechatCursorString} [cursor] - cursor string
295
- * @returns {SidechatPostsAndCursor} List of posts and cursor
296
- */
297
- getGroupPosts = async (groupID, category = "hot", cursor) => {
298
- if (!this.userToken) {
299
- throw new SidechatAPIError("User is not authenticated.");
300
- }
301
- try {
302
- const res = await fetch(
303
- `${this.apiRoot}/v1/posts?${
304
- cursor ? "cursor=" + encodeURIComponent(cursor) + "&amp;" : ""
305
- }group_id=${groupID}&amp;type=${category}`,
306
- {
307
- method: "GET",
308
- headers: {
309
- ...this.defaultHeaders,
310
- Authorization: `Bearer ${this.userToken}`,
311
- },
312
- }
313
- );
314
- const json = await res.json();
315
- return json;
316
- } catch (err) {
317
- console.error(err);
318
- throw new SidechatAPIError(`Failed to get posts from group.`);
319
- }
320
- };
321
-
322
- /**
323
- * Upvote or downvote, or unvote a post
324
- * @method
325
- * @since 2.0.0-alpha.0
326
- * @param {String} postID - post ID to vote on
327
- * @param {SidechatVoteString} action - whether to upvote, downvote, or reset vote
328
- */
329
- setVote = async (postID, action) => {
330
- if (!this.userToken) {
331
- throw new SidechatAPIError("User is not authenticated.");
332
- }
333
- try {
334
- const res = await fetch(`${this.apiRoot}/v1/posts/set_vote`, {
335
- method: "POST",
336
- headers: {
337
- ...this.defaultHeaders,
338
- Authorization: `Bearer ${this.userToken}`,
339
- },
340
- body: JSON.stringify({
341
- post_id: postID,
342
- vote_status: action,
343
- }),
344
- });
345
- const json = await res.json();
346
- return json;
347
- } catch (err) {
348
- console.error(err);
349
- throw new SidechatAPIError(`Failed to change the vote on post.`);
350
- }
351
- };
352
-
353
- /**
354
- * Fetches a single post with just its ID
355
- * @method
356
- * @since 2.3.0
357
- * @param {String} postID - ID of post to fetch
358
- * @param {Boolean} includeDeleted - undocumented
359
- * @returns {SidechatPostOrComment} post object
360
- */
361
- getPost = async (postID, includeDeleted = false) => {
362
- if (!this.userToken) {
363
- throw new SidechatAPIError("User is not authenticated.");
364
- }
365
- try {
366
- const res = await fetch(
367
- `${this.apiRoot}/v1/posts/get?include_deleted=${includeDeleted}&amp;post_id=${postID}`,
368
- {
369
- method: "GET",
370
- headers: {
371
- ...this.defaultHeaders,
372
- Authorization: `Bearer ${this.userToken}`,
373
- },
374
- }
375
- );
376
- const json = await res.json();
377
- return json.post;
378
- } catch (err) {
379
- console.error(err);
380
- throw new SidechatAPIError(`Failed to get post from ID.`);
381
- }
382
- };
383
-
384
- /**
385
- * Fetches the posts or comments that the user has created
386
- * @method
387
- * @since 2.3.5
388
- * @param {"posts"|"comments"} contentType - type of user content to fetch
389
- * @returns {SidechatPostOrComment[]} post object
390
- */
391
- getUserContent = async (contentType) => {
392
- if (!this.userToken) {
393
- throw new SidechatAPIError("User is not authenticated.");
394
- }
395
- if (contentType == "posts") {
396
- contentType = "my_posts";
397
- } else if (contentType == "comments") {
398
- contentType = "my_comments";
399
- }
400
- try {
401
- const res = await fetch(`${this.apiRoot}/v1/posts&amp;type=${contentType}`, {
402
- method: "GET",
403
- headers: {
404
- ...this.defaultHeaders,
405
- Authorization: `Bearer ${this.userToken}`,
406
- },
407
- });
408
- const json = await res.json();
409
- return json.posts;
410
- } catch (err) {
411
- console.error(err);
412
- throw new SidechatAPIError(`Failed to get content from user.`);
413
- }
414
- };
415
-
416
- /**
417
- * Get all the commments on a post
418
- * @method
419
- * @since 2.0.0-alpha.0
420
- * @param {String} postID - post ID to get comments for
421
- * @returns {SidechatPostOrComment[]} list of comments
422
- */
423
- getPostComments = async (postID) => {
424
- if (!this.userToken) {
425
- throw new SidechatAPIError("User is not authenticated.");
426
- }
427
- try {
428
- const res = await fetch(
429
- `${this.apiRoot}/v1/posts/comments/?post_id=${postID}`,
430
- {
431
- method: "GET",
432
- headers: {
433
- ...this.defaultHeaders,
434
- Authorization: `Bearer ${this.userToken}`,
435
- },
436
- }
437
- );
438
- const json = await res.json();
439
- // Function to preprocess the comments and organize them into a nested structure
440
- function preprocessComments(apiComments) {
441
- // Map to store comments by their IDs for efficient lookup
442
- const commentMap = new Map();
443
- // List to store top-level comments
444
- const topLevelComments = [];
445
-
446
- // Iterate through the API comments
447
- apiComments.forEach((comment) => {
448
- // Store the comment in the map with its ID as the key
449
- commentMap.set(comment.id, comment);
450
- // Get the parent comment using the reply_post_id
451
- const parentComment = commentMap.get(comment.reply_post_id);
452
- // Check if the comment is a top-level comment
453
- if (
454
- !parentComment ||
455
- comment.reply_post_id === comment.parent_post_id
456
- ) {
457
- // If it's a top-level comment, push it to the topLevelComments array
458
- topLevelComments.push(comment);
459
- } else {
460
- // If it's a reply, add it to the parent comment's replies array
461
- if (!parentComment.replies) parentComment.replies = [];
462
- parentComment.replies.push(comment);
463
- }
464
- });
465
-
466
- // Flatten the nested structure and return a single list of comments
467
- return flattenComments(topLevelComments);
468
- }
469
-
470
- // Function to flatten nested comments into a single list
471
- function flattenComments(comments) {
472
- // Use reduce to flatten the nested comments array into a single list
473
- return comments.reduce((flatComments, comment) => {
474
- // Push the current comment to the flatComments array
475
- flatComments.push(comment);
476
- // If the current comment has replies, recursively flatten them and push to the flatComments array
477
- if (comment.replies)
478
- flatComments.push(...flattenComments(comment.replies));
479
- // Return the flatComments array
480
- return flatComments;
481
- }, []);
482
- }
483
-
484
- const sortedComments = preprocessComments(json.posts);
485
- return sortedComments;
486
- } catch (err) {
487
- console.error(err);
488
- throw new SidechatAPIError(`Failed to get comments on post.`);
489
- }
490
- };
491
-
492
- /**
493
- * Gets groups to be displayed on the "Explore Groups" page
494
- * @method
495
- * @since 2.0.0-alpha.0
496
- * @param {Boolean} onePage - whether or not results should be returned as a single page
497
- * @returns {SidechatGroup[]}
498
- */
499
- getAvailableGroups = async (onePage = true) => {
500
- if (!this.userToken) {
501
- throw new SidechatAPIError("User is not authenticated.");
502
- }
503
- try {
504
- const res = await fetch(`${this.apiRoot}/v1/groups/explore`, {
505
- method: "GET",
506
- headers: {
507
- ...this.defaultHeaders,
508
- "App-Version": onePage ? "0" : this.defaultHeaders["App-Version"],
509
- Authorization: `Bearer ${this.userToken}`,
510
- },
511
- });
512
- const json = await res.json();
513
- return await json.groups;
514
- } catch (err) {
515
- console.error(err);
516
- throw new SidechatAPIError(`Failed to get groups from explore.`);
517
- }
518
- };
519
-
520
- /**
521
- * Retrieves the entire accessible asset library. Be warned that as of the time of this documentation, it's a 1.5MB JSON download and this request is very expensive.
522
- * @method
523
- * @since 2.0.6
524
- * @returns {SidechatLibraryAsset[]}
525
- */
526
- getAssetLibrary = async () => {
527
- if (!this.userToken) {
528
- throw new SidechatAPIError("User is not authenticated.");
529
- }
530
- try {
531
- const res = await fetch(`${this.apiRoot}/v1/assets/library`, {
532
- method: "GET",
533
- headers: {
534
- ...this.defaultHeaders,
535
- Authorization: `Bearer ${this.userToken}`,
536
- },
537
- });
538
- const json = await res.json();
539
- return await json.items;
540
- } catch (err) {
541
- console.error(err);
542
- throw new SidechatAPIError(`Failed to get asset library.`);
543
- }
544
- };
545
-
546
- /**
547
- * Gets the current authenticated user and a list of the groups of which they are members.
548
- * @method
549
- * @since 2.1.0
550
- * @returns {SidechatCurrentUser}
551
- */
552
- getCurrentUser = async () => {
553
- if (!this.userToken) {
554
- throw new SidechatAPIError("User is not authenticated.");
555
- }
556
- try {
557
- const res = await fetch(`${this.apiRoot}/v1/users/me`, {
558
- method: "GET",
559
- headers: {
560
- ...this.defaultHeaders,
561
- Authorization: `Bearer ${this.userToken}`,
562
- },
563
- });
564
- const json = await res.json();
565
- return await json;
566
- } catch (err) {
567
- console.error(err);
568
- throw new SidechatAPIError(`Failed to get asset library.`);
569
- }
570
- };
571
-
572
- /**
573
- * Gets the metadata of a group from its ID
574
- * @method
575
- * @since 2.1.0
576
- * @param {String} [groupID] - alphanumeric ID of a group to get. Falls back to user's primary group.
577
- * @returns {SidechatGroup}
578
- */
579
- getGroupMetadata = async (groupID = "") => {
580
- if (!this.userToken) {
581
- throw new SidechatAPIError("User is not authenticated.");
582
- }
583
- try {
584
- const res = await fetch(`${this.apiRoot}/v1/groups/${groupID}`, {
585
- method: "GET",
586
- headers: {
587
- ...this.defaultHeaders,
588
- Authorization: `Bearer ${this.userToken}`,
589
- },
590
- });
591
- const json = await res.json();
592
- return await json.group;
593
- } catch (err) {
594
- console.error(err);
595
- throw new SidechatAPIError(`Failed to get group metadata.`);
596
- }
597
- };
598
-
599
- /**
600
- * Joins or leaves a group
601
- * @method
602
- * @param {String} groupID - alphanumeric ID of group to join or leave
603
- * @param {Boolean} isMember - whether or not the user should be a member of the group
604
- * @since 2.3.8
605
- */
606
- setGroupMembership = async (groupID, isMember) => {
607
- if (!this.userToken) {
608
- throw new SidechatAPIError("User is not authenticated.");
609
- }
610
- try {
611
- const res = await fetch(
612
- `${this.apiRoot}/v1/groups/${isMember ? "join" : "leave"}`,
613
- {
614
- method: "POST",
615
- headers: {
616
- ...this.defaultHeaders,
617
- Authorization: `Bearer ${this.userToken}`,
618
- },
619
- body: JSON.stringify({
620
- group_id: groupID,
621
- }),
622
- }
623
- );
624
- const json = await res.json();
625
- return await json;
626
- } catch (err) {
627
- console.error(err);
628
- throw new SidechatAPIError(`Failed to modify group membership.`);
629
- }
630
- };
631
-
632
- /**
633
- * Creates a comment on a post
634
- * @method
635
- * @since 2.2.0
636
- * @param {String} parentPostID - alphanumeric ID of post on which this comment is made
637
- * @param {String} text - text content of comment
638
- * @param {String} groupID - alphanumeric ID of group in which the parent post resides
639
- * @param {String} [replyCommentID] - alphanumeric ID of comment to reply to. Falls back to parentPostID
640
- * @param {SidechatSimpleAsset[]} [assetList] - list of assets to attach
641
- * @param {Boolean} [disableDMs] - prevent direct messages being sent to comment's author
642
- * @param {Boolean} [anonymous] - whether or not to hide user's name and icon on comment
643
- * @returns {SidechatPostOrComment} created comment
644
- */
645
- createComment = async (
646
- parentPostID,
647
- text,
648
- groupID,
649
- replyCommentID = parentPostID,
650
- assetList = [],
651
- disableDMs = false,
652
- anonymous = false
653
- ) => {
654
- if (!this.userToken) {
655
- throw new SidechatAPIError("User is not authenticated.");
656
- }
657
- try {
658
- const res = await fetch(`${this.apiRoot}/v1/posts`, {
659
- method: "POST",
660
- headers: {
661
- ...this.defaultHeaders,
662
- Authorization: `Bearer ${this.userToken}`,
663
- },
664
- body: JSON.stringify({
665
- type: "comment",
666
- assets: assetList,
667
- group_ids: [groupID],
668
- text: text,
669
- reply_post_id: replyCommentID,
670
- parent_post_id: parentPostID,
671
- dms_disabled: disableDMs,
672
- using_identity: !anonymous,
673
- }),
674
- });
675
- const json = await res.json();
676
- return await json.comment;
677
- } catch (err) {
678
- console.error(err);
679
- throw new SidechatAPIError(`Failed to post comment.`);
680
- }
681
- };
682
-
683
- /**
684
- * Creates a new post in the specified group
685
- * @method
686
- * @since 2.2.0
687
- * @param {String} text - text content of comment
688
- * @param {String} groupID - alphanumeric ID of group in which the parent post resides
689
- * @param {SidechatSimpleAsset[]} [assetList] - list of assets to attach.
690
- * @param {Boolean} [disableDMs] - prevent direct messages from being sent to post's author
691
- * @param {Boolean} [disableComments] - whether or not comments should be disabled on post
692
- * @param {Boolean} [anonymous] - whether or not to hide user's name and icon on post
693
- * @returns {SidechatPostOrComment} the created post
694
- */
695
- createPost = async (
696
- text,
697
- groupID,
698
- assetList = [],
699
- disableDMs = false,
700
- disableComments = false,
701
- anonymous = false
702
- ) => {
703
- if (!this.userToken) {
704
- throw new SidechatAPIError("User is not authenticated.");
705
- }
706
- try {
707
- const res = await fetch(`${this.apiRoot}/v1/posts`, {
708
- method: "POST",
709
- headers: {
710
- ...this.defaultHeaders,
711
- Authorization: `Bearer ${this.userToken}`,
712
- },
713
- body: JSON.stringify({
714
- type: "post",
715
- assets: assetList,
716
- group_ids: [groupID],
717
- text: text,
718
- attachments: [],
719
- dms_disabled: disableDMs,
720
- comments_disabled: disableComments,
721
- using_identity: !anonymous,
722
- }),
723
- });
724
- const json = await res.json();
725
- return await json.posts[0];
726
- } catch (err) {
727
- console.error(err);
728
- throw new SidechatAPIError(`Failed to make post.`);
729
- }
730
- };
731
-
732
- /**
733
- * Deletes a post or comment that the user created
734
- * @method
735
- * @since 2.2.0
736
- * @param {String} postOrCommentID - alphanumeric ID of post to delete
737
- */
738
- deletePostOrComment = async (postOrCommentID) => {
739
- if (!this.userToken) {
740
- throw new SidechatAPIError("User is not authenticated.");
741
- }
742
- try {
743
- const res = await fetch(`${this.apiRoot}/v1/posts/delete`, {
744
- method: "POST",
745
- headers: {
746
- ...this.defaultHeaders,
747
- Authorization: `Bearer ${this.userToken}`,
748
- },
749
- body: JSON.stringify({
750
- post_id: postOrCommentID,
751
- }),
752
- });
753
- const json = await res.json();
754
- return await json;
755
- } catch (err) {
756
- console.error(err);
757
- throw new SidechatAPIError(`Failed to delete post.`);
758
- }
759
- };
760
-
761
- /**
762
- * Sets the conversation icon of the current user
763
- * @method
764
- * @since 2.2.1
765
- * @param {String} userID - alphanumeric ID of user
766
- * @param {String} emoji - emoji to set as icon
767
- * @param {String} primaryColor - hex string (including #) of primary color
768
- * @param {String} secondaryColor - hex string (including #) of secondary color
769
- */
770
- setUserIcon = async (userID, emoji, primaryColor, secondaryColor) => {
771
- if (!this.userToken) {
772
- throw new SidechatAPIError("User is not authenticated.");
773
- }
774
- try {
775
- const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
776
- method: "PATCH",
777
- headers: {
778
- ...this.defaultHeaders,
779
- "App-Version": "0",
780
- Authorization: `Bearer ${this.userToken}`,
781
- },
782
- body: JSON.stringify({
783
- conversation_icon: {
784
- emoji: emoji,
785
- secondary_color: secondaryColor,
786
- is_migrated: true,
787
- color: primaryColor,
788
- },
789
- }),
790
- });
791
- const json = await res.json();
792
- return await json;
793
- } catch (err) {
794
- console.error(err);
795
- throw new SidechatAPIError(`Failed to set icon.`);
796
- }
797
- };
798
-
799
- /**
800
- * Checks if user can set their username to a string
801
- * @method
802
- * @since 2.3.6
803
- * @param {String} username - string to check
804
- * @returns {Boolean} whether or not username is valid and unused
805
- */
806
- checkUsername = async (username) => {
807
- if (!this.userToken) {
808
- throw new SidechatAPIError("User is not authenticated.");
809
- }
810
- try {
811
- const res = await fetch(
812
- `${this.apiRoot}/v1/users/username?username=${username}`,
813
- {
814
- method: "GET",
815
- headers: {
816
- ...this.defaultHeaders,
817
- Authorization: `Bearer ${this.userToken}`,
818
- },
819
- }
820
- );
821
- if (res?.status == 200 || res?.status == 204) {
822
- return true;
823
- } else {
824
- return false;
825
- }
826
- } catch (err) {
827
- console.error(err);
828
- throw new SidechatAPIError(`Failed to check username.`);
829
- }
830
- };
831
-
832
- /**
833
- * Changes the username of the current user
834
- * @method
835
- * @since 2.3.6
836
- * @param {String} userID - alphanumeric ID of user
837
- * @param {String} username - new username to set
838
- */
839
- setUsername = async (userID, username) => {
840
- if (!this.userToken) {
841
- throw new SidechatAPIError("User is not authenticated.");
842
- }
843
- try {
844
- const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
845
- method: "PATCH",
846
- headers: {
847
- ...this.defaultHeaders,
848
- Authorization: `Bearer ${this.userToken}`,
849
- },
850
- body: JSON.stringify({
851
- username: username,
852
- }),
853
- });
854
- const json = await res.json();
855
- return await json.user;
856
- } catch (err) {
857
- console.error(err);
858
- throw new SidechatAPIError(`Failed to set icon.`);
859
- }
860
- };
861
-
862
- /**
863
- * Marks an activity item as read
864
- * @method
865
- * @since 2.3.2
866
- * @param {String} activityID - alphanumeric ID of activity object
867
- */
868
- readActivity = async (activityID) => {
869
- if (!this.userToken) {
870
- throw new SidechatAPIError("User is not authenticated.");
871
- }
872
- try {
873
- const res = await fetch(`${this.apiRoot}/v1/activity/seen`, {
874
- method: "POST",
875
- headers: {
876
- ...this.defaultHeaders,
877
- Authorization: `Bearer ${this.userToken}`,
878
- },
879
- body: JSON.stringify({
880
- ids: [activityID],
881
- }),
882
- });
883
- const json = await res.json();
884
- return await json;
885
- } catch (err) {
886
- console.error(err);
887
- throw new SidechatAPIError(`Failed to mark activity as read.`);
888
- }
889
- };
890
-
891
- /**
892
- * Retrieves joinable group chats
893
- * @method
894
- * @since 2.3.5
895
- */
896
- getGroupChats = async () => {
897
- if (!this.userToken) {
898
- throw new SidechatAPIError("User is not authenticated.");
899
- }
900
- try {
901
- const res = await fetch(`${this.apiRoot}/v1/chats/explore`, {
902
- method: "GET",
903
- headers: {
904
- ...this.defaultHeaders,
905
- Authorization: `Bearer ${this.userToken}`,
906
- },
907
- });
908
- const json = await res.json();
909
- return await json.chats;
910
- } catch (err) {
911
- console.error(err);
912
- throw new SidechatAPIError(`Failed to get groupchats.`);
913
- }
914
- };
915
-
916
- /**
917
- * Joins a group chat
918
- * @method
919
- * @since 2.3.5
920
- */
921
- joinGroupChat = async (
922
- groupChatID,
923
- displayName,
924
- emoji,
925
- primaryColor,
926
- secondaryColor
927
- ) => {
928
- if (!this.userToken) {
929
- throw new SidechatAPIError("User is not authenticated.");
930
- }
931
- try {
932
- const res = await fetch(`${this.apiRoot}/v1/chats/groups/join`, {
933
- method: "POST",
934
- headers: {
935
- ...this.defaultHeaders,
936
- Authorization: `Bearer ${this.userToken}`,
937
- },
938
- body: JSON.stringify({
939
- chat_id: groupChatID,
940
- identity: {
941
- display_name: displayName,
942
- emoji: emoji,
943
- secondary_color: secondaryColor,
944
- color: primaryColor,
945
- },
946
- }),
947
- });
948
- const json = await res.json();
949
- return await json;
950
- } catch (err) {
951
- console.error(err);
952
- throw new SidechatAPIError(`Failed to join groupchat.`);
953
- }
954
- };
955
-
956
- /**
957
- * Gets a list of the user's direct messages
958
- * @method
959
- * @returns {SidechatDirectThread[]}
960
- * @since 2.4.4
961
- */
962
- getDMs = async () => {
963
- if (!this.userToken) {
964
- throw new SidechatAPIError("User is not authenticated.");
965
- }
966
- try {
967
- const res = await fetch(`${this.apiRoot}/v1/chats`, {
968
- method: "GET",
969
- headers: {
970
- ...this.defaultHeaders,
971
- Authorization: `Bearer ${this.userToken}`,
972
- },
973
- });
974
- const json = await res.json();
975
- const list = await json.chats;
976
- let r = [];
977
- list.forEach((o) => {
978
- r.push(o.chat);
979
- });
980
- return await r;
981
- } catch (err) {
982
- console.error(err);
983
- throw new SidechatAPIError(`Failed to fetch DMs.`);
984
- }
985
- };
986
-
987
- /**
988
- * Gets a single direct message thread
989
- * @method
990
- * @param {String} id - alphanumeric ID of the chat to fetch
991
- * @returns {SidechatDirectThread}
992
- * @since 2.4.4
993
- */
994
- getDMThread = async (id) => {
995
- if (!this.userToken) {
996
- throw new SidechatAPIError("User is not authenticated.");
997
- }
998
- try {
999
- const res = await fetch(
1000
- `${this.apiRoot}/v1/chats/messages?chat_id=${id}`,
1001
- {
1002
- method: "GET",
1003
- headers: {
1004
- ...this.defaultHeaders,
1005
- Authorization: `Bearer ${this.userToken}`,
1006
- },
1007
- }
1008
- );
1009
- const json = await res.json();
1010
- return await json.chat;
1011
- } catch (err) {
1012
- console.error(err);
1013
- throw new SidechatAPIError(`Failed to fetch DM thread.`);
1014
- }
1015
- };
1016
-
1017
- /**
1018
- * Sends a message to an existing direct message thread - note that you must first use startDM() to start a thread.
1019
- * @method
1020
- * @param {String} chatID - alphanumeric ID of the chat to send to
1021
- * @param {String} text - text content of message
1022
- * @param {String} clientID - alphanumeric device ID
1023
- * @param {SidechatAsset[]} - array of assets to send
1024
- * @param {Boolean} anonymous - whether the DM should be sent anonymously
1025
- * @since 2.4.4
1026
- */
1027
- sendDM = async (chatID, text, clientID, assets = [], anonymous = false) => {
1028
- if (!this.userToken) {
1029
- throw new SidechatAPIError("User is not authenticated.");
1030
- }
1031
- try {
1032
- const res = await fetch(`${this.apiRoot}/v1/chats/send`, {
1033
- method: "POST",
1034
- headers: {
1035
- ...this.defaultHeaders,
1036
- Authorization: `Bearer ${this.userToken}`,
1037
- },
1038
- body: JSON.stringify({
1039
- chat_id: chatID,
1040
- text: text,
1041
- client_id: clientID,
1042
- anonymous: anonymous,
1043
- assets: assets,
1044
- }),
1045
- });
1046
- const json = await res.json();
1047
- return await json;
1048
- } catch (err) {
1049
- console.error(err);
1050
- throw new SidechatAPIError(`Failed to send message.`);
1051
- }
1052
- };
1053
-
1054
- /**
1055
- * Creates a new direct message thread
1056
- * @method
1057
- * @param {String} text - text content of message
1058
- * @param {String} clientID - alphanumeric ID of devide
1059
- * @param {String} postID - alphanumeric ID of post or comment
1060
- * @param {Boolean} anonymous - whether the DM should be sent anonymously
1061
- * @param {"feed"} postContext - context of post (mostly undocumented, defaults to "feed")
1062
- * @since 2.4.4
1063
- */
1064
- startDM = async (
1065
- text,
1066
- clientID,
1067
- postID,
1068
- anonymous = false,
1069
- postContext = "feed"
1070
- ) => {
1071
- if (!this.userToken) {
1072
- throw new SidechatAPIError("User is not authenticated.");
1073
- }
1074
- try {
1075
- const res = await fetch(`${this.apiRoot}/v1/chats/start`, {
1076
- method: "POST",
1077
- headers: {
1078
- ...this.defaultHeaders,
1079
- Authorization: `Bearer ${this.userToken}`,
1080
- },
1081
- body: JSON.stringify({
1082
- text: text,
1083
- client_id: clientID,
1084
- post_id: postID,
1085
- anonymous: anonymous,
1086
- post_context: postContext,
1087
- }),
1088
- });
1089
- const json = await res.json();
1090
- return await json;
1091
- } catch (err) {
1092
- console.error(err);
1093
- throw new SidechatAPIError(`Failed to start DM.`);
1094
- }
1095
- };
1096
- }
1097
-
1098
- export default SidechatAPIClient;
1099
- </code></pre></article></section></div></div></div><div class="search-container" id="PkfLWpAbet" style="display:none"><div class="wrapper" id="iCxFxjkHbP"><button class="icon-button search-close-button" id="VjLlGakifb" aria-label="close search"><svg><use xlink:href="#close-icon"></use></svg></button><div class="search-box-c"><svg><use xlink:href="#search-icon"></use></svg> <input type="text" id="vpcKVYIppa" class="search-input" placeholder="Search..." autofocus></div><div class="search-result-c" id="fWwVHRuDuN"><span class="search-result-c-text">Type anything to view search result</span></div></div></div><div class="mobile-menu-icon-container"><button class="icon-button" id="mobile-menu" data-isopen="false" aria-label="menu"><svg><use xlink:href="#menu-icon"></use></svg></button></div><div id="mobile-sidebar" class="mobile-sidebar-container"><div class="mobile-sidebar-wrapper"><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://offsides.micahlindley.com" target="_blank">Offsides (Sidechat for Android)</a></div></div><div class="mobile-sidebar-items-c"><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-tutorials"><div>Tutorials</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="tutorial-Authentication.html">Authentication</a></div><div class="sidebar-section-children"><a href="tutorial-Email Registration.html">Email Registration</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-classes"><div>Classes</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="SidechatAPIClient.html">SidechatAPIClient</a></div><div class="sidebar-section-children"><a href="SidechatAPIError.html">SidechatAPIError</a></div><div class="sidebar-section-children"><a href="SidechatColorList.html">SidechatColorList</a></div></div><div class="sidebar-section-title with-arrow" data-isopen="false" id="sidebar-global"><div>Global</div><svg><use xlink:href="#down-icon"></use></svg></div><div class="sidebar-section-children-container"><div class="sidebar-section-children"><a href="global.html#SidechatAssetMetadata">SidechatAssetMetadata</a></div><div class="sidebar-section-children"><a href="global.html#SidechatAuthToken">SidechatAuthToken</a></div><div class="sidebar-section-children"><a href="global.html#SidechatColor">SidechatColor</a></div><div class="sidebar-section-children"><a href="global.html#SidechatCurrentUser">SidechatCurrentUser</a></div><div class="sidebar-section-children"><a href="global.html#SidechatCursorString">SidechatCursorString</a></div><div class="sidebar-section-children"><a href="global.html#SidechatDirectMessage">SidechatDirectMessage</a></div><div class="sidebar-section-children"><a href="global.html#SidechatDirectThread">SidechatDirectThread</a></div><div class="sidebar-section-children"><a href="global.html#SidechatGroup">SidechatGroup</a></div><div class="sidebar-section-children"><a href="global.html#SidechatIdentity">SidechatIdentity</a></div><div class="sidebar-section-children"><a href="global.html#SidechatLibraryAsset">SidechatLibraryAsset</a></div><div class="sidebar-section-children"><a href="global.html#SidechatMembership">SidechatMembership</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPostOrComment">SidechatPostOrComment</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPostsAndCursor">SidechatPostsAndCursor</a></div><div class="sidebar-section-children"><a href="global.html#SidechatPrivateAssetURL">SidechatPrivateAssetURL</a></div><div class="sidebar-section-children"><a href="global.html#SidechatSimpleAsset">SidechatSimpleAsset</a></div><div class="sidebar-section-children"><a href="global.html#SidechatVoteString">SidechatVoteString</a></div></div></div><div class="mobile-navbar-actions"><div class="navbar-right-item"><button class="icon-button search-button" aria-label="open-search"><svg><use xlink:href="#search-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button theme-toggle" aria-label="toggle-theme"><svg><use class="theme-svg-use" xlink:href="#light-theme-icon"></use></svg></button></div><div class="navbar-right-item"><button class="icon-button font-size" aria-label="change-font-size"><svg><use xlink:href="#font-size-icon"></use></svg></button></div></div></div></div><script type="text/javascript" src="scripts/core.min.js"></script><script src="scripts/search.min.js" defer="defer"></script><script src="scripts/third-party/fuse.js" defer="defer"></script><script type="text/javascript">var tocbotInstance=tocbot.init({tocSelector:"#eed4d2a0bfd64539bb9df78095dec881",contentSelector:".main-content",headingSelector:"h1, h2, h3",hasInnerContainers:!0,scrollContainer:".main-content",headingsOffset:130,onClick:bringLinkToView})</script></body></html>