sidechat.js 2.5.5 → 2.6.0
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.
- package/dist/classes/SidechatAPIClient.d.ts +40 -3
- package/dist/classes/SidechatAPIClient.d.ts.map +1 -1
- package/dist/index.cjs +151 -12
- package/dist/index.mjs +151 -12
- package/dist/types/SidechatTypes.d.ts +69 -3
- package/dist/types/SidechatTypes.d.ts.map +1 -1
- package/docs/sidechat.js/2.5.6/SidechatAPIClient.html +3 -0
- package/docs/sidechat.js/2.5.6/SidechatAPIError.html +3 -0
- package/docs/sidechat.js/2.5.6/SidechatColorList.html +3 -0
- package/docs/sidechat.js/{2.4.6 → 2.5.6}/classes_SidechatAPIClient.js.html +181 -11
- package/docs/sidechat.js/2.5.6/classes_SidechatAPIError.js.html +16 -0
- package/docs/sidechat.js/2.5.6/classes_SidechatColorList.js.html +79 -0
- package/docs/sidechat.js/2.5.6/data/search.json +1 -0
- package/docs/sidechat.js/2.5.6/global.html +3 -0
- package/docs/sidechat.js/2.5.6/index.html +4 -0
- package/docs/sidechat.js/2.5.6/tutorial-Authentication.html +14 -0
- package/docs/sidechat.js/2.5.6/tutorial-Email Registration.html +6 -0
- package/docs/sidechat.js/{2.4.6 → 2.5.6}/types_SidechatTypes.js.html +23 -3
- package/docs/sidechat.js/2.6.0/SidechatAPIClient.html +3 -0
- package/docs/sidechat.js/2.6.0/SidechatAPIError.html +3 -0
- package/docs/sidechat.js/2.6.0/SidechatColorList.html +3 -0
- package/docs/sidechat.js/{2.4.7 → 2.6.0}/classes_SidechatAPIClient.js.html +268 -11
- package/docs/sidechat.js/2.6.0/classes_SidechatAPIError.js.html +16 -0
- package/docs/sidechat.js/2.6.0/classes_SidechatColorList.js.html +79 -0
- package/docs/sidechat.js/2.6.0/data/search.json +1 -0
- package/docs/sidechat.js/2.6.0/global.html +3 -0
- package/docs/sidechat.js/2.6.0/index.html +4 -0
- package/docs/sidechat.js/{2.4.6 → 2.6.0}/scripts/core.js +1 -1
- package/docs/sidechat.js/{2.4.6 → 2.6.0}/scripts/core.min.js +1 -1
- package/docs/sidechat.js/{2.4.6 → 2.6.0}/styles/clean-jsdoc-theme-base.css +3 -5
- package/docs/sidechat.js/2.6.0/styles/clean-jsdoc-theme-without-scrollbar.min.css +1 -0
- package/docs/sidechat.js/2.6.0/styles/clean-jsdoc-theme.min.css +1 -0
- package/docs/sidechat.js/2.6.0/tutorial-Authentication.html +14 -0
- package/docs/sidechat.js/2.6.0/tutorial-Email Registration.html +6 -0
- package/docs/sidechat.js/{2.4.7 → 2.6.0}/types_SidechatTypes.js.html +51 -7
- package/jsdoc.json +10 -0
- package/package.json +2 -2
- package/src/classes/SidechatAPIClient.js +120 -6
- package/src/types/SidechatTypes.js +31 -6
- package/docs/sidechat.js/1.0.0/data/search.json +0 -1
- package/docs/sidechat.js/1.0.0/global.html +0 -3
- package/docs/sidechat.js/1.0.0/index.html +0 -4
- package/docs/sidechat.js/1.0.0/index.js.html +0 -363
- package/docs/sidechat.js/1.0.0/scripts/core.js +0 -702
- package/docs/sidechat.js/1.0.0/scripts/core.min.js +0 -23
- package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-base.css +0 -975
- package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-dark.css +0 -407
- package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme-light.css +0 -388
- package/docs/sidechat.js/1.0.0/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/sidechat.js/1.0.0/types_SidechatTypes.js.html +0 -82
- package/docs/sidechat.js/2.0.0-alpha.0/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.0.0-alpha.0/SidechatAPIError.html +0 -3
- package/docs/sidechat.js/2.0.0-alpha.0/classes_SidechatAPIClient.js.html +0 -418
- package/docs/sidechat.js/2.0.0-alpha.0/classes_SidechatAPIError.js.html +0 -16
- package/docs/sidechat.js/2.0.0-alpha.0/data/search.json +0 -1
- package/docs/sidechat.js/2.0.0-alpha.0/global.html +0 -3
- package/docs/sidechat.js/2.0.0-alpha.0/index.html +0 -4
- package/docs/sidechat.js/2.0.0-alpha.0/scripts/core.js +0 -702
- package/docs/sidechat.js/2.0.0-alpha.0/scripts/core.min.js +0 -23
- package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-base.css +0 -975
- package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-dark.css +0 -407
- package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme-light.css +0 -388
- package/docs/sidechat.js/2.0.0-alpha.0/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Authentication.html +0 -13
- package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Email Registration.html +0 -6
- package/docs/sidechat.js/2.0.0-alpha.0/tutorial-Email Verification.html +0 -6
- package/docs/sidechat.js/2.0.0-alpha.0/types_SidechatTypes.js.html +0 -98
- package/docs/sidechat.js/2.4.0/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.4.0/SidechatAPIError.html +0 -3
- package/docs/sidechat.js/2.4.0/SidechatColorList.html +0 -3
- package/docs/sidechat.js/2.4.0/classes_SidechatAPIClient.js.html +0 -956
- package/docs/sidechat.js/2.4.0/classes_SidechatAPIError.js.html +0 -16
- package/docs/sidechat.js/2.4.0/classes_SidechatColorList.js.html +0 -79
- package/docs/sidechat.js/2.4.0/data/search.json +0 -1
- package/docs/sidechat.js/2.4.0/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.0/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.0/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/sidechat.js/2.4.0/global.html +0 -3
- package/docs/sidechat.js/2.4.0/index.html +0 -4
- package/docs/sidechat.js/2.4.0/scripts/core.js +0 -702
- package/docs/sidechat.js/2.4.0/scripts/core.min.js +0 -23
- package/docs/sidechat.js/2.4.0/scripts/resize.js +0 -90
- package/docs/sidechat.js/2.4.0/scripts/search.js +0 -265
- package/docs/sidechat.js/2.4.0/scripts/search.min.js +0 -6
- package/docs/sidechat.js/2.4.0/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/docs/sidechat.js/2.4.0/scripts/third-party/fuse.js +0 -9
- package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/sidechat.js/2.4.0/scripts/third-party/hljs-original.js +0 -5171
- package/docs/sidechat.js/2.4.0/scripts/third-party/hljs.js +0 -1
- package/docs/sidechat.js/2.4.0/scripts/third-party/popper.js +0 -5
- package/docs/sidechat.js/2.4.0/scripts/third-party/tippy.js +0 -1
- package/docs/sidechat.js/2.4.0/scripts/third-party/tocbot.js +0 -672
- package/docs/sidechat.js/2.4.0/scripts/third-party/tocbot.min.js +0 -1
- package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-base.css +0 -975
- package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-dark.css +0 -407
- package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme-light.css +0 -388
- package/docs/sidechat.js/2.4.0/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/sidechat.js/2.4.0/tutorial-Authentication.html +0 -14
- package/docs/sidechat.js/2.4.0/tutorial-Email Registration.html +0 -6
- package/docs/sidechat.js/2.4.0/types_SidechatTypes.js.html +0 -134
- package/docs/sidechat.js/2.4.4/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.4.4/SidechatAPIError.html +0 -3
- package/docs/sidechat.js/2.4.4/SidechatColorList.html +0 -3
- package/docs/sidechat.js/2.4.4/classes_SidechatAPIClient.js.html +0 -1100
- package/docs/sidechat.js/2.4.4/classes_SidechatAPIError.js.html +0 -16
- package/docs/sidechat.js/2.4.4/classes_SidechatColorList.js.html +0 -79
- package/docs/sidechat.js/2.4.4/data/search.json +0 -1
- package/docs/sidechat.js/2.4.4/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.4/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.4/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/sidechat.js/2.4.4/global.html +0 -3
- package/docs/sidechat.js/2.4.4/index.html +0 -4
- package/docs/sidechat.js/2.4.4/scripts/core.js +0 -726
- package/docs/sidechat.js/2.4.4/scripts/core.min.js +0 -23
- package/docs/sidechat.js/2.4.4/scripts/resize.js +0 -90
- package/docs/sidechat.js/2.4.4/scripts/search.js +0 -265
- package/docs/sidechat.js/2.4.4/scripts/search.min.js +0 -6
- package/docs/sidechat.js/2.4.4/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/docs/sidechat.js/2.4.4/scripts/third-party/fuse.js +0 -9
- package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/sidechat.js/2.4.4/scripts/third-party/hljs-original.js +0 -5171
- package/docs/sidechat.js/2.4.4/scripts/third-party/hljs.js +0 -1
- package/docs/sidechat.js/2.4.4/scripts/third-party/popper.js +0 -5
- package/docs/sidechat.js/2.4.4/scripts/third-party/tippy.js +0 -1
- package/docs/sidechat.js/2.4.4/scripts/third-party/tocbot.js +0 -672
- package/docs/sidechat.js/2.4.4/scripts/third-party/tocbot.min.js +0 -1
- package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme-base.css +0 -1161
- package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
- package/docs/sidechat.js/2.4.4/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/sidechat.js/2.4.4/tutorial-Authentication.html +0 -14
- package/docs/sidechat.js/2.4.4/tutorial-Email Registration.html +0 -6
- package/docs/sidechat.js/2.4.4/types_SidechatTypes.js.html +0 -160
- package/docs/sidechat.js/2.4.6/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.4.6/SidechatAPIError.html +0 -3
- package/docs/sidechat.js/2.4.6/SidechatColorList.html +0 -3
- package/docs/sidechat.js/2.4.6/classes_SidechatAPIError.js.html +0 -16
- package/docs/sidechat.js/2.4.6/classes_SidechatColorList.js.html +0 -79
- package/docs/sidechat.js/2.4.6/data/search.json +0 -1
- package/docs/sidechat.js/2.4.6/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.6/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.6/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/sidechat.js/2.4.6/global.html +0 -3
- package/docs/sidechat.js/2.4.6/index.html +0 -4
- package/docs/sidechat.js/2.4.6/scripts/resize.js +0 -90
- package/docs/sidechat.js/2.4.6/scripts/search.js +0 -265
- package/docs/sidechat.js/2.4.6/scripts/search.min.js +0 -6
- package/docs/sidechat.js/2.4.6/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/docs/sidechat.js/2.4.6/scripts/third-party/fuse.js +0 -9
- package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/sidechat.js/2.4.6/scripts/third-party/hljs-original.js +0 -5171
- package/docs/sidechat.js/2.4.6/scripts/third-party/hljs.js +0 -1
- package/docs/sidechat.js/2.4.6/scripts/third-party/popper.js +0 -5
- package/docs/sidechat.js/2.4.6/scripts/third-party/tippy.js +0 -1
- package/docs/sidechat.js/2.4.6/scripts/third-party/tocbot.js +0 -672
- package/docs/sidechat.js/2.4.6/scripts/third-party/tocbot.min.js +0 -1
- package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
- package/docs/sidechat.js/2.4.6/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/sidechat.js/2.4.6/tutorial-Authentication.html +0 -14
- package/docs/sidechat.js/2.4.6/tutorial-Email Registration.html +0 -6
- package/docs/sidechat.js/2.4.7/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.4.7/SidechatAPIError.html +0 -3
- package/docs/sidechat.js/2.4.7/SidechatColorList.html +0 -3
- package/docs/sidechat.js/2.4.7/classes_SidechatAPIError.js.html +0 -16
- package/docs/sidechat.js/2.4.7/classes_SidechatColorList.js.html +0 -79
- package/docs/sidechat.js/2.4.7/data/search.json +0 -1
- package/docs/sidechat.js/2.4.7/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.7/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/sidechat.js/2.4.7/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/sidechat.js/2.4.7/global.html +0 -3
- package/docs/sidechat.js/2.4.7/index.html +0 -4
- package/docs/sidechat.js/2.4.7/scripts/resize.js +0 -90
- package/docs/sidechat.js/2.4.7/scripts/search.js +0 -265
- package/docs/sidechat.js/2.4.7/scripts/search.min.js +0 -6
- package/docs/sidechat.js/2.4.7/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/docs/sidechat.js/2.4.7/scripts/third-party/fuse.js +0 -9
- package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/sidechat.js/2.4.7/scripts/third-party/hljs-original.js +0 -5171
- package/docs/sidechat.js/2.4.7/scripts/third-party/hljs.js +0 -1
- package/docs/sidechat.js/2.4.7/scripts/third-party/popper.js +0 -5
- package/docs/sidechat.js/2.4.7/scripts/third-party/tippy.js +0 -1
- package/docs/sidechat.js/2.4.7/scripts/third-party/tocbot.js +0 -672
- package/docs/sidechat.js/2.4.7/scripts/third-party/tocbot.min.js +0 -1
- package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-dark.css +0 -412
- package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-light.css +0 -482
- package/docs/sidechat.js/2.4.7/styles/clean-jsdoc-theme-scrollbar.css +0 -30
- package/docs/sidechat.js/2.4.7/tutorial-Authentication.html +0 -14
- package/docs/sidechat.js/2.4.7/tutorial-Email Registration.html +0 -6
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/Inconsolata-Regular.ttf +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/OpenSans-Regular.ttf +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/fonts/WorkSans-Bold.ttf +0 -0
- /package/docs/sidechat.js/{2.4.7 → 2.5.6}/scripts/core.js +0 -0
- /package/docs/sidechat.js/{2.4.7 → 2.5.6}/scripts/core.min.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/resize.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/search.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/search.min.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/Apache-License-2.0.txt +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/fuse.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-line-num-original.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-line-num.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs-original.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/hljs.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/popper.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tippy.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tocbot.js +0 -0
- /package/docs/sidechat.js/{1.0.0 → 2.5.6}/scripts/third-party/tocbot.min.js +0 -0
- /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme-base.css +0 -0
- /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-dark.css +0 -0
- /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-light.css +0 -0
- /package/docs/sidechat.js/{2.4.4 → 2.5.6}/styles/clean-jsdoc-theme-scrollbar.css +0 -0
- /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -0
- /package/docs/sidechat.js/{2.4.7 → 2.5.6}/styles/clean-jsdoc-theme.min.css +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/fonts/Inconsolata-Regular.ttf +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/fonts/OpenSans-Regular.ttf +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/fonts/WorkSans-Bold.ttf +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/resize.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/search.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/search.min.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/Apache-License-2.0.txt +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/fuse.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/hljs-line-num-original.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/hljs-line-num.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/hljs-original.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/hljs.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/popper.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/tippy.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/tocbot.js +0 -0
- /package/docs/sidechat.js/{2.0.0-alpha.0 → 2.6.0}/scripts/third-party/tocbot.min.js +0 -0
- /package/docs/sidechat.js/{2.4.6 → 2.6.0}/styles/clean-jsdoc-theme-dark.css +0 -0
- /package/docs/sidechat.js/{2.4.6 → 2.6.0}/styles/clean-jsdoc-theme-light.css +0 -0
- /package/docs/sidechat.js/{2.4.6 → 2.6.0}/styles/clean-jsdoc-theme-scrollbar.css +0 -0
|
@@ -163,6 +163,14 @@ declare class SidechatAPIClient {
|
|
|
163
163
|
* @returns {SidechatGroup[]}
|
|
164
164
|
*/
|
|
165
165
|
getAvailableGroups: (onePage?: boolean) => SidechatGroup[];
|
|
166
|
+
/**
|
|
167
|
+
* Searches for new groups based on a query keyword
|
|
168
|
+
* @method
|
|
169
|
+
* @since 2.6.0
|
|
170
|
+
* @param {String} query - the string to search for. This will be encoded, so strings with spaces and special characters are okay.
|
|
171
|
+
* @returns {SidechatGroup[]}
|
|
172
|
+
*/
|
|
173
|
+
searchAvailableGroups: (query: string) => SidechatGroup[];
|
|
166
174
|
/**
|
|
167
175
|
* 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.
|
|
168
176
|
* @method
|
|
@@ -254,7 +262,7 @@ declare class SidechatAPIClient {
|
|
|
254
262
|
*/
|
|
255
263
|
uploadAsset: (uri: string, mimeType: string, name?: string) => string;
|
|
256
264
|
/**
|
|
257
|
-
* Sets the conversation icon of
|
|
265
|
+
* Sets the conversation icon of a user
|
|
258
266
|
* @method
|
|
259
267
|
* @since 2.2.1
|
|
260
268
|
* @param {String} userID - alphanumeric ID of user
|
|
@@ -263,6 +271,14 @@ declare class SidechatAPIClient {
|
|
|
263
271
|
* @param {String} secondaryColor - hex string (including #) of secondary color
|
|
264
272
|
*/
|
|
265
273
|
setUserIcon: (userID: string, emoji: string, primaryColor: string, secondaryColor: string) => Promise<any>;
|
|
274
|
+
/**
|
|
275
|
+
* Sets the bio text of a user
|
|
276
|
+
* @method
|
|
277
|
+
* @since 2.5.6
|
|
278
|
+
* @param {String} userID - alphanumeric ID of user
|
|
279
|
+
* @param {String} bio - text to set as bio
|
|
280
|
+
*/
|
|
281
|
+
setUserBio: (userID: string, bio: string) => Promise<any>;
|
|
266
282
|
/**
|
|
267
283
|
* Checks if user can set their username to a string
|
|
268
284
|
* @method
|
|
@@ -279,6 +295,22 @@ declare class SidechatAPIClient {
|
|
|
279
295
|
* @param {String} username - new username to set
|
|
280
296
|
*/
|
|
281
297
|
setUsername: (userID: string, username: string) => Promise<any>;
|
|
298
|
+
/**
|
|
299
|
+
* Fetches a public user profile
|
|
300
|
+
* @method
|
|
301
|
+
* @since 2.6.0
|
|
302
|
+
* @param {String} username - username of the user to fetch
|
|
303
|
+
* @returns {SidechatProfile}
|
|
304
|
+
*/
|
|
305
|
+
getUserProfile: (username: string) => SidechatProfile;
|
|
306
|
+
/**
|
|
307
|
+
* Fetches a public user's posts
|
|
308
|
+
* @method
|
|
309
|
+
* @since 2.6.0
|
|
310
|
+
* @param {String} username - username of the user to fetch
|
|
311
|
+
* @returns {SidechatPostOrComment[]}
|
|
312
|
+
*/
|
|
313
|
+
getUserPosts: (username: string) => SidechatPostOrComment[];
|
|
282
314
|
/**
|
|
283
315
|
* Marks an activity item as read
|
|
284
316
|
* @method
|
|
@@ -293,11 +325,16 @@ declare class SidechatAPIClient {
|
|
|
293
325
|
*/
|
|
294
326
|
getGroupChats: () => Promise<any>;
|
|
295
327
|
/**
|
|
296
|
-
* Joins a group chat
|
|
328
|
+
* Joins a group chat. To mimic the official client, use the user's display name and icon by default.
|
|
297
329
|
* @method
|
|
330
|
+
* @param {String} groupChatID - alphanumeric ID of group chat to join
|
|
331
|
+
* @param {String} displayName - display name to use in chat
|
|
332
|
+
* @param {String} emoji - emoji to use as icon
|
|
333
|
+
* @param {String} primaryColor - hex string of primary color
|
|
334
|
+
* @param {String} secondaryColor - hex string of secondary color
|
|
298
335
|
* @since 2.3.5
|
|
299
336
|
*/
|
|
300
|
-
joinGroupChat: (groupChatID:
|
|
337
|
+
joinGroupChat: (groupChatID: string, displayName: string, emoji: string, primaryColor: string, secondaryColor: string) => Promise<any>;
|
|
301
338
|
/**
|
|
302
339
|
* Gets a list of the user's direct messages
|
|
303
340
|
* @method
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidechatAPIClient.d.ts","sourceRoot":"","sources":["../../src/classes/SidechatAPIClient.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;IA2BE;;;;OAIG;IACH,oBAHW,iBAAiB,oBAU3B;IAtCD;;;SAGK;IACL,WAFU,iBAAiB,CAEjB;IAEV;;;;;OAKG;IACH,oBAKE;IAEF;;;;OAIG;IACH,gBAAqC;IAgBrC;;;;OAIG;IACH,kBAFW,iBAAiB,UAI1B;IAEF;;;;;OAKG;IACH,kCAEE;IAEF;;;;;;;;;OASG;IACH,yCANW,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,QAAQ,GAAC,OAAO,GAAC,SAAS,0EAuBtD;IAEF;;;;;OAKG;IACH,mDAgBE;IAEF;;;;;;OAMG;IACH,mEAmBE;IAEF;;;;;;OAMG;IACH,8DAsBE;IAEF;;;;;;OAMG;IACH,+CAwBE;IAEF;;;;OAIG;IACH,2CAsBE;IAEF;;;;;OAKG;IACH,6CAuBE;IAEF;;;;;;OAMG;IACH,oDAGE;IAEF;;;;;OAKG;IACH,+CAqBE;IAEF;;;;;;;;OAQG;IACH,4CAJW,KAAK,GAAC,QAAQ,GAAC,KAAK,WACpB,oBAAoB,KAClB,sBAAsB,CAwBjC;IAEF;;;;;;OAMG;IACH,kCAFW,kBAAkB,kBAwB3B;IAEF;;;;;;;OAOG;IACH,uDAFa,qBAAqB,CAuBhC;IAEF;;;;;;OAMG;IACH,8BAHW,OAAO,GAAC,UAAU,KAChB,qBAAqB,EAAE,CAyBlC;IAEF;;;;;;OAMG;IACH,qCAFa,qBAAqB,EAAE,CAqElC;IAEF;;;;;;OAMG;IACH,2CAFa,aAAa,EAAE,CAqB1B;IAEF;;;;;OAKG;IACH,uBAFa,oBAAoB,EAAE,CAoBjC;IAEF;;;;;OAKG;IACH,sBAFa,mBAAmB,CAoB9B;IAEF;;;;;;OAMG;IACH,wCAFa,aAAa,CAoBxB;IAEF;;;;;;OAMG;IACH,yEAwBE;IAEF;;;;;;;;;;;;;OAaG;IACH,oIALW,mBAAmB,EAAE,gDAGnB,qBAAqB,CAwChC;IAEF;;;;;;;;;;;OAWG;IACH,wDANW,mBAAmB,EAAE,2EAInB,qBAAqB,CAqChC;IAEF;;;;;OAKG;IACH,+DAqBE;IAEF;;;;;;OAMG;IACH,kEAsBE;IAEF;;;;;OAKG;IACH,kDAqBE;IAEF;;;;;;;;OAQG;IACH,
|
|
1
|
+
{"version":3,"file":"SidechatAPIClient.d.ts","sourceRoot":"","sources":["../../src/classes/SidechatAPIClient.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;IA2BE;;;;OAIG;IACH,oBAHW,iBAAiB,oBAU3B;IAtCD;;;SAGK;IACL,WAFU,iBAAiB,CAEjB;IAEV;;;;;OAKG;IACH,oBAKE;IAEF;;;;OAIG;IACH,gBAAqC;IAgBrC;;;;OAIG;IACH,kBAFW,iBAAiB,UAI1B;IAEF;;;;;OAKG;IACH,kCAEE;IAEF;;;;;;;;;OASG;IACH,yCANW,KAAK,GAAC,MAAM,GAAC,KAAK,GAAC,QAAQ,GAAC,OAAO,GAAC,SAAS,0EAuBtD;IAEF;;;;;OAKG;IACH,mDAgBE;IAEF;;;;;;OAMG;IACH,mEAmBE;IAEF;;;;;;OAMG;IACH,8DAsBE;IAEF;;;;;;OAMG;IACH,+CAwBE;IAEF;;;;OAIG;IACH,2CAsBE;IAEF;;;;;OAKG;IACH,6CAuBE;IAEF;;;;;;OAMG;IACH,oDAGE;IAEF;;;;;OAKG;IACH,+CAqBE;IAEF;;;;;;;;OAQG;IACH,4CAJW,KAAK,GAAC,QAAQ,GAAC,KAAK,WACpB,oBAAoB,KAClB,sBAAsB,CAwBjC;IAEF;;;;;;OAMG;IACH,kCAFW,kBAAkB,kBAwB3B;IAEF;;;;;;;OAOG;IACH,uDAFa,qBAAqB,CAuBhC;IAEF;;;;;;OAMG;IACH,8BAHW,OAAO,GAAC,UAAU,KAChB,qBAAqB,EAAE,CAyBlC;IAEF;;;;;;OAMG;IACH,qCAFa,qBAAqB,EAAE,CAqElC;IAEF;;;;;;OAMG;IACH,2CAFa,aAAa,EAAE,CAqB1B;IAEF;;;;;;OAMG;IACH,0CAFa,aAAa,EAAE,CAoB1B;IAEF;;;;;OAKG;IACH,uBAFa,oBAAoB,EAAE,CAoBjC;IAEF;;;;;OAKG;IACH,sBAFa,mBAAmB,CAoB9B;IAEF;;;;;;OAMG;IACH,wCAFa,aAAa,CAoBxB;IAEF;;;;;;OAMG;IACH,yEAwBE;IAEF;;;;;;;;;;;;;OAaG;IACH,oIALW,mBAAmB,EAAE,gDAGnB,qBAAqB,CAwChC;IAEF;;;;;;;;;;;OAWG;IACH,wDANW,mBAAmB,EAAE,2EAInB,qBAAqB,CAqChC;IAEF;;;;;OAKG;IACH,+DAqBE;IAEF;;;;;;OAMG;IACH,kEAsBE;IAEF;;;;;OAKG;IACH,kDAqBE;IAEF;;;;;;;;OAQG;IACH,sEAsCE;IAEF;;;;;;;;OAQG;IACH,2GA2BE;IAEF;;;;;;OAMG;IACH,0DAsBE;IAEF;;;;;;OAMG;IACH,6CAwBE;IAEF;;;;;;OAMG;IACH,gEAqBE;IAEF;;;;;;OAMG;IACH,sCAFa,eAAe,CAoB1B;IAEF;;;;;;OAMG;IACH,oCAFa,qBAAqB,EAAE,CAoBlC;IAEF;;;;;OAKG;IACH,mDAqBE;IAEF;;;;OAIG;IACH,kCAkBE;IAEF;;;;;;;;;OASG;IACH,uIAiCE;IAEF;;;;;OAKG;IACH,cAHa,oBAAoB,EAAE,CA0BjC;IAEF;;;;;;OAMG;IACH,6BAHa,oBAAoB,CAwB/B;IAEF;;;;;;;;;OASG;IACH,kEAJW,aAAa,EAAE,uCA6BxB;IAEF;;;;;;;;;OASG;IACH,6FAHW,MAAM,kBAkCf;CACH"}
|
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
* @typedef {Object} SidechatPostOrComment
|
|
8
8
|
* @prop {"post"|"comment"} type - whether this object represents a post or a comment on a post
|
|
9
9
|
* @prop {String} id - alphanumeric ID of post or comment
|
|
10
|
-
* @prop {Boolean} authored_by_user -
|
|
10
|
+
* @prop {Boolean} authored_by_user - whether or not the post or comment was created by the current user
|
|
11
11
|
* @prop {String} alias - post creator's name in-app
|
|
12
12
|
* @prop {String} group_id - alphanumeric ID of group
|
|
13
13
|
* @prop {SidechatGroup} group - group in which post or comment was created
|
|
@@ -21,8 +21,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
21
21
|
* @prop {String[]} tags - undocumented
|
|
22
22
|
* @prop {SidechatIdentity} identity - creator's identity information
|
|
23
23
|
* @prop {Boolean} pinned - undocumented
|
|
24
|
-
* @prop {Boolean} is_saved -
|
|
25
|
-
* @prop {"following"|"not_following"} follow_status -
|
|
24
|
+
* @prop {Boolean} is_saved - whether or not the current user has saved the post
|
|
25
|
+
* @prop {"following"|"not_following"} follow_status - whether or not the current user should recieve activity notifications for the post
|
|
26
26
|
* @prop {"group"} [destination] - undocumented
|
|
27
27
|
* @prop {Number} [comment_count] - number of comments on post (only if type=post)
|
|
28
28
|
* @prop {Boolean} [comments_disabled] - whether or not you can comment on post (only if type=post)
|
|
@@ -86,6 +86,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
86
86
|
* @prop {Boolean} posted_with_username - undocumented
|
|
87
87
|
*/
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* A conversation icon associated with a user
|
|
91
|
+
* @typedef {Object} SidechatIcon
|
|
92
|
+
* @prop {String} emoji - unicode emoji character
|
|
93
|
+
* @prop {String} color - primary hex color code
|
|
94
|
+
* @prop {String} secondary_color - secondary hex color code
|
|
95
|
+
*/
|
|
96
|
+
|
|
89
97
|
/**
|
|
90
98
|
* The current user's information
|
|
91
99
|
* @typedef {Object} SidechatCurrentUser
|
|
@@ -99,6 +107,22 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
99
107
|
* @prop {String} wildcardEmailDomain - domain of verified email address on account, preceeded by *. to support subdomains
|
|
100
108
|
*/
|
|
101
109
|
|
|
110
|
+
/**
|
|
111
|
+
* A user's public profile
|
|
112
|
+
* @typedef {Object} SidechatProfile
|
|
113
|
+
* @prop {String} id - alphanumeric ID of user
|
|
114
|
+
* @prop {String} name - public-facing username
|
|
115
|
+
* @prop {SidechatIcon} conversation_icon - icon associated with user
|
|
116
|
+
* @prop {Boolean} description - the user bio
|
|
117
|
+
* @prop {String} index_name - undocumented
|
|
118
|
+
* @prop {String} analytics_name - undocumented
|
|
119
|
+
* @prop {String} color - undocumented
|
|
120
|
+
* @prop {String} share_color_start - undocumented
|
|
121
|
+
* @prop {String} share_color_end - undocumented
|
|
122
|
+
* @prop {"account"} group_join_type - undocumented
|
|
123
|
+
* @prop {"public_to_all"} group_visibility - the profile visibility status
|
|
124
|
+
*/
|
|
125
|
+
|
|
102
126
|
/**
|
|
103
127
|
* Representation of a group membership
|
|
104
128
|
* @typedef {Object} SidechatMembership
|
|
@@ -133,7 +157,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
133
157
|
* @prop {SidechatCursorString} cursor
|
|
134
158
|
*/
|
|
135
159
|
|
|
136
|
-
var SidechatTypes = {};
|
|
137
160
|
|
|
138
161
|
/**
|
|
139
162
|
* A direct message thread
|
|
@@ -170,7 +193,7 @@ var SidechatTypes = {};
|
|
|
170
193
|
* @prop {Boolean} allows_view_results - whether or not poll results are publicly visible
|
|
171
194
|
* @prop {Number} view_results_count - number of users who have viewed poll results
|
|
172
195
|
* @prop {Boolean} participated - whether or not current user has voted in poll
|
|
173
|
-
|
|
196
|
+
*/
|
|
174
197
|
|
|
175
198
|
/**
|
|
176
199
|
* Represents a poll choice
|
|
@@ -178,7 +201,9 @@ var SidechatTypes = {};
|
|
|
178
201
|
* @prop {Number} count - number of votes for choice
|
|
179
202
|
* @prop {String} text - user-visible text of choice
|
|
180
203
|
* @prop {Boolean} selected - whether or not current user has voted for choice
|
|
181
|
-
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
var SidechatTypes = {};
|
|
182
207
|
|
|
183
208
|
/**
|
|
184
209
|
* Throwable error caused by the Sidechat API
|
|
@@ -734,6 +759,33 @@ class SidechatAPIClient {
|
|
|
734
759
|
}
|
|
735
760
|
};
|
|
736
761
|
|
|
762
|
+
/**
|
|
763
|
+
* Searches for new groups based on a query keyword
|
|
764
|
+
* @method
|
|
765
|
+
* @since 2.6.0
|
|
766
|
+
* @param {String} query - the string to search for. This will be encoded, so strings with spaces and special characters are okay.
|
|
767
|
+
* @returns {SidechatGroup[]}
|
|
768
|
+
*/
|
|
769
|
+
searchAvailableGroups = async (query) => {
|
|
770
|
+
if (!this.userToken) {
|
|
771
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
772
|
+
}
|
|
773
|
+
try {
|
|
774
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/explore/search?term=${encodeURIComponent(query)}`, {
|
|
775
|
+
method: "GET",
|
|
776
|
+
headers: {
|
|
777
|
+
...this.defaultHeaders,
|
|
778
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
779
|
+
},
|
|
780
|
+
});
|
|
781
|
+
const json = await res.json();
|
|
782
|
+
return await json.results;
|
|
783
|
+
} catch (err) {
|
|
784
|
+
console.error(err);
|
|
785
|
+
throw new SidechatAPIError(`Failed to search groups.`);
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
|
|
737
789
|
/**
|
|
738
790
|
* 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.
|
|
739
791
|
* @method
|
|
@@ -1064,10 +1116,7 @@ class SidechatAPIClient {
|
|
|
1064
1116
|
uri: uri,
|
|
1065
1117
|
});
|
|
1066
1118
|
|
|
1067
|
-
const urlReq = await this.sendRequest(
|
|
1068
|
-
`/v1/assets/upload_url?content_type=${imageType}`,
|
|
1069
|
-
"GET"
|
|
1070
|
-
);
|
|
1119
|
+
const urlReq = await this.sendRequest(`/v1/assets/upload_url?content_type=${imageType}`);
|
|
1071
1120
|
const urlJson = await urlReq.json();
|
|
1072
1121
|
|
|
1073
1122
|
try {
|
|
@@ -1091,7 +1140,7 @@ class SidechatAPIClient {
|
|
|
1091
1140
|
};
|
|
1092
1141
|
|
|
1093
1142
|
/**
|
|
1094
|
-
* Sets the conversation icon of
|
|
1143
|
+
* Sets the conversation icon of a user
|
|
1095
1144
|
* @method
|
|
1096
1145
|
* @since 2.2.1
|
|
1097
1146
|
* @param {String} userID - alphanumeric ID of user
|
|
@@ -1128,6 +1177,37 @@ class SidechatAPIClient {
|
|
|
1128
1177
|
}
|
|
1129
1178
|
};
|
|
1130
1179
|
|
|
1180
|
+
/**
|
|
1181
|
+
* Sets the bio text of a user
|
|
1182
|
+
* @method
|
|
1183
|
+
* @since 2.5.6
|
|
1184
|
+
* @param {String} userID - alphanumeric ID of user
|
|
1185
|
+
* @param {String} bio - text to set as bio
|
|
1186
|
+
*/
|
|
1187
|
+
setUserBio = async (userID, bio) => {
|
|
1188
|
+
if (!this.userToken) {
|
|
1189
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1190
|
+
}
|
|
1191
|
+
try {
|
|
1192
|
+
const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
|
|
1193
|
+
method: "PATCH",
|
|
1194
|
+
headers: {
|
|
1195
|
+
...this.defaultHeaders,
|
|
1196
|
+
"App-Version": "5.4.22",
|
|
1197
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1198
|
+
},
|
|
1199
|
+
body: JSON.stringify({
|
|
1200
|
+
bio: bio
|
|
1201
|
+
}),
|
|
1202
|
+
});
|
|
1203
|
+
const json = await res.json();
|
|
1204
|
+
return await json;
|
|
1205
|
+
} catch (err) {
|
|
1206
|
+
console.error(err);
|
|
1207
|
+
throw new SidechatAPIError(`Failed to set bio.`);
|
|
1208
|
+
}
|
|
1209
|
+
};
|
|
1210
|
+
|
|
1131
1211
|
/**
|
|
1132
1212
|
* Checks if user can set their username to a string
|
|
1133
1213
|
* @method
|
|
@@ -1191,6 +1271,60 @@ class SidechatAPIClient {
|
|
|
1191
1271
|
}
|
|
1192
1272
|
};
|
|
1193
1273
|
|
|
1274
|
+
/**
|
|
1275
|
+
* Fetches a public user profile
|
|
1276
|
+
* @method
|
|
1277
|
+
* @since 2.6.0
|
|
1278
|
+
* @param {String} username - username of the user to fetch
|
|
1279
|
+
* @returns {SidechatProfile}
|
|
1280
|
+
*/
|
|
1281
|
+
getUserProfile = async (username) => {
|
|
1282
|
+
if (!this.userToken) {
|
|
1283
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1284
|
+
}
|
|
1285
|
+
try {
|
|
1286
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/username?username=${username}`, {
|
|
1287
|
+
method: "GET",
|
|
1288
|
+
headers: {
|
|
1289
|
+
...this.defaultHeaders,
|
|
1290
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1291
|
+
}
|
|
1292
|
+
});
|
|
1293
|
+
const json = await res.json();
|
|
1294
|
+
return await json.group;
|
|
1295
|
+
} catch (err) {
|
|
1296
|
+
console.error(err);
|
|
1297
|
+
throw new SidechatAPIError(`Failed to set icon.`);
|
|
1298
|
+
}
|
|
1299
|
+
};
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Fetches a public user's posts
|
|
1303
|
+
* @method
|
|
1304
|
+
* @since 2.6.0
|
|
1305
|
+
* @param {String} username - username of the user to fetch
|
|
1306
|
+
* @returns {SidechatPostOrComment[]}
|
|
1307
|
+
*/
|
|
1308
|
+
getUserPosts = async (username) => {
|
|
1309
|
+
if (!this.userToken) {
|
|
1310
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1311
|
+
}
|
|
1312
|
+
try {
|
|
1313
|
+
const res = await fetch(`${this.apiRoot}/v1/users/posts?username=${username}`, {
|
|
1314
|
+
method: "GET",
|
|
1315
|
+
headers: {
|
|
1316
|
+
...this.defaultHeaders,
|
|
1317
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
const json = await res.json();
|
|
1321
|
+
return await json.posts;
|
|
1322
|
+
} catch (err) {
|
|
1323
|
+
console.error(err);
|
|
1324
|
+
throw new SidechatAPIError(`Failed to set icon.`);
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
|
|
1194
1328
|
/**
|
|
1195
1329
|
* Marks an activity item as read
|
|
1196
1330
|
* @method
|
|
@@ -1246,8 +1380,13 @@ class SidechatAPIClient {
|
|
|
1246
1380
|
};
|
|
1247
1381
|
|
|
1248
1382
|
/**
|
|
1249
|
-
* Joins a group chat
|
|
1383
|
+
* Joins a group chat. To mimic the official client, use the user's display name and icon by default.
|
|
1250
1384
|
* @method
|
|
1385
|
+
* @param {String} groupChatID - alphanumeric ID of group chat to join
|
|
1386
|
+
* @param {String} displayName - display name to use in chat
|
|
1387
|
+
* @param {String} emoji - emoji to use as icon
|
|
1388
|
+
* @param {String} primaryColor - hex string of primary color
|
|
1389
|
+
* @param {String} secondaryColor - hex string of secondary color
|
|
1251
1390
|
* @since 2.3.5
|
|
1252
1391
|
*/
|
|
1253
1392
|
joinGroupChat = async (
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @typedef {Object} SidechatPostOrComment
|
|
4
4
|
* @prop {"post"|"comment"} type - whether this object represents a post or a comment on a post
|
|
5
5
|
* @prop {String} id - alphanumeric ID of post or comment
|
|
6
|
-
* @prop {Boolean} authored_by_user -
|
|
6
|
+
* @prop {Boolean} authored_by_user - whether or not the post or comment was created by the current user
|
|
7
7
|
* @prop {String} alias - post creator's name in-app
|
|
8
8
|
* @prop {String} group_id - alphanumeric ID of group
|
|
9
9
|
* @prop {SidechatGroup} group - group in which post or comment was created
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
* @prop {String[]} tags - undocumented
|
|
18
18
|
* @prop {SidechatIdentity} identity - creator's identity information
|
|
19
19
|
* @prop {Boolean} pinned - undocumented
|
|
20
|
-
* @prop {Boolean} is_saved -
|
|
21
|
-
* @prop {"following"|"not_following"} follow_status -
|
|
20
|
+
* @prop {Boolean} is_saved - whether or not the current user has saved the post
|
|
21
|
+
* @prop {"following"|"not_following"} follow_status - whether or not the current user should recieve activity notifications for the post
|
|
22
22
|
* @prop {"group"} [destination] - undocumented
|
|
23
23
|
* @prop {Number} [comment_count] - number of comments on post (only if type=post)
|
|
24
24
|
* @prop {Boolean} [comments_disabled] - whether or not you can comment on post (only if type=post)
|
|
@@ -82,6 +82,14 @@
|
|
|
82
82
|
* @prop {Boolean} posted_with_username - undocumented
|
|
83
83
|
*/
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* A conversation icon associated with a user
|
|
87
|
+
* @typedef {Object} SidechatIcon
|
|
88
|
+
* @prop {String} emoji - unicode emoji character
|
|
89
|
+
* @prop {String} color - primary hex color code
|
|
90
|
+
* @prop {String} secondary_color - secondary hex color code
|
|
91
|
+
*/
|
|
92
|
+
|
|
85
93
|
/**
|
|
86
94
|
* The current user's information
|
|
87
95
|
* @typedef {Object} SidechatCurrentUser
|
|
@@ -95,6 +103,22 @@
|
|
|
95
103
|
* @prop {String} wildcardEmailDomain - domain of verified email address on account, preceeded by *. to support subdomains
|
|
96
104
|
*/
|
|
97
105
|
|
|
106
|
+
/**
|
|
107
|
+
* A user's public profile
|
|
108
|
+
* @typedef {Object} SidechatProfile
|
|
109
|
+
* @prop {String} id - alphanumeric ID of user
|
|
110
|
+
* @prop {String} name - public-facing username
|
|
111
|
+
* @prop {SidechatIcon} conversation_icon - icon associated with user
|
|
112
|
+
* @prop {Boolean} description - the user bio
|
|
113
|
+
* @prop {String} index_name - undocumented
|
|
114
|
+
* @prop {String} analytics_name - undocumented
|
|
115
|
+
* @prop {String} color - undocumented
|
|
116
|
+
* @prop {String} share_color_start - undocumented
|
|
117
|
+
* @prop {String} share_color_end - undocumented
|
|
118
|
+
* @prop {"account"} group_join_type - undocumented
|
|
119
|
+
* @prop {"public_to_all"} group_visibility - the profile visibility status
|
|
120
|
+
*/
|
|
121
|
+
|
|
98
122
|
/**
|
|
99
123
|
* Representation of a group membership
|
|
100
124
|
* @typedef {Object} SidechatMembership
|
|
@@ -129,7 +153,6 @@
|
|
|
129
153
|
* @prop {SidechatCursorString} cursor
|
|
130
154
|
*/
|
|
131
155
|
|
|
132
|
-
var SidechatTypes = {};
|
|
133
156
|
|
|
134
157
|
/**
|
|
135
158
|
* A direct message thread
|
|
@@ -166,7 +189,7 @@ var SidechatTypes = {};
|
|
|
166
189
|
* @prop {Boolean} allows_view_results - whether or not poll results are publicly visible
|
|
167
190
|
* @prop {Number} view_results_count - number of users who have viewed poll results
|
|
168
191
|
* @prop {Boolean} participated - whether or not current user has voted in poll
|
|
169
|
-
|
|
192
|
+
*/
|
|
170
193
|
|
|
171
194
|
/**
|
|
172
195
|
* Represents a poll choice
|
|
@@ -174,7 +197,9 @@ var SidechatTypes = {};
|
|
|
174
197
|
* @prop {Number} count - number of votes for choice
|
|
175
198
|
* @prop {String} text - user-visible text of choice
|
|
176
199
|
* @prop {Boolean} selected - whether or not current user has voted for choice
|
|
177
|
-
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
var SidechatTypes = {};
|
|
178
203
|
|
|
179
204
|
/**
|
|
180
205
|
* Throwable error caused by the Sidechat API
|
|
@@ -730,6 +755,33 @@ class SidechatAPIClient {
|
|
|
730
755
|
}
|
|
731
756
|
};
|
|
732
757
|
|
|
758
|
+
/**
|
|
759
|
+
* Searches for new groups based on a query keyword
|
|
760
|
+
* @method
|
|
761
|
+
* @since 2.6.0
|
|
762
|
+
* @param {String} query - the string to search for. This will be encoded, so strings with spaces and special characters are okay.
|
|
763
|
+
* @returns {SidechatGroup[]}
|
|
764
|
+
*/
|
|
765
|
+
searchAvailableGroups = async (query) => {
|
|
766
|
+
if (!this.userToken) {
|
|
767
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
768
|
+
}
|
|
769
|
+
try {
|
|
770
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/explore/search?term=${encodeURIComponent(query)}`, {
|
|
771
|
+
method: "GET",
|
|
772
|
+
headers: {
|
|
773
|
+
...this.defaultHeaders,
|
|
774
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
775
|
+
},
|
|
776
|
+
});
|
|
777
|
+
const json = await res.json();
|
|
778
|
+
return await json.results;
|
|
779
|
+
} catch (err) {
|
|
780
|
+
console.error(err);
|
|
781
|
+
throw new SidechatAPIError(`Failed to search groups.`);
|
|
782
|
+
}
|
|
783
|
+
};
|
|
784
|
+
|
|
733
785
|
/**
|
|
734
786
|
* 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.
|
|
735
787
|
* @method
|
|
@@ -1060,10 +1112,7 @@ class SidechatAPIClient {
|
|
|
1060
1112
|
uri: uri,
|
|
1061
1113
|
});
|
|
1062
1114
|
|
|
1063
|
-
const urlReq = await this.sendRequest(
|
|
1064
|
-
`/v1/assets/upload_url?content_type=${imageType}`,
|
|
1065
|
-
"GET"
|
|
1066
|
-
);
|
|
1115
|
+
const urlReq = await this.sendRequest(`/v1/assets/upload_url?content_type=${imageType}`);
|
|
1067
1116
|
const urlJson = await urlReq.json();
|
|
1068
1117
|
|
|
1069
1118
|
try {
|
|
@@ -1087,7 +1136,7 @@ class SidechatAPIClient {
|
|
|
1087
1136
|
};
|
|
1088
1137
|
|
|
1089
1138
|
/**
|
|
1090
|
-
* Sets the conversation icon of
|
|
1139
|
+
* Sets the conversation icon of a user
|
|
1091
1140
|
* @method
|
|
1092
1141
|
* @since 2.2.1
|
|
1093
1142
|
* @param {String} userID - alphanumeric ID of user
|
|
@@ -1124,6 +1173,37 @@ class SidechatAPIClient {
|
|
|
1124
1173
|
}
|
|
1125
1174
|
};
|
|
1126
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Sets the bio text of a user
|
|
1178
|
+
* @method
|
|
1179
|
+
* @since 2.5.6
|
|
1180
|
+
* @param {String} userID - alphanumeric ID of user
|
|
1181
|
+
* @param {String} bio - text to set as bio
|
|
1182
|
+
*/
|
|
1183
|
+
setUserBio = async (userID, bio) => {
|
|
1184
|
+
if (!this.userToken) {
|
|
1185
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1186
|
+
}
|
|
1187
|
+
try {
|
|
1188
|
+
const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
|
|
1189
|
+
method: "PATCH",
|
|
1190
|
+
headers: {
|
|
1191
|
+
...this.defaultHeaders,
|
|
1192
|
+
"App-Version": "5.4.22",
|
|
1193
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1194
|
+
},
|
|
1195
|
+
body: JSON.stringify({
|
|
1196
|
+
bio: bio
|
|
1197
|
+
}),
|
|
1198
|
+
});
|
|
1199
|
+
const json = await res.json();
|
|
1200
|
+
return await json;
|
|
1201
|
+
} catch (err) {
|
|
1202
|
+
console.error(err);
|
|
1203
|
+
throw new SidechatAPIError(`Failed to set bio.`);
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1127
1207
|
/**
|
|
1128
1208
|
* Checks if user can set their username to a string
|
|
1129
1209
|
* @method
|
|
@@ -1187,6 +1267,60 @@ class SidechatAPIClient {
|
|
|
1187
1267
|
}
|
|
1188
1268
|
};
|
|
1189
1269
|
|
|
1270
|
+
/**
|
|
1271
|
+
* Fetches a public user profile
|
|
1272
|
+
* @method
|
|
1273
|
+
* @since 2.6.0
|
|
1274
|
+
* @param {String} username - username of the user to fetch
|
|
1275
|
+
* @returns {SidechatProfile}
|
|
1276
|
+
*/
|
|
1277
|
+
getUserProfile = async (username) => {
|
|
1278
|
+
if (!this.userToken) {
|
|
1279
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1280
|
+
}
|
|
1281
|
+
try {
|
|
1282
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/username?username=${username}`, {
|
|
1283
|
+
method: "GET",
|
|
1284
|
+
headers: {
|
|
1285
|
+
...this.defaultHeaders,
|
|
1286
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
const json = await res.json();
|
|
1290
|
+
return await json.group;
|
|
1291
|
+
} catch (err) {
|
|
1292
|
+
console.error(err);
|
|
1293
|
+
throw new SidechatAPIError(`Failed to set icon.`);
|
|
1294
|
+
}
|
|
1295
|
+
};
|
|
1296
|
+
|
|
1297
|
+
/**
|
|
1298
|
+
* Fetches a public user's posts
|
|
1299
|
+
* @method
|
|
1300
|
+
* @since 2.6.0
|
|
1301
|
+
* @param {String} username - username of the user to fetch
|
|
1302
|
+
* @returns {SidechatPostOrComment[]}
|
|
1303
|
+
*/
|
|
1304
|
+
getUserPosts = async (username) => {
|
|
1305
|
+
if (!this.userToken) {
|
|
1306
|
+
throw new SidechatAPIError("User is not authenticated.");
|
|
1307
|
+
}
|
|
1308
|
+
try {
|
|
1309
|
+
const res = await fetch(`${this.apiRoot}/v1/users/posts?username=${username}`, {
|
|
1310
|
+
method: "GET",
|
|
1311
|
+
headers: {
|
|
1312
|
+
...this.defaultHeaders,
|
|
1313
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
1314
|
+
}
|
|
1315
|
+
});
|
|
1316
|
+
const json = await res.json();
|
|
1317
|
+
return await json.posts;
|
|
1318
|
+
} catch (err) {
|
|
1319
|
+
console.error(err);
|
|
1320
|
+
throw new SidechatAPIError(`Failed to set icon.`);
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1190
1324
|
/**
|
|
1191
1325
|
* Marks an activity item as read
|
|
1192
1326
|
* @method
|
|
@@ -1242,8 +1376,13 @@ class SidechatAPIClient {
|
|
|
1242
1376
|
};
|
|
1243
1377
|
|
|
1244
1378
|
/**
|
|
1245
|
-
* Joins a group chat
|
|
1379
|
+
* Joins a group chat. To mimic the official client, use the user's display name and icon by default.
|
|
1246
1380
|
* @method
|
|
1381
|
+
* @param {String} groupChatID - alphanumeric ID of group chat to join
|
|
1382
|
+
* @param {String} displayName - display name to use in chat
|
|
1383
|
+
* @param {String} emoji - emoji to use as icon
|
|
1384
|
+
* @param {String} primaryColor - hex string of primary color
|
|
1385
|
+
* @param {String} secondaryColor - hex string of secondary color
|
|
1247
1386
|
* @since 2.3.5
|
|
1248
1387
|
*/
|
|
1249
1388
|
joinGroupChat = async (
|
|
@@ -13,7 +13,7 @@ export type SidechatPostOrComment = {
|
|
|
13
13
|
*/
|
|
14
14
|
id: string;
|
|
15
15
|
/**
|
|
16
|
-
* -
|
|
16
|
+
* - whether or not the post or comment was created by the current user
|
|
17
17
|
*/
|
|
18
18
|
authored_by_user: boolean;
|
|
19
19
|
/**
|
|
@@ -69,11 +69,11 @@ export type SidechatPostOrComment = {
|
|
|
69
69
|
*/
|
|
70
70
|
pinned: boolean;
|
|
71
71
|
/**
|
|
72
|
-
* -
|
|
72
|
+
* - whether or not the current user has saved the post
|
|
73
73
|
*/
|
|
74
74
|
is_saved: boolean;
|
|
75
75
|
/**
|
|
76
|
-
* -
|
|
76
|
+
* - whether or not the current user should recieve activity notifications for the post
|
|
77
77
|
*/
|
|
78
78
|
follow_status: "following" | "not_following";
|
|
79
79
|
/**
|
|
@@ -246,6 +246,23 @@ export type SidechatIdentity = {
|
|
|
246
246
|
*/
|
|
247
247
|
posted_with_username: boolean;
|
|
248
248
|
};
|
|
249
|
+
/**
|
|
250
|
+
* A conversation icon associated with a user
|
|
251
|
+
*/
|
|
252
|
+
export type SidechatIcon = {
|
|
253
|
+
/**
|
|
254
|
+
* - unicode emoji character
|
|
255
|
+
*/
|
|
256
|
+
emoji: string;
|
|
257
|
+
/**
|
|
258
|
+
* - primary hex color code
|
|
259
|
+
*/
|
|
260
|
+
color: string;
|
|
261
|
+
/**
|
|
262
|
+
* - secondary hex color code
|
|
263
|
+
*/
|
|
264
|
+
secondary_color: string;
|
|
265
|
+
};
|
|
249
266
|
/**
|
|
250
267
|
* The current user's information
|
|
251
268
|
*/
|
|
@@ -280,6 +297,55 @@ export type SidechatCurrentUser = {
|
|
|
280
297
|
*/
|
|
281
298
|
wildcardEmailDomain: string;
|
|
282
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* A user's public profile
|
|
302
|
+
*/
|
|
303
|
+
export type SidechatProfile = {
|
|
304
|
+
/**
|
|
305
|
+
* - alphanumeric ID of user
|
|
306
|
+
*/
|
|
307
|
+
id: string;
|
|
308
|
+
/**
|
|
309
|
+
* - public-facing username
|
|
310
|
+
*/
|
|
311
|
+
name: string;
|
|
312
|
+
/**
|
|
313
|
+
* - icon associated with user
|
|
314
|
+
*/
|
|
315
|
+
conversation_icon: SidechatIcon;
|
|
316
|
+
/**
|
|
317
|
+
* - the user bio
|
|
318
|
+
*/
|
|
319
|
+
description: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* - undocumented
|
|
322
|
+
*/
|
|
323
|
+
index_name: string;
|
|
324
|
+
/**
|
|
325
|
+
* - undocumented
|
|
326
|
+
*/
|
|
327
|
+
analytics_name: string;
|
|
328
|
+
/**
|
|
329
|
+
* - undocumented
|
|
330
|
+
*/
|
|
331
|
+
color: string;
|
|
332
|
+
/**
|
|
333
|
+
* - undocumented
|
|
334
|
+
*/
|
|
335
|
+
share_color_start: string;
|
|
336
|
+
/**
|
|
337
|
+
* - undocumented
|
|
338
|
+
*/
|
|
339
|
+
share_color_end: string;
|
|
340
|
+
/**
|
|
341
|
+
* - undocumented
|
|
342
|
+
*/
|
|
343
|
+
group_join_type: "account";
|
|
344
|
+
/**
|
|
345
|
+
* - the profile visibility status
|
|
346
|
+
*/
|
|
347
|
+
group_visibility: "public_to_all";
|
|
348
|
+
};
|
|
283
349
|
/**
|
|
284
350
|
* Representation of a group membership
|
|
285
351
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidechatTypes.d.ts","sourceRoot":"","sources":["../../src/types/SidechatTypes.js"],"names":[],"mappings":";;;;;;;;;UAGU,MAAM,GAAC,SAAS;;;;;;;;;;;;;;;;;;;;WAKhB,aAAa;;;;;;;;;;;;;;;;iBAIb,kBAAkB;;;;YAClB,mBAAmB,EAAE;;;;;;;;;;;;UAGrB,QAAQ;;;;cACR,gBAAgB;;;;;;;;;;;;mBAGhB,WAAW,GAAC,eAAe;;;;kBAC3B,OAAO;;;;;;;;;;;;WAGP,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAYZ,YAAY,GAAC,QAAQ;;;;;;;;qBAErB,MAAM,GAAC,QAAQ,GAAC,cAAc;;;;sBAC9B,SAAS,GAAC,eAAe,GAAC,mBAAmB;;;;8BAC7C,MAAM,GAAC,MAAM;;;;;;;;;;;;eAGb,uBAAuB;;;;;;;;;;;;;;;;;;;;;UASvB,OAAO;;;;kBACP,MAAM,GAAC,KAAK,GAAC,KAAK;;;;;;;;;;;;UAGlB,uBAAuB;;;;;;;;;;;;;;;;;cAQvB,qBAAqB;;;;SACrB,uBAAuB;;;;;;;;;;;;;;;;;UAQvB,OAAO;;;;kBACP,MAAM,GAAC,KAAK,GAAC,KAAK
|
|
1
|
+
{"version":3,"file":"SidechatTypes.d.ts","sourceRoot":"","sources":["../../src/types/SidechatTypes.js"],"names":[],"mappings":";;;;;;;;;UAGU,MAAM,GAAC,SAAS;;;;;;;;;;;;;;;;;;;;WAKhB,aAAa;;;;;;;;;;;;;;;;iBAIb,kBAAkB;;;;YAClB,mBAAmB,EAAE;;;;;;;;;;;;UAGrB,QAAQ;;;;cACR,gBAAgB;;;;;;;;;;;;mBAGhB,WAAW,GAAC,eAAe;;;;kBAC3B,OAAO;;;;;;;;;;;;WAGP,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAYZ,YAAY,GAAC,QAAQ;;;;;;;;qBAErB,MAAM,GAAC,QAAQ,GAAC,cAAc;;;;sBAC9B,SAAS,GAAC,eAAe,GAAC,mBAAmB;;;;8BAC7C,MAAM,GAAC,MAAM;;;;;;;;;;;;eAGb,uBAAuB;;;;;;;;;;;;;;;;;;;;;UASvB,OAAO;;;;kBACP,MAAM,GAAC,KAAK,GAAC,KAAK;;;;;;;;;;;;UAGlB,uBAAuB;;;;;;;;;;;;;;;;;cAQvB,qBAAqB;;;;SACrB,uBAAuB;;;;;;;;;;;;;;;;;UAQvB,OAAO;;;;kBACP,MAAM,GAAC,KAAK,GAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBlB,kBAAkB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAWpB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAOZ,SAAS;;;;sBACT,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;iCAsBZ,QAAQ,GAAC,UAAU,GAAC,MAAM;;;;;;;;;WAW7B,qBAAqB,EAAE;YACvB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAYpB,UAAU;;;;UACV,MAAM,GAAC,SAAS;;;;cAChB,qBAAqB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAavB,SAAS;;;;;;;;;;;;;;;;;aAQT,kBAAkB,EAAE"}
|