sidechat.js 2.4.5 → 2.4.7

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 (125) hide show
  1. package/dist/classes/SidechatAPIClient.d.ts.map +1 -1
  2. package/dist/index.cjs +5 -8
  3. package/dist/index.mjs +5 -6
  4. package/docs/sidechat.js/2.4.6/SidechatAPIClient.html +3 -0
  5. package/docs/sidechat.js/2.4.6/SidechatAPIError.html +3 -0
  6. package/docs/sidechat.js/{2.3.6/tutorial-Email Registration.html → 2.4.6/SidechatColorList.html} +2 -5
  7. package/docs/sidechat.js/{2.3.6 → 2.4.6}/classes_SidechatAPIClient.js.html +278 -97
  8. package/docs/sidechat.js/{2.3.6 → 2.4.6}/classes_SidechatAPIError.js.html +2 -2
  9. package/docs/sidechat.js/{2.3.6 → 2.4.6}/classes_SidechatColorList.js.html +7 -8
  10. package/docs/sidechat.js/2.4.6/data/search.json +1 -0
  11. package/docs/sidechat.js/2.4.6/global.html +3 -0
  12. package/docs/sidechat.js/2.4.6/index.html +4 -0
  13. package/docs/sidechat.js/{2.3.6 → 2.4.6}/scripts/core.js +24 -0
  14. package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/core.min.js +23 -23
  15. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-base.css +1161 -0
  16. package/docs/sidechat.js/{2.3.6 → 2.4.6}/styles/clean-jsdoc-theme-dark.css +15 -10
  17. package/docs/sidechat.js/{2.3.6 → 2.4.6}/styles/clean-jsdoc-theme-light.css +196 -102
  18. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  19. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  20. package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme.min.css +1 -0
  21. package/docs/sidechat.js/{2.3.6 → 2.4.6}/tutorial-Authentication.html +2 -2
  22. package/docs/sidechat.js/{2.3.2 → 2.4.6}/tutorial-Email Registration.html +2 -2
  23. package/docs/sidechat.js/{2.3.6 → 2.4.6}/types_SidechatTypes.js.html +28 -2
  24. package/docs/sidechat.js/2.4.7/SidechatAPIClient.html +3 -0
  25. package/docs/sidechat.js/2.4.7/SidechatAPIError.html +3 -0
  26. package/docs/sidechat.js/2.4.7/SidechatColorList.html +3 -0
  27. package/docs/sidechat.js/{2.3.3 → 2.4.7}/classes_SidechatAPIClient.js.html +432 -85
  28. package/docs/sidechat.js/2.4.7/classes_SidechatAPIError.js.html +16 -0
  29. package/docs/sidechat.js/2.4.7/classes_SidechatColorList.js.html +79 -0
  30. package/docs/sidechat.js/2.4.7/data/search.json +1 -0
  31. package/docs/sidechat.js/2.4.7/global.html +3 -0
  32. package/docs/sidechat.js/2.4.7/index.html +4 -0
  33. package/docs/sidechat.js/{2.3.2 → 2.4.7}/scripts/core.js +24 -0
  34. package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/core.min.js +23 -23
  35. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-base.css +1159 -0
  36. package/docs/sidechat.js/{2.3.3 → 2.4.7}/styles/clean-jsdoc-theme-dark.css +15 -10
  37. package/docs/sidechat.js/{2.3.2 → 2.4.7}/styles/clean-jsdoc-theme-light.css +196 -102
  38. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-scrollbar.css +30 -0
  39. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
  40. package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme.min.css +1 -0
  41. package/docs/sidechat.js/{2.3.3 → 2.4.7}/tutorial-Authentication.html +2 -2
  42. package/docs/sidechat.js/2.4.7/tutorial-Email Registration.html +6 -0
  43. package/docs/sidechat.js/{2.3.2 → 2.4.7}/types_SidechatTypes.js.html +28 -2
  44. package/jsdoc.json +1 -1
  45. package/package.json +2 -2
  46. package/src/classes/SidechatAPIClient.js +5 -6
  47. package/docs/sidechat.js/2.3.2/SidechatAPIClient.html +0 -3
  48. package/docs/sidechat.js/2.3.2/SidechatAPIError.html +0 -3
  49. package/docs/sidechat.js/2.3.2/classes_SidechatAPIClient.js.html +0 -750
  50. package/docs/sidechat.js/2.3.2/classes_SidechatAPIError.js.html +0 -16
  51. package/docs/sidechat.js/2.3.2/data/search.json +0 -1
  52. package/docs/sidechat.js/2.3.2/global.html +0 -3
  53. package/docs/sidechat.js/2.3.2/index.html +0 -4
  54. package/docs/sidechat.js/2.3.2/styles/clean-jsdoc-theme-base.css +0 -975
  55. package/docs/sidechat.js/2.3.2/styles/clean-jsdoc-theme-dark.css +0 -407
  56. package/docs/sidechat.js/2.3.2/styles/clean-jsdoc-theme.min.css +0 -1
  57. package/docs/sidechat.js/2.3.2/tutorial-Authentication.html +0 -14
  58. package/docs/sidechat.js/2.3.3/SidechatAPIClient.html +0 -3
  59. package/docs/sidechat.js/2.3.3/SidechatAPIError.html +0 -3
  60. package/docs/sidechat.js/2.3.3/classes_SidechatAPIError.js.html +0 -16
  61. package/docs/sidechat.js/2.3.3/data/search.json +0 -1
  62. package/docs/sidechat.js/2.3.3/global.html +0 -3
  63. package/docs/sidechat.js/2.3.3/index.html +0 -4
  64. package/docs/sidechat.js/2.3.3/scripts/core.js +0 -702
  65. package/docs/sidechat.js/2.3.3/styles/clean-jsdoc-theme-base.css +0 -975
  66. package/docs/sidechat.js/2.3.3/styles/clean-jsdoc-theme-light.css +0 -388
  67. package/docs/sidechat.js/2.3.3/styles/clean-jsdoc-theme.min.css +0 -1
  68. package/docs/sidechat.js/2.3.3/tutorial-Email Registration.html +0 -6
  69. package/docs/sidechat.js/2.3.3/types_SidechatTypes.js.html +0 -134
  70. package/docs/sidechat.js/2.3.6/SidechatAPIClient.html +0 -3
  71. package/docs/sidechat.js/2.3.6/SidechatAPIError.html +0 -3
  72. package/docs/sidechat.js/2.3.6/data/search.json +0 -1
  73. package/docs/sidechat.js/2.3.6/fonts/Inconsolata-Regular.ttf +0 -0
  74. package/docs/sidechat.js/2.3.6/fonts/OpenSans-Regular.ttf +0 -0
  75. package/docs/sidechat.js/2.3.6/fonts/WorkSans-Bold.ttf +0 -0
  76. package/docs/sidechat.js/2.3.6/global.html +0 -3
  77. package/docs/sidechat.js/2.3.6/index.html +0 -4
  78. package/docs/sidechat.js/2.3.6/scripts/core.min.js +0 -23
  79. package/docs/sidechat.js/2.3.6/scripts/resize.js +0 -90
  80. package/docs/sidechat.js/2.3.6/scripts/search.js +0 -265
  81. package/docs/sidechat.js/2.3.6/scripts/search.min.js +0 -6
  82. package/docs/sidechat.js/2.3.6/scripts/third-party/Apache-License-2.0.txt +0 -202
  83. package/docs/sidechat.js/2.3.6/scripts/third-party/fuse.js +0 -9
  84. package/docs/sidechat.js/2.3.6/scripts/third-party/hljs-line-num-original.js +0 -369
  85. package/docs/sidechat.js/2.3.6/scripts/third-party/hljs-line-num.js +0 -1
  86. package/docs/sidechat.js/2.3.6/scripts/third-party/hljs-original.js +0 -5171
  87. package/docs/sidechat.js/2.3.6/scripts/third-party/hljs.js +0 -1
  88. package/docs/sidechat.js/2.3.6/scripts/third-party/popper.js +0 -5
  89. package/docs/sidechat.js/2.3.6/scripts/third-party/tippy.js +0 -1
  90. package/docs/sidechat.js/2.3.6/scripts/third-party/tocbot.js +0 -672
  91. package/docs/sidechat.js/2.3.6/scripts/third-party/tocbot.min.js +0 -1
  92. package/docs/sidechat.js/2.3.6/styles/clean-jsdoc-theme-base.css +0 -975
  93. package/docs/sidechat.js/2.3.6/styles/clean-jsdoc-theme.min.css +0 -1
  94. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/fonts/Inconsolata-Regular.ttf +0 -0
  95. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/fonts/OpenSans-Regular.ttf +0 -0
  96. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/fonts/WorkSans-Bold.ttf +0 -0
  97. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/resize.js +0 -0
  98. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/search.js +0 -0
  99. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/search.min.js +0 -0
  100. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/Apache-License-2.0.txt +0 -0
  101. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/fuse.js +0 -0
  102. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/hljs-line-num-original.js +0 -0
  103. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/hljs-line-num.js +0 -0
  104. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/hljs-original.js +0 -0
  105. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/hljs.js +0 -0
  106. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/popper.js +0 -0
  107. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/tippy.js +0 -0
  108. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/tocbot.js +0 -0
  109. /package/docs/sidechat.js/{2.3.2 → 2.4.6}/scripts/third-party/tocbot.min.js +0 -0
  110. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/fonts/Inconsolata-Regular.ttf +0 -0
  111. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/fonts/OpenSans-Regular.ttf +0 -0
  112. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/fonts/WorkSans-Bold.ttf +0 -0
  113. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/resize.js +0 -0
  114. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/search.js +0 -0
  115. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/search.min.js +0 -0
  116. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/Apache-License-2.0.txt +0 -0
  117. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/fuse.js +0 -0
  118. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/hljs-line-num-original.js +0 -0
  119. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/hljs-line-num.js +0 -0
  120. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/hljs-original.js +0 -0
  121. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/hljs.js +0 -0
  122. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/popper.js +0 -0
  123. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/tippy.js +0 -0
  124. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/tocbot.js +0 -0
  125. /package/docs/sidechat.js/{2.3.3 → 2.4.7}/scripts/third-party/tocbot.min.js +0 -0
