sidechat.js 2.2.3 → 2.2.5
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.map +1 -1
- package/dist/index.cjs +26 -19
- package/dist/index.mjs +26 -19
- package/package.json +1 -1
- package/src/classes/SidechatAPIClient.js +26 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidechatAPIClient.d.ts","sourceRoot":"","sources":["../../src/classes/SidechatAPIClient.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"SidechatAPIClient.d.ts","sourceRoot":"","sources":["../../src/classes/SidechatAPIClient.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;IAmBE;;;OAGG;IACH,uCAIC;IA1BD;;;SAGK;IACL,6BAAU;IACV;;;;;OAKG;IACH,oBAKE;IAYF;;;;OAIG;IACH,6CAEE;IAEF;;;;;OAKG;IACH,mDAgBE;IAEF;;;;;;OAMG;IACH,mEAsBE;IAEF;;;;;;OAMG;IACH,8DAyBE;IAEF;;;;;;OAMG;IACH,+CA2BE;IAEF;;;;OAIG;IACH,2CAyBE;IAEF;;;;;OAKG;IACH,6CA2BE;IAEF;;;;;;OAMG;IACH,oDAGE;IAEF;;;;;OAKG;IACH,+CAqBE;IAEF;;;;;;;;OAQG;IACH,4CAJW,KAAK,GAAC,QAAQ,GAAC,KAAK,2DA2B7B;IAEF;;;;;;OAMG;IACH,sEAsBE;IAEF;;;;;;OAMG;IACH,qCAFa,uBAAuB,CAqElC;IAEF;;;;;OAKG;IACH,0BAFa,eAAe,CAsB1B;IAEF;;;;;OAKG;IACH,uBAFa,sBAAsB,CAoBjC;IAEF;;;;;OAKG;IACH,0CAkBE;IAEF;;;;;;OAMG;IACH,sDAkBE;IAEF;;;;;;;;;;;OAWG;IACH,0GAJW,qBAAqB,iDAwC9B;IAEF;;;;;;;;;;OAUG;IACH,wDALW,qBAAqB,4EAwC9B;IAEF;;;;;OAKG;IACH,+DAqBE;IAEF;;;;;;;;OAQG;IACH,2GA0BE;CACH"}
|
package/dist/index.cjs
CHANGED
|
@@ -35,6 +35,7 @@ class SidechatAPIClient {
|
|
|
35
35
|
Accept: "application/json",
|
|
36
36
|
"Content-Type": "application/json",
|
|
37
37
|
"App-Version": "10.0.0",
|
|
38
|
+
Dnt: "1",
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -444,8 +445,10 @@ class SidechatAPIClient {
|
|
|
444
445
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
445
446
|
method: "GET",
|
|
446
447
|
headers: {
|
|
447
|
-
|
|
448
|
+
Accept: "application/json",
|
|
449
|
+
"Content-Type": "application/json",
|
|
448
450
|
Authorization: `Bearer ${this.userToken}`,
|
|
451
|
+
Dnt: "1",
|
|
449
452
|
},
|
|
450
453
|
});
|
|
451
454
|
const json = await res.json();
|
|
@@ -559,21 +562,23 @@ class SidechatAPIClient {
|
|
|
559
562
|
throw new SidechatAPIError("User is not authenticated.");
|
|
560
563
|
}
|
|
561
564
|
try {
|
|
565
|
+
const data = JSON.stringify({
|
|
566
|
+
type: "comment",
|
|
567
|
+
assets: assetList,
|
|
568
|
+
group_ids: [groupID],
|
|
569
|
+
text: text,
|
|
570
|
+
reply_post_id: replyCommentID,
|
|
571
|
+
parent_post_id: parentPostID,
|
|
572
|
+
dms_disabled: disableDMs,
|
|
573
|
+
});
|
|
562
574
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
563
575
|
method: "POST",
|
|
564
576
|
headers: {
|
|
565
577
|
...this.defaultHeaders,
|
|
566
578
|
Authorization: `Bearer ${this.userToken}`,
|
|
579
|
+
"Content-Length": data.length,
|
|
567
580
|
},
|
|
568
|
-
body:
|
|
569
|
-
type: "comment",
|
|
570
|
-
assets: assetList,
|
|
571
|
-
group_ids: [groupID],
|
|
572
|
-
text: text,
|
|
573
|
-
reply_post_id: replyCommentID,
|
|
574
|
-
parent_post_id: parentPostID,
|
|
575
|
-
dms_disabled: disableDMs,
|
|
576
|
-
}),
|
|
581
|
+
body: data,
|
|
577
582
|
});
|
|
578
583
|
const json = await res.json();
|
|
579
584
|
return await json.comment;
|
|
@@ -605,21 +610,23 @@ class SidechatAPIClient {
|
|
|
605
610
|
throw new SidechatAPIError("User is not authenticated.");
|
|
606
611
|
}
|
|
607
612
|
try {
|
|
613
|
+
const data = JSON.stringify({
|
|
614
|
+
type: "post",
|
|
615
|
+
assets: assetList,
|
|
616
|
+
group_ids: [groupID],
|
|
617
|
+
text: text,
|
|
618
|
+
attachments: [],
|
|
619
|
+
dms_disabled: disableDMs,
|
|
620
|
+
comments_disabled: disableComments,
|
|
621
|
+
});
|
|
608
622
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
609
623
|
method: "POST",
|
|
610
624
|
headers: {
|
|
611
625
|
...this.defaultHeaders,
|
|
612
626
|
Authorization: `Bearer ${this.userToken}`,
|
|
627
|
+
"Content-Length": data.length,
|
|
613
628
|
},
|
|
614
|
-
body:
|
|
615
|
-
type: "post",
|
|
616
|
-
assets: assetList,
|
|
617
|
-
group_ids: [groupID],
|
|
618
|
-
text: text,
|
|
619
|
-
attachments: [],
|
|
620
|
-
dms_disabled: disableDMs,
|
|
621
|
-
comments_disabled: disableComments,
|
|
622
|
-
}),
|
|
629
|
+
body: data,
|
|
623
630
|
});
|
|
624
631
|
const json = await res.json();
|
|
625
632
|
return await json.posts[0];
|
package/dist/index.mjs
CHANGED
|
@@ -31,6 +31,7 @@ class SidechatAPIClient {
|
|
|
31
31
|
Accept: "application/json",
|
|
32
32
|
"Content-Type": "application/json",
|
|
33
33
|
"App-Version": "10.0.0",
|
|
34
|
+
Dnt: "1",
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
/**
|
|
@@ -440,8 +441,10 @@ class SidechatAPIClient {
|
|
|
440
441
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
441
442
|
method: "GET",
|
|
442
443
|
headers: {
|
|
443
|
-
|
|
444
|
+
Accept: "application/json",
|
|
445
|
+
"Content-Type": "application/json",
|
|
444
446
|
Authorization: `Bearer ${this.userToken}`,
|
|
447
|
+
Dnt: "1",
|
|
445
448
|
},
|
|
446
449
|
});
|
|
447
450
|
const json = await res.json();
|
|
@@ -555,21 +558,23 @@ class SidechatAPIClient {
|
|
|
555
558
|
throw new SidechatAPIError("User is not authenticated.");
|
|
556
559
|
}
|
|
557
560
|
try {
|
|
561
|
+
const data = JSON.stringify({
|
|
562
|
+
type: "comment",
|
|
563
|
+
assets: assetList,
|
|
564
|
+
group_ids: [groupID],
|
|
565
|
+
text: text,
|
|
566
|
+
reply_post_id: replyCommentID,
|
|
567
|
+
parent_post_id: parentPostID,
|
|
568
|
+
dms_disabled: disableDMs,
|
|
569
|
+
});
|
|
558
570
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
559
571
|
method: "POST",
|
|
560
572
|
headers: {
|
|
561
573
|
...this.defaultHeaders,
|
|
562
574
|
Authorization: `Bearer ${this.userToken}`,
|
|
575
|
+
"Content-Length": data.length,
|
|
563
576
|
},
|
|
564
|
-
body:
|
|
565
|
-
type: "comment",
|
|
566
|
-
assets: assetList,
|
|
567
|
-
group_ids: [groupID],
|
|
568
|
-
text: text,
|
|
569
|
-
reply_post_id: replyCommentID,
|
|
570
|
-
parent_post_id: parentPostID,
|
|
571
|
-
dms_disabled: disableDMs,
|
|
572
|
-
}),
|
|
577
|
+
body: data,
|
|
573
578
|
});
|
|
574
579
|
const json = await res.json();
|
|
575
580
|
return await json.comment;
|
|
@@ -601,21 +606,23 @@ class SidechatAPIClient {
|
|
|
601
606
|
throw new SidechatAPIError("User is not authenticated.");
|
|
602
607
|
}
|
|
603
608
|
try {
|
|
609
|
+
const data = JSON.stringify({
|
|
610
|
+
type: "post",
|
|
611
|
+
assets: assetList,
|
|
612
|
+
group_ids: [groupID],
|
|
613
|
+
text: text,
|
|
614
|
+
attachments: [],
|
|
615
|
+
dms_disabled: disableDMs,
|
|
616
|
+
comments_disabled: disableComments,
|
|
617
|
+
});
|
|
604
618
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
605
619
|
method: "POST",
|
|
606
620
|
headers: {
|
|
607
621
|
...this.defaultHeaders,
|
|
608
622
|
Authorization: `Bearer ${this.userToken}`,
|
|
623
|
+
"Content-Length": data.length,
|
|
609
624
|
},
|
|
610
|
-
body:
|
|
611
|
-
type: "post",
|
|
612
|
-
assets: assetList,
|
|
613
|
-
group_ids: [groupID],
|
|
614
|
-
text: text,
|
|
615
|
-
attachments: [],
|
|
616
|
-
dms_disabled: disableDMs,
|
|
617
|
-
comments_disabled: disableComments,
|
|
618
|
-
}),
|
|
625
|
+
body: data,
|
|
619
626
|
});
|
|
620
627
|
const json = await res.json();
|
|
621
628
|
return await json.posts[0];
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ class SidechatAPIClient {
|
|
|
22
22
|
Accept: "application/json",
|
|
23
23
|
"Content-Type": "application/json",
|
|
24
24
|
"App-Version": "10.0.0",
|
|
25
|
+
Dnt: "1",
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -431,8 +432,10 @@ class SidechatAPIClient {
|
|
|
431
432
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
432
433
|
method: "GET",
|
|
433
434
|
headers: {
|
|
434
|
-
|
|
435
|
+
Accept: "application/json",
|
|
436
|
+
"Content-Type": "application/json",
|
|
435
437
|
Authorization: `Bearer ${this.userToken}`,
|
|
438
|
+
Dnt: "1",
|
|
436
439
|
},
|
|
437
440
|
});
|
|
438
441
|
const json = await res.json();
|
|
@@ -546,21 +549,23 @@ class SidechatAPIClient {
|
|
|
546
549
|
throw new SidechatAPIError("User is not authenticated.");
|
|
547
550
|
}
|
|
548
551
|
try {
|
|
552
|
+
const data = JSON.stringify({
|
|
553
|
+
type: "comment",
|
|
554
|
+
assets: assetList,
|
|
555
|
+
group_ids: [groupID],
|
|
556
|
+
text: text,
|
|
557
|
+
reply_post_id: replyCommentID,
|
|
558
|
+
parent_post_id: parentPostID,
|
|
559
|
+
dms_disabled: disableDMs,
|
|
560
|
+
});
|
|
549
561
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
550
562
|
method: "POST",
|
|
551
563
|
headers: {
|
|
552
564
|
...this.defaultHeaders,
|
|
553
565
|
Authorization: `Bearer ${this.userToken}`,
|
|
566
|
+
"Content-Length": data.length,
|
|
554
567
|
},
|
|
555
|
-
body:
|
|
556
|
-
type: "comment",
|
|
557
|
-
assets: assetList,
|
|
558
|
-
group_ids: [groupID],
|
|
559
|
-
text: text,
|
|
560
|
-
reply_post_id: replyCommentID,
|
|
561
|
-
parent_post_id: parentPostID,
|
|
562
|
-
dms_disabled: disableDMs,
|
|
563
|
-
}),
|
|
568
|
+
body: data,
|
|
564
569
|
});
|
|
565
570
|
const json = await res.json();
|
|
566
571
|
return await json.comment;
|
|
@@ -592,21 +597,23 @@ class SidechatAPIClient {
|
|
|
592
597
|
throw new SidechatAPIError("User is not authenticated.");
|
|
593
598
|
}
|
|
594
599
|
try {
|
|
600
|
+
const data = JSON.stringify({
|
|
601
|
+
type: "post",
|
|
602
|
+
assets: assetList,
|
|
603
|
+
group_ids: [groupID],
|
|
604
|
+
text: text,
|
|
605
|
+
attachments: [],
|
|
606
|
+
dms_disabled: disableDMs,
|
|
607
|
+
comments_disabled: disableComments,
|
|
608
|
+
});
|
|
595
609
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
596
610
|
method: "POST",
|
|
597
611
|
headers: {
|
|
598
612
|
...this.defaultHeaders,
|
|
599
613
|
Authorization: `Bearer ${this.userToken}`,
|
|
614
|
+
"Content-Length": data.length,
|
|
600
615
|
},
|
|
601
|
-
body:
|
|
602
|
-
type: "post",
|
|
603
|
-
assets: assetList,
|
|
604
|
-
group_ids: [groupID],
|
|
605
|
-
text: text,
|
|
606
|
-
attachments: [],
|
|
607
|
-
dms_disabled: disableDMs,
|
|
608
|
-
comments_disabled: disableComments,
|
|
609
|
-
}),
|
|
616
|
+
body: data,
|
|
610
617
|
});
|
|
611
618
|
const json = await res.json();
|
|
612
619
|
return await json.posts[0];
|