sidechat.js 2.3.8 → 2.4.1
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 +17 -2
- package/dist/classes/SidechatAPIClient.d.ts.map +1 -1
- package/dist/index.cjs +99 -92
- package/dist/index.mjs +99 -92
- package/docs/sidechat.js/2.4.0/SidechatAPIClient.html +3 -0
- package/docs/sidechat.js/{2.3.8 → 2.4.0}/classes_SidechatAPIClient.js.html +95 -91
- package/docs/sidechat.js/2.4.0/data/search.json +1 -0
- package/package.json +54 -54
- package/src/classes/SidechatAPIClient.js +99 -92
- package/src/tests/postTest.js +2 -1
- package/docs/sidechat.js/2.3.8/SidechatAPIClient.html +0 -3
- package/docs/sidechat.js/2.3.8/data/search.json +0 -1
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/SidechatAPIError.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/SidechatColorList.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/classes_SidechatAPIError.js.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/classes_SidechatColorList.js.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/fonts/Inconsolata-Regular.ttf +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/fonts/OpenSans-Regular.ttf +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/fonts/WorkSans-Bold.ttf +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/global.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/index.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/core.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/core.min.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/resize.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/search.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/search.min.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/Apache-License-2.0.txt +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/fuse.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/hljs-line-num-original.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/hljs-line-num.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/hljs-original.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/hljs.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/popper.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/tippy.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/tocbot.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/scripts/third-party/tocbot.min.js +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/styles/clean-jsdoc-theme-base.css +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/styles/clean-jsdoc-theme-dark.css +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/styles/clean-jsdoc-theme-light.css +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/styles/clean-jsdoc-theme.min.css +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/tutorial-Authentication.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/tutorial-Email Registration.html +0 -0
- /package/docs/sidechat.js/{2.3.8 → 2.4.0}/types_SidechatTypes.js.html +0 -0
|
@@ -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}
|
|
@@ -27,14 +28,25 @@ class SidechatAPIClient {
|
|
|
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(
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
152
|
-
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
186
|
-
{
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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,21 +224,18 @@ class SidechatAPIClient {
|
|
|
214
224
|
throw new SidechatAPIError("User is not authenticated.");
|
|
215
225
|
}
|
|
216
226
|
try {
|
|
217
|
-
const res = await fetch(
|
|
218
|
-
|
|
219
|
-
{
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
240
|
await AsyncStorage.setItem("deviceID", deviceID);
|
|
234
241
|
return json;
|
|
@@ -262,7 +269,7 @@ class SidechatAPIClient {
|
|
|
262
269
|
}
|
|
263
270
|
try {
|
|
264
271
|
const res = await fetch(
|
|
265
|
-
|
|
272
|
+
`${this.apiRoot}/v1/updates?group_id=${groupID}`,
|
|
266
273
|
{
|
|
267
274
|
method: "GET",
|
|
268
275
|
headers: {
|
|
@@ -294,7 +301,7 @@ class SidechatAPIClient {
|
|
|
294
301
|
}
|
|
295
302
|
try {
|
|
296
303
|
const res = await fetch(
|
|
297
|
-
|
|
304
|
+
`${this.apiRoot}/v1/posts?group_id=${groupID}&type=${category}${
|
|
298
305
|
cursor ? "&cursor=" + cursor : ""
|
|
299
306
|
}`,
|
|
300
307
|
{
|
|
@@ -325,7 +332,7 @@ class SidechatAPIClient {
|
|
|
325
332
|
throw new SidechatAPIError("User is not authenticated.");
|
|
326
333
|
}
|
|
327
334
|
try {
|
|
328
|
-
const res = await fetch(
|
|
335
|
+
const res = await fetch(`${this.apiRoot}/v1/posts/set_vote`, {
|
|
329
336
|
method: "POST",
|
|
330
337
|
headers: {
|
|
331
338
|
...this.defaultHeaders,
|
|
@@ -358,7 +365,7 @@ class SidechatAPIClient {
|
|
|
358
365
|
}
|
|
359
366
|
try {
|
|
360
367
|
const res = await fetch(
|
|
361
|
-
|
|
368
|
+
`${this.apiRoot}/v1/posts/get?include_deleted=${includeDeleted}&post_id=${postID}`,
|
|
362
369
|
{
|
|
363
370
|
method: "GET",
|
|
364
371
|
headers: {
|
|
@@ -392,16 +399,13 @@ class SidechatAPIClient {
|
|
|
392
399
|
contentType = "my_comments";
|
|
393
400
|
}
|
|
394
401
|
try {
|
|
395
|
-
const res = await fetch(
|
|
396
|
-
|
|
397
|
-
{
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
}
|
|
404
|
-
);
|
|
402
|
+
const res = await fetch(`${this.apiRoot}/v1/posts&type=${contentType}`, {
|
|
403
|
+
method: "GET",
|
|
404
|
+
headers: {
|
|
405
|
+
...this.defaultHeaders,
|
|
406
|
+
Authorization: `Bearer ${this.userToken}`,
|
|
407
|
+
},
|
|
408
|
+
});
|
|
405
409
|
const json = await res.json();
|
|
406
410
|
return json.posts;
|
|
407
411
|
} catch (err) {
|
|
@@ -423,7 +427,7 @@ class SidechatAPIClient {
|
|
|
423
427
|
}
|
|
424
428
|
try {
|
|
425
429
|
const res = await fetch(
|
|
426
|
-
|
|
430
|
+
`${this.apiRoot}/v1/posts/comments/?post_id=${postID}`,
|
|
427
431
|
{
|
|
428
432
|
method: "GET",
|
|
429
433
|
headers: {
|
|
@@ -498,7 +502,7 @@ class SidechatAPIClient {
|
|
|
498
502
|
throw new SidechatAPIError("User is not authenticated.");
|
|
499
503
|
}
|
|
500
504
|
try {
|
|
501
|
-
const res = await fetch(
|
|
505
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/explore`, {
|
|
502
506
|
method: "GET",
|
|
503
507
|
headers: {
|
|
504
508
|
...this.defaultHeaders,
|
|
@@ -525,7 +529,7 @@ class SidechatAPIClient {
|
|
|
525
529
|
throw new SidechatAPIError("User is not authenticated.");
|
|
526
530
|
}
|
|
527
531
|
try {
|
|
528
|
-
const res = await fetch(
|
|
532
|
+
const res = await fetch(`${this.apiRoot}/v1/assets/library`, {
|
|
529
533
|
method: "GET",
|
|
530
534
|
headers: {
|
|
531
535
|
...this.defaultHeaders,
|
|
@@ -551,7 +555,7 @@ class SidechatAPIClient {
|
|
|
551
555
|
throw new SidechatAPIError("User is not authenticated.");
|
|
552
556
|
}
|
|
553
557
|
try {
|
|
554
|
-
const res = await fetch(
|
|
558
|
+
const res = await fetch(`${this.apiRoot}/v1/users/me`, {
|
|
555
559
|
method: "GET",
|
|
556
560
|
headers: {
|
|
557
561
|
...this.defaultHeaders,
|
|
@@ -578,7 +582,7 @@ class SidechatAPIClient {
|
|
|
578
582
|
throw new SidechatAPIError("User is not authenticated.");
|
|
579
583
|
}
|
|
580
584
|
try {
|
|
581
|
-
const res = await fetch(
|
|
585
|
+
const res = await fetch(`${this.apiRoot}/v1/groups/${groupID}`, {
|
|
582
586
|
method: "GET",
|
|
583
587
|
headers: {
|
|
584
588
|
...this.defaultHeaders,
|
|
@@ -606,7 +610,7 @@ class SidechatAPIClient {
|
|
|
606
610
|
}
|
|
607
611
|
try {
|
|
608
612
|
const res = await fetch(
|
|
609
|
-
|
|
613
|
+
`${this.apiRoot}/v1/groups/${isMember ? "join" : "leave"}`,
|
|
610
614
|
{
|
|
611
615
|
method: "POST",
|
|
612
616
|
headers: {
|
|
@@ -650,7 +654,7 @@ class SidechatAPIClient {
|
|
|
650
654
|
throw new SidechatAPIError("User is not authenticated.");
|
|
651
655
|
}
|
|
652
656
|
try {
|
|
653
|
-
const res = await fetch(
|
|
657
|
+
const res = await fetch(`${this.apiRoot}/v1/posts`, {
|
|
654
658
|
method: "POST",
|
|
655
659
|
headers: {
|
|
656
660
|
...this.defaultHeaders,
|
|
@@ -698,7 +702,7 @@ class SidechatAPIClient {
|
|
|
698
702
|
throw new SidechatAPIError("User is not authenticated.");
|
|
699
703
|
}
|
|
700
704
|
try {
|
|
701
|
-
const res = await fetch(
|
|
705
|
+
const res = await fetch(`${this.apiRoot}/v1/posts`, {
|
|
702
706
|
method: "POST",
|
|
703
707
|
headers: {
|
|
704
708
|
...this.defaultHeaders,
|
|
@@ -734,7 +738,7 @@ class SidechatAPIClient {
|
|
|
734
738
|
throw new SidechatAPIError("User is not authenticated.");
|
|
735
739
|
}
|
|
736
740
|
try {
|
|
737
|
-
const res = await fetch(
|
|
741
|
+
const res = await fetch(`${this.apiRoot}/v1/posts/delete`, {
|
|
738
742
|
method: "POST",
|
|
739
743
|
headers: {
|
|
740
744
|
...this.defaultHeaders,
|
|
@@ -766,7 +770,7 @@ class SidechatAPIClient {
|
|
|
766
770
|
throw new SidechatAPIError("User is not authenticated.");
|
|
767
771
|
}
|
|
768
772
|
try {
|
|
769
|
-
const res = await fetch(
|
|
773
|
+
const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
|
|
770
774
|
method: "PATCH",
|
|
771
775
|
headers: {
|
|
772
776
|
...this.defaultHeaders,
|
|
@@ -803,7 +807,7 @@ class SidechatAPIClient {
|
|
|
803
807
|
}
|
|
804
808
|
try {
|
|
805
809
|
const res = await fetch(
|
|
806
|
-
|
|
810
|
+
`${this.apiRoot}/v1/users/username?username=${username}`,
|
|
807
811
|
{
|
|
808
812
|
method: "GET",
|
|
809
813
|
headers: {
|
|
@@ -835,7 +839,7 @@ class SidechatAPIClient {
|
|
|
835
839
|
throw new SidechatAPIError("User is not authenticated.");
|
|
836
840
|
}
|
|
837
841
|
try {
|
|
838
|
-
const res = await fetch(
|
|
842
|
+
const res = await fetch(`${this.apiRoot}/v1/users/${userID}`, {
|
|
839
843
|
method: "PATCH",
|
|
840
844
|
headers: {
|
|
841
845
|
...this.defaultHeaders,
|
|
@@ -864,7 +868,7 @@ class SidechatAPIClient {
|
|
|
864
868
|
throw new SidechatAPIError("User is not authenticated.");
|
|
865
869
|
}
|
|
866
870
|
try {
|
|
867
|
-
const res = await fetch(
|
|
871
|
+
const res = await fetch(`${this.apiRoot}/v1/activity/seen`, {
|
|
868
872
|
method: "POST",
|
|
869
873
|
headers: {
|
|
870
874
|
...this.defaultHeaders,
|
|
@@ -892,7 +896,7 @@ class SidechatAPIClient {
|
|
|
892
896
|
throw new SidechatAPIError("User is not authenticated.");
|
|
893
897
|
}
|
|
894
898
|
try {
|
|
895
|
-
const res = await fetch(
|
|
899
|
+
const res = await fetch(`${this.apiRoot}/v1/chats/explore`, {
|
|
896
900
|
method: "GET",
|
|
897
901
|
headers: {
|
|
898
902
|
...this.defaultHeaders,
|
|
@@ -923,7 +927,7 @@ class SidechatAPIClient {
|
|
|
923
927
|
throw new SidechatAPIError("User is not authenticated.");
|
|
924
928
|
}
|
|
925
929
|
try {
|
|
926
|
-
const res = await fetch(
|
|
930
|
+
const res = await fetch(`${this.apiRoot}/v1/chats/groups/join`, {
|
|
927
931
|
method: "GET",
|
|
928
932
|
headers: {
|
|
929
933
|
...this.defaultHeaders,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"list":[{"title":"SidechatAPIClient","link":"<a href=\"SidechatAPIClient.html\">SidechatAPIClient</a>","description":"<p>Create a new instance of the API client</p>"},{"title":"SidechatAPIClient#apiRoot","link":"<a href=\"SidechatAPIClient.html#apiRoot\">apiRoot</a>","description":"<p>Root URL for every API request</p>"},{"title":"SidechatAPIClient#checkEmailVerification","link":"<a href=\"SidechatAPIClient.html#checkEmailVerification\">checkEmailVerification</a>","description":"<p>Check is the user's email is verified.</p>"},{"title":"SidechatAPIClient#checkUsername","link":"<a href=\"SidechatAPIClient.html#checkUsername\">checkUsername</a>","description":"<p>Checks if user can set their username to a string</p>"},{"title":"SidechatAPIClient#createComment","link":"<a href=\"SidechatAPIClient.html#createComment\">createComment</a>","description":"<p>Creates a comment on a post</p>"},{"title":"SidechatAPIClient#createPost","link":"<a href=\"SidechatAPIClient.html#createPost\">createPost</a>","description":"<p>Creates a new post in the specified group</p>"},{"title":"SidechatAPIClient#defaultHeaders","link":"<a href=\"SidechatAPIClient.html#defaultHeaders\">defaultHeaders</a>","description":"<p>Default headers for every API request</p>"},{"title":"SidechatAPIClient#deletePostOrComment","link":"<a href=\"SidechatAPIClient.html#deletePostOrComment\">deletePostOrComment</a>","description":"<p>Deletes a post or comment that the user created</p>"},{"title":"SidechatAPIClient#getAssetLibrary","link":"<a href=\"SidechatAPIClient.html#getAssetLibrary\">getAssetLibrary</a>","description":"<p>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.</p>"},{"title":"SidechatAPIClient#getAvailableGroups","link":"<a href=\"SidechatAPIClient.html#getAvailableGroups\">getAvailableGroups</a>","description":"<p>Gets groups to be displayed on the "Explore Groups" page</p>"},{"title":"SidechatAPIClient#getCurrentUser","link":"<a href=\"SidechatAPIClient.html#getCurrentUser\">getCurrentUser</a>","description":"<p>Gets the current authenticated user and a list of the groups of which they are members.</p>"},{"title":"SidechatAPIClient#getGroupChats","link":"<a href=\"SidechatAPIClient.html#getGroupChats\">getGroupChats</a>","description":"<p>Retrieves joinable group chats</p>"},{"title":"SidechatAPIClient#getGroupMetadata","link":"<a href=\"SidechatAPIClient.html#getGroupMetadata\">getGroupMetadata</a>","description":"<p>Gets the metadata of a group from its ID</p>"},{"title":"SidechatAPIClient#getGroupPosts","link":"<a href=\"SidechatAPIClient.html#getGroupPosts\">getGroupPosts</a>","description":"<p>Fetches posts from the specified category in a group</p>"},{"title":"SidechatAPIClient#getPost","link":"<a href=\"SidechatAPIClient.html#getPost\">getPost</a>","description":"<p>Fetches a single post with just its ID</p>"},{"title":"SidechatAPIClient#getPostComments","link":"<a href=\"SidechatAPIClient.html#getPostComments\">getPostComments</a>","description":"<p>Get all the commments on a post</p>"},{"title":"SidechatAPIClient#getUpdates","link":"<a href=\"SidechatAPIClient.html#getUpdates\">getUpdates</a>","description":"<p>Get updated status for user and group</p>"},{"title":"SidechatAPIClient#getUserAndGroup","link":"<a href=\"SidechatAPIClient.html#getUserAndGroup\">getUserAndGroup</a>","description":"<p>Get updated status for user and group</p>"},{"title":"SidechatAPIClient#getUserContent","link":"<a href=\"SidechatAPIClient.html#getUserContent\">getUserContent</a>","description":"<p>Fetches the posts or comments that the user has created</p>"},{"title":"SidechatAPIClient#joinGroupChat","link":"<a href=\"SidechatAPIClient.html#joinGroupChat\">joinGroupChat</a>","description":"<p>Joins a group chat</p>"},{"title":"SidechatAPIClient#loginViaSMS","link":"<a href=\"SidechatAPIClient.html#loginViaSMS\">loginViaSMS</a>","description":"<p>Initiate the login process with a phone number. Should be followed up with verifySMSCode().</p>"},{"title":"SidechatAPIClient#readActivity","link":"<a href=\"SidechatAPIClient.html#readActivity\">readActivity</a>","description":"<p>Marks an activity item as read</p>"},{"title":"SidechatAPIClient#registerEmail","link":"<a href=\"SidechatAPIClient.html#registerEmail\">registerEmail</a>","description":"<p>Initiate the email setup process. Should be followed up with checkEmailVerification().</p>"},{"title":"SidechatAPIClient#setAPIRoot","link":"<a href=\"SidechatAPIClient.html#setAPIRoot\">setAPIRoot</a>","description":"<p>Manually set the root URL for all API requests. This can be used for mocking requests or redirecting them to a different server</p>"},{"title":"SidechatAPIClient#setAge","link":"<a href=\"SidechatAPIClient.html#setAge\">setAge</a>","description":"<p>Set the user's age. If this function succeeds, the user will be authenticated for future requests.</p>"},{"title":"SidechatAPIClient#setDeviceID","link":"<a href=\"SidechatAPIClient.html#setDeviceID\">setDeviceID</a>","description":"<p>Set the device ID of the current user</p>"},{"title":"SidechatAPIClient#setGroupMembership","link":"<a href=\"SidechatAPIClient.html#setGroupMembership\">setGroupMembership</a>","description":"<p>Joins or leaves a group</p>"},{"title":"SidechatAPIClient#setToken","link":"<a href=\"SidechatAPIClient.html#setToken\">setToken</a>","description":"<p>Manually set the currently signed in user's token. Generally try to avoid this and instead either pass a token to the constructor or login automatically through the auth functions</p>"},{"title":"SidechatAPIClient#setUserIcon","link":"<a href=\"SidechatAPIClient.html#setUserIcon\">setUserIcon</a>","description":"<p>Sets the conversation icon of the current user</p>"},{"title":"SidechatAPIClient#setUsername","link":"<a href=\"SidechatAPIClient.html#setUsername\">setUsername</a>","description":"<p>Changes the username of the current user</p>"},{"title":"SidechatAPIClient#setVote","link":"<a href=\"SidechatAPIClient.html#setVote\">setVote</a>","description":"<p>Upvote or downvote, or unvote a post</p>"},{"title":"SidechatAPIClient#userToken","link":"<a href=\"SidechatAPIClient.html#userToken\">userToken</a>","description":"<p>User bearer token</p>"},{"title":"SidechatAPIClient#verifySMSCode","link":"<a href=\"SidechatAPIClient.html#verifySMSCode\">verifySMSCode</a>","description":"<p>Verify the code sent via SMS with loginViaSMS(). If this function succeeds, the user will be authenticated for future requests.</p>"},{"title":"SidechatAPIError","link":"<a href=\"SidechatAPIError.html\">SidechatAPIError</a>"},{"title":"SidechatAssetMetadata","link":"<a href=\"global.html#SidechatAssetMetadata\">SidechatAssetMetadata</a>","description":"<p>An asset object, containing information about an image from the asset library</p>"},{"title":"SidechatAuthToken","link":"<a href=\"global.html#SidechatAuthToken\">SidechatAuthToken</a>","description":"<p>A user's bearer authentication token needed for most requests</p>"},{"title":"SidechatColor","link":"<a href=\"global.html#SidechatColor\">SidechatColor</a>"},{"title":"SidechatColorList","link":"<a href=\"SidechatColorList.html\">SidechatColorList</a>"},{"title":"SidechatCurrentUser","link":"<a href=\"global.html#SidechatCurrentUser\">SidechatCurrentUser</a>","description":"<p>The current user's information</p>"},{"title":"SidechatCursorString","link":"<a href=\"global.html#SidechatCursorString\">SidechatCursorString</a>","description":"<p>A cursor for paginating through post lists</p>"},{"title":"SidechatGroup","link":"<a href=\"global.html#SidechatGroup\">SidechatGroup</a>","description":"<p>A group object, containing metadata about a group as well as its join conditions and states. Some properties vary based on the endpoint the object came from.</p>"},{"title":"SidechatIdentity","link":"<a href=\"global.html#SidechatIdentity\">SidechatIdentity</a>","description":"<p>A user's anonymous identity information</p>"},{"title":"SidechatLibraryAsset","link":"<a href=\"global.html#SidechatLibraryAsset\">SidechatLibraryAsset</a>","description":"<p>An asset object, containing information about an image from the asset library</p>"},{"title":"SidechatMembership","link":"<a href=\"global.html#SidechatMembership\">SidechatMembership</a>","description":"<p>Representation of a group membership</p>"},{"title":"SidechatPostOrComment","link":"<a href=\"global.html#SidechatPostOrComment\">SidechatPostOrComment</a>","description":"<p>A user-created post or comment, depending on the "type" prop</p>"},{"title":"SidechatPostsAndCursor","link":"<a href=\"global.html#SidechatPostsAndCursor\">SidechatPostsAndCursor</a>","description":"<p>A list of posts and the associated cursor</p>"},{"title":"SidechatPrivateAssetURL","link":"<a href=\"global.html#SidechatPrivateAssetURL\">SidechatPrivateAssetURL</a>","description":"<p>An asset URL that can only be accessed by making a request with a user's bearer token attached in the Authorization header</p>"},{"title":"SidechatSimpleAsset","link":"<a href=\"global.html#SidechatSimpleAsset\">SidechatSimpleAsset</a>","description":"<p>An asset object, containing information about an image within a post or comment</p>"},{"title":"SidechatVoteString","link":"<a href=\"global.html#SidechatVoteString\">SidechatVoteString</a>","description":"<p>A vote on a comment or post</p>"}]}
|
package/package.json
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "sidechat.js",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "A reverse-engineered API wrapper for Sidechat",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"source": "./src/index.js",
|
|
7
|
-
"main": "./dist/index.cjs",
|
|
8
|
-
"module": "./dist/index.mjs",
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"import": {
|
|
13
|
-
"types": "./dist/index.d.mts",
|
|
14
|
-
"default": "./dist/index.mjs"
|
|
15
|
-
},
|
|
16
|
-
"require": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"default": "./dist/index.cjs"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"./src/types": {
|
|
22
|
-
"types": "./dist/types/SidechatTypes.d.ts",
|
|
23
|
-
"default": "./src/types/SidechatTypes.js"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"scripts": {
|
|
27
|
-
"build": "rollup -c",
|
|
28
|
-
"dev": "rollup -c --watch",
|
|
29
|
-
"docs": "jsdoc --configure jsdoc.json --verbose",
|
|
30
|
-
"prepublish": "tsc",
|
|
31
|
-
"typegen": "tsc"
|
|
32
|
-
},
|
|
33
|
-
"repository": {
|
|
34
|
-
"type": "git",
|
|
35
|
-
"url": "git+https://github.com/micahlt/sidechat.js.git"
|
|
36
|
-
},
|
|
37
|
-
"author": "Micah Lindley",
|
|
38
|
-
"license": "MIT",
|
|
39
|
-
"bugs": {
|
|
40
|
-
"url": "https://github.com/micahlt/sidechat.js/issues"
|
|
41
|
-
},
|
|
42
|
-
"homepage": "https://github.com/micahlt/sidechat.js#readme",
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=18.0.0"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"clean-jsdoc-theme": "^4.2.
|
|
48
|
-
"dotenv": "^16.4.5",
|
|
49
|
-
"prompt-sync": "^4.2.0",
|
|
50
|
-
"rollup": "^2.79.1",
|
|
51
|
-
"rollup-plugin-copy": "^3.5.0",
|
|
52
|
-
"typescript": "^5.4.
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "sidechat.js",
|
|
3
|
+
"version": "2.4.1",
|
|
4
|
+
"description": "A reverse-engineered API wrapper for Sidechat",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"source": "./src/index.js",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.mjs",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./src/types": {
|
|
22
|
+
"types": "./dist/types/SidechatTypes.d.ts",
|
|
23
|
+
"default": "./src/types/SidechatTypes.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "rollup -c",
|
|
28
|
+
"dev": "rollup -c --watch",
|
|
29
|
+
"docs": "jsdoc --configure jsdoc.json --verbose",
|
|
30
|
+
"prepublish": "tsc",
|
|
31
|
+
"typegen": "tsc"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/micahlt/sidechat.js.git"
|
|
36
|
+
},
|
|
37
|
+
"author": "Micah Lindley",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/micahlt/sidechat.js/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/micahlt/sidechat.js#readme",
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"clean-jsdoc-theme": "^4.2.18",
|
|
48
|
+
"dotenv": "^16.4.5",
|
|
49
|
+
"prompt-sync": "^4.2.0",
|
|
50
|
+
"rollup": "^2.79.1",
|
|
51
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
52
|
+
"typescript": "^5.4.5"
|
|
53
|
+
}
|
|
54
|
+
}
|