@@ -1,6 +1,6 @@
1
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
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"><a href="/" class="sidebar-title sidebar-title-anchor">Home</a><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><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#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#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://github.com/micahlt/offsides#README.md" 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";
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
4
  import SidechatAPIError from "../classes/SidechatAPIError.js";
5
5
 
6
6
  /**
@@ -14,6 +14,7 @@ class SidechatAPIClient {
14
14
  * @type {SidechatAuthToken}
15
15
  * */
16
16
  userToken;
17
+
17
18
  /**
18
19
  * Default headers for every API request
19
20
  * @type {Object}
@@ -23,18 +24,29 @@ class SidechatAPIClient {
23
24
  defaultHeaders = {
24
25
  Accept: "application/json",
25
26
  "Content-Type": "application/json",
26
- "App-Version": "4.2.0",
27
+ "App-Version": "6.0.0",
27
28
  Dnt: 1,
28
29
  };
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
+
30
38
  /**
31
39
  * Create a new instance of the API client
32
40
  * @param {SidechatAuthToken} [token] - user bearer token
41
+ * @param {String} rootUrl - custom API root URL for mocking or using other server
33
42
  */
34
- constructor(token = "") {
43
+ constructor(token = "", rootUrl = "") {
35
44
  if (token) {
36
45
  this.userToken = token;
37
46
  }
47
+ if (rootUrl) {
48
+ this.apiRoot = rootUrl;
49
+ }
38
50
  }
39
51
 
40
52
  /**
@@ -46,6 +58,16 @@ class SidechatAPIClient {
46
58
  this.userToken = token;
47
59
  };
48
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
+
49
71
  /**
50
72
  * Initiate the login process with a phone number. Should be followed up with verifySMSCode().
51
73
  * @method
@@ -54,7 +76,7 @@ class SidechatAPIClient {
54
76
  */
55
77
  loginViaSMS = async (phoneNumber) => {
56
78
  try {
57
- const res = await fetch(`https://api.sidechat.lol/v1/login_register`, {
79
+ const res = await fetch(`${this.apiRoot}/v1/login_register`, {
58
80
  method: "POST",
59
81
  headers: this.defaultHeaders,
60
82
  body: JSON.stringify({
@@ -79,17 +101,14 @@ class SidechatAPIClient {
79
101
  */
80
102
  verifySMSCode = async (phoneNumber, code) => {
81
103
  try {
82
- const res = await fetch(
83
- `https://api.sidechat.lol/v1/verify_phone_number`,
84
- {
85
- method: "POST",
86
- headers: this.defaultHeaders,
87
- body: JSON.stringify({
88
- phone_number: `+1${phoneNumber}`,
89
- code: code.toUpperCase(),
90
- }),
91
- }
92
- );
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
+ });
93
112
  const json = await res.json();
94
113
  if (json?.logged_in_user?.token) {
95
114
  this.userToken = json.logged_in_user.token;
@@ -113,17 +132,14 @@ class SidechatAPIClient {
113
132
  throw new SidechatAPIError("You're too young to use Offsides.");
114
133
  }
115
134
  try {
116
- const res = await fetch(
117
- `https://api.sidechat.lol/v1/complete_registration`,
118
- {
119
- method: "POST",
120
- headers: this.defaultHeaders,
121
- body: JSON.stringify({
122
- age: Number(age),
123
- registration_id: registrationID,
124
- }),
125
- }
126
- );
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
+ });
127
143
  const json = await res.json();
128
144
  if (json.token) {
129
145
  this.userToken = json.token;
@@ -147,19 +163,16 @@ class SidechatAPIClient {
147
163
  throw new SidechatAPIError("User is not authenticated.");
148
164
  }
149
165
  try {
150
- const res = await fetch(
151
- `https://api.sidechat.lol/v2/users/register_email`,
152
- {
153
- method: "POST",
154
- headers: {
155
- ...this.defaultHeaders,
156
- Authorization: `Bearer ${this.userToken}`,
157
- },
158
- body: JSON.stringify({
159
- email: email,
160
- }),
161
- }
162
- );
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
+ });
163
176
  const json = await res.json();
164
177
  if (json.message) {
165
178
  throw new SidechatAPIError(json.message);
@@ -181,16 +194,13 @@ class SidechatAPIClient {
181
194
  throw new SidechatAPIError("User is not authenticated.");
182
195
  }
183
196
  try {
184
- const res = await fetch(
185
- `https://api.sidechat.lol/v1/users/check_email_verified`,
186
- {
187
- method: "GET",
188
- headers: {
189
- ...this.defaultHeaders,
190
- Authorization: `Bearer ${this.userToken}`,
191
- },
192
- }
193
- );
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
+ });
194
204
  const json = await res.json();
195
205
  if (json.verified_email_updates_response) {
196
206
  return json.verified_email_updates_response;
@@ -214,23 +224,19 @@ class SidechatAPIClient {
214
224
  throw new SidechatAPIError("User is not authenticated.");
215
225
  }
216
226
  try {
217
- const res = await fetch(
218
- `https://api.sidechat.lol/v1/register_device_token`,
219
- {
220
- method: "POST",
221
- headers: {
222
- ...this.defaultHeaders,
223
- Authorization: `Bearer ${this.userToken}`,
224
- },
225
- body: JSON.stringify({
226
- build_type: "release",
227
- bundle_id: "com.flowerave.sidechat",
228
- device_token: deviceID,
229
- }),
230
- }
231
- );
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
+ });
232
239
  const json = await res.json();
233
- await AsyncStorage.setItem("deviceID", deviceID);
234
240
  return json;
235
241
  } catch (err) {
236
242
  console.error(err);
@@ -262,7 +268,7 @@ class SidechatAPIClient {
262
268
  }
263
269
  try {
264
270
  const res = await fetch(
265
- `https://api.sidechat.lol/v1/updates?group_id=${groupID}`,
271
+ `${this.apiRoot}/v1/updates?group_id=${groupID}`,
266
272
  {
267
273
  method: "GET",
268
274
  headers: {
@@ -294,9 +300,9 @@ class SidechatAPIClient {
294
300
  }
295
301
  try {
296
302
  const res = await fetch(
297
- `https://api.sidechat.lol/v1/posts?group_id=${groupID}&amp;type=${category}${
298
- cursor ? "&amp;cursor=" + cursor : ""
299
- }`,
303
+ `${this.apiRoot}/v1/posts?${
304
+ cursor ? "cursor=" + encodeURIComponent(cursor) + "&amp;" : ""
305
+ }group_id=${groupID}&amp;type=${category}`,
300
306
  {
301
307
  method: "GET",
302
308
  headers: {
@@ -325,7 +331,7 @@ class SidechatAPIClient {
325
331
  throw new SidechatAPIError("User is not authenticated.");
326
332
  }
327
333
  try {
328
- const res = await fetch(`https://api.sidechat.lol/v1/posts/set_vote`, {
334
+ const res = await fetch(`${this.apiRoot}/v1/posts/set_vote`, {
329
335
  method: "POST",
330
336
  headers: {
331
337
  ...this.defaultHeaders,
@@ -358,7 +364,7 @@ class SidechatAPIClient {
358
364
  }
359
365
  try {
360
366
  const res = await fetch(
361
- `https://api.sidechat.lol/v1/posts/get?include_deleted=${includeDeleted}&amp;post_id=${postID}`,
367
+ `${this.apiRoot}/v1/posts/get?include_deleted=${includeDeleted}&amp;post_id=${postID}`,
362
368
  {
363
369
  method: "GET",
364
370
  headers: {
@@ -375,6 +381,38 @@ class SidechatAPIClient {
375
381
  }
376
382
  };
377
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
+
378
416
  /**
379
417
  * Get all the commments on a post
380
418
  * @method
@@ -388,7 +426,7 @@ class SidechatAPIClient {
388
426
  }
389
427
  try {
390
428
  const res = await fetch(
391
- `https://api.sidechat.lol/v1/posts/comments/?post_id=${postID}`,
429
+ `${this.apiRoot}/v1/posts/comments/?post_id=${postID}`,
392
430
  {
393
431
  method: "GET",
394
432
  headers: {
@@ -463,7 +501,7 @@ class SidechatAPIClient {
463
501
  throw new SidechatAPIError("User is not authenticated.");
464
502
  }
465
503
  try {
466
- const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
504
+ const res = await fetch(`${this.apiRoot}/v1/groups/explore`, {
467
505
  method: "GET",
468
506
  headers: {
469
507
  ...this.defaultHeaders,
@@ -490,7 +528,7 @@ class SidechatAPIClient {
490
528
  throw new SidechatAPIError("User is not authenticated.");
491
529
  }
492
530
  try {
493
- const res = await fetch(`https://api.sidechat.lol/v1/assets/library`, {
531
+ const res = await fetch(`${this.apiRoot}/v1/assets/library`, {
494
532
  method: "GET",
495
533
  headers: {
496
534
  ...this.defaultHeaders,
@@ -516,7 +554,7 @@ class SidechatAPIClient {
516
554
  throw new SidechatAPIError("User is not authenticated.");
517
555
  }
518
556
  try {
519
- const res = await fetch(`https://api.sidechat.lol/v1/users/me`, {
557
+ const res = await fetch(`${this.apiRoot}/v1/users/me`, {
520
558
  method: "GET",
521
559
  headers: {
522
560
  ...this.defaultHeaders,
@@ -543,7 +581,7 @@ class SidechatAPIClient {
543
581
  throw new SidechatAPIError("User is not authenticated.");
544
582
  }
545
583
  try {
546
- const res = await fetch(`https://api.sidechat.lol/v1/groups/${groupID}`, {
584
+ const res = await fetch(`${this.apiRoot}/v1/groups/${groupID}`, {
547
585
  method: "GET",
548
586
  headers: {
549
587
  ...this.defaultHeaders,
@@ -558,6 +596,39 @@ class SidechatAPIClient {
558
596
  }
559
597
  };
560
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
+
561
632
  /**
562
633
  * Creates a comment on a post
563
634
  * @method
@@ -568,6 +639,7 @@ class SidechatAPIClient {
568
639
  * @param {String} [replyCommentID] - alphanumeric ID of comment to reply to. Falls back to parentPostID
569
640
  * @param {SidechatSimpleAsset[]} [assetList] - list of assets to attach
570
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
571
643
  * @returns {SidechatPostOrComment} created comment
572
644
  */
573
645
  createComment = async (
@@ -576,13 +648,14 @@ class SidechatAPIClient {
576
648
  groupID,
577
649
  replyCommentID = parentPostID,
578
650
  assetList = [],
579
- disableDMs = false
651
+ disableDMs = false,
652
+ anonymous = false
580
653
  ) => {
581
654
  if (!this.userToken) {
582
655
  throw new SidechatAPIError("User is not authenticated.");
583
656
  }
584
657
  try {
585
- const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
658
+ const res = await fetch(`${this.apiRoot}/v1/posts`, {
586
659
  method: "POST",
587
660
  headers: {
588
661
  ...this.defaultHeaders,
@@ -596,6 +669,7 @@ class SidechatAPIClient {
596
669
  reply_post_id: replyCommentID,
597
670
  parent_post_id: parentPostID,
598
671
  dms_disabled: disableDMs,
672
+ using_identity: !anonymous,
599
673
  }),
600
674
  });
601
675
  const json = await res.json();
@@ -615,6 +689,7 @@ class SidechatAPIClient {
615
689
  * @param {SidechatSimpleAsset[]} [assetList] - list of assets to attach.
616
690
  * @param {Boolean} [disableDMs] - prevent direct messages from being sent to post's author
617
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
618
693
  * @returns {SidechatPostOrComment} the created post
619
694
  */
620
695
  createPost = async (
@@ -622,13 +697,14 @@ class SidechatAPIClient {
622
697
  groupID,
623
698
  assetList = [],
624
699
  disableDMs = false,
625
- disableComments = false
700
+ disableComments = false,
701
+ anonymous = false
626
702
  ) => {
627
703
  if (!this.userToken) {
628
704
  throw new SidechatAPIError("User is not authenticated.");
629
705
  }
630
706
  try {
631
- const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
707
+ const res = await fetch(`${this.apiRoot}/v1/posts`, {
632
708
  method: "POST",
633
709
  headers: {
634
710
  ...this.defaultHeaders,
@@ -642,6 +718,7 @@ class SidechatAPIClient {
642
718
  attachments: [],
643
719
  dms_disabled: disableDMs,
644
720
  comments_disabled: disableComments,
721
+ using_identity: !anonymous,
645
722
  }),
646
723
  });
647
724
  const json = await res.json();
@@ -663,7 +740,7 @@ class SidechatAPIClient {
663
740
  throw new SidechatAPIError("User is not authenticated.");
664
741
  }
665
742
  try {
666
- const res = await fetch(`https://api.sidechat.lol/v1/posts/delete`, {
743
+ const res = await fetch(`${this.apiRoot}/v1/posts/delete`, {
667
744
  method: "POST",
668
745
  headers: {
669
746
  ...this.defaultHeaders,
@@ -685,7 +762,7 @@ class SidechatAPIClient {
685
762
  * Sets the conversation icon of the current user
686
763
  * @method
687
764
  * @since 2.2.1
688
- * @param {String} userID - alphanumeric ID of the post to delete
765
+ * @param {String} userID - alphanumeric ID of user
689
766
  * @param {String} emoji - emoji to set as icon
690
767
  * @param {String} primaryColor - hex string (including #) of primary color
691
768
  * @param {String} secondaryColor - hex string (including #) of secondary color
@@ -695,10 +772,11 @@ class SidechatAPIClient {
695
772
  throw new SidechatAPIError("User is not authenticated.");
696
773
  }
697
774
  try {
698
- const res = await fetch(`https://api.sidechat.lol/v1/users/${userID}`, {
775
+ const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
699
776
  method: "PATCH",
700
777
  headers: {
701
778
  ...this.defaultHeaders,
779
+ "App-Version": "0",
702
780
  Authorization: `Bearer ${this.userToken}`,
703
781
  },
704
782
  body: JSON.stringify({
@@ -718,6 +796,69 @@ class SidechatAPIClient {
718
796
  }
719
797
  };
720
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
+
721
862
  /**
722
863
  * Marks an activity item as read
723
864
  * @method
@@ -729,7 +870,7 @@ class SidechatAPIClient {
729
870
  throw new SidechatAPIError("User is not authenticated.");
730
871
  }
731
872
  try {
732
- const res = await fetch(`https://api.sidechat.lol/v1/activity/seen`, {
873
+ const res = await fetch(`${this.apiRoot}/v1/activity/seen`, {
733
874
  method: "POST",
734
875
  headers: {
735
876
  ...this.defaultHeaders,
@@ -746,7 +887,213 @@ class SidechatAPIClient {
746
887
  throw new SidechatAPIError(`Failed to mark activity as read.`);
747
888
  }
748
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
+ };
749
1096
  }
750
1097
 
751
1098
  export default SidechatAPIClient;
752
- </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"><a href="/" class="sidebar-title sidebar-title-anchor">Home</a><div class="mobile-nav-links"><div class="navbar-item"><a id="" href="https://github.com/micahlt/offsides#README.md" 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><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#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#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>
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>