sidechat.js 2.2.6 → 2.2.9
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 +20 -27
- package/dist/index.mjs +20 -27
- package/package.json +1 -1
- package/src/classes/SidechatAPIClient.js +20 -27
|
@@ -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,CAoB1B;IAEF;;;;;OAKG;IACH,uBAFa,sBAAsB,CAoBjC;IAEF;;;;;OAKG;IACH,0CAkBE;IAEF;;;;;;OAMG;IACH,sDAkBE;IAEF;;;;;;;;;;;OAWG;IACH,0GAJW,qBAAqB,iDAsC9B;IAEF;;;;;;;;;;OAUG;IACH,wDALW,qBAAqB,4EAsC9B;IAEF;;;;;OAKG;IACH,+DAqBE;IAEF;;;;;;;;OAQG;IACH,2GA0BE;CACH"}
|
package/dist/index.cjs
CHANGED
|
@@ -35,8 +35,7 @@ class SidechatAPIClient {
|
|
|
35
35
|
Accept: "application/json",
|
|
36
36
|
"Content-Type": "application/json",
|
|
37
37
|
"App-Version": "10.0.0",
|
|
38
|
-
Dnt:
|
|
39
|
-
Host: "sidechat.lol",
|
|
38
|
+
Dnt: 1,
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
/**
|
|
@@ -446,10 +445,8 @@ class SidechatAPIClient {
|
|
|
446
445
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
447
446
|
method: "GET",
|
|
448
447
|
headers: {
|
|
449
|
-
|
|
450
|
-
"Content-Type": "application/json",
|
|
448
|
+
...this.defaultHeaders,
|
|
451
449
|
Authorization: `Bearer ${this.userToken}`,
|
|
452
|
-
Dnt: "1",
|
|
453
450
|
},
|
|
454
451
|
});
|
|
455
452
|
const json = await res.json();
|
|
@@ -563,23 +560,21 @@ class SidechatAPIClient {
|
|
|
563
560
|
throw new SidechatAPIError("User is not authenticated.");
|
|
564
561
|
}
|
|
565
562
|
try {
|
|
566
|
-
const data = JSON.stringify({
|
|
567
|
-
type: "comment",
|
|
568
|
-
assets: assetList,
|
|
569
|
-
group_ids: [groupID],
|
|
570
|
-
text: text,
|
|
571
|
-
reply_post_id: replyCommentID,
|
|
572
|
-
parent_post_id: parentPostID,
|
|
573
|
-
dms_disabled: disableDMs,
|
|
574
|
-
});
|
|
575
563
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
576
564
|
method: "POST",
|
|
577
565
|
headers: {
|
|
578
566
|
...this.defaultHeaders,
|
|
579
567
|
Authorization: `Bearer ${this.userToken}`,
|
|
580
|
-
"Content-Length": data.length,
|
|
581
568
|
},
|
|
582
|
-
body:
|
|
569
|
+
body: JSON.stringify({
|
|
570
|
+
type: "comment",
|
|
571
|
+
assets: assetList,
|
|
572
|
+
group_ids: [groupID],
|
|
573
|
+
text: text,
|
|
574
|
+
reply_post_id: replyCommentID,
|
|
575
|
+
parent_post_id: parentPostID,
|
|
576
|
+
dms_disabled: disableDMs,
|
|
577
|
+
}),
|
|
583
578
|
});
|
|
584
579
|
const json = await res.json();
|
|
585
580
|
return await json.comment;
|
|
@@ -611,23 +606,21 @@ class SidechatAPIClient {
|
|
|
611
606
|
throw new SidechatAPIError("User is not authenticated.");
|
|
612
607
|
}
|
|
613
608
|
try {
|
|
614
|
-
const data = JSON.stringify({
|
|
615
|
-
type: "post",
|
|
616
|
-
assets: assetList,
|
|
617
|
-
group_ids: [groupID],
|
|
618
|
-
text: text,
|
|
619
|
-
attachments: [],
|
|
620
|
-
dms_disabled: disableDMs,
|
|
621
|
-
comments_disabled: disableComments,
|
|
622
|
-
});
|
|
623
609
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
624
610
|
method: "POST",
|
|
625
611
|
headers: {
|
|
626
612
|
...this.defaultHeaders,
|
|
627
613
|
Authorization: `Bearer ${this.userToken}`,
|
|
628
|
-
"Content-Length": data.length,
|
|
629
614
|
},
|
|
630
|
-
body:
|
|
615
|
+
body: JSON.stringify({
|
|
616
|
+
type: "post",
|
|
617
|
+
assets: assetList,
|
|
618
|
+
group_ids: [groupID],
|
|
619
|
+
text: text,
|
|
620
|
+
attachments: [],
|
|
621
|
+
dms_disabled: disableDMs,
|
|
622
|
+
comments_disabled: disableComments,
|
|
623
|
+
}),
|
|
631
624
|
});
|
|
632
625
|
const json = await res.json();
|
|
633
626
|
return await json.posts[0];
|
package/dist/index.mjs
CHANGED
|
@@ -31,8 +31,7 @@ class SidechatAPIClient {
|
|
|
31
31
|
Accept: "application/json",
|
|
32
32
|
"Content-Type": "application/json",
|
|
33
33
|
"App-Version": "10.0.0",
|
|
34
|
-
Dnt:
|
|
35
|
-
Host: "sidechat.lol",
|
|
34
|
+
Dnt: 1,
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -442,10 +441,8 @@ class SidechatAPIClient {
|
|
|
442
441
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
443
442
|
method: "GET",
|
|
444
443
|
headers: {
|
|
445
|
-
|
|
446
|
-
"Content-Type": "application/json",
|
|
444
|
+
...this.defaultHeaders,
|
|
447
445
|
Authorization: `Bearer ${this.userToken}`,
|
|
448
|
-
Dnt: "1",
|
|
449
446
|
},
|
|
450
447
|
});
|
|
451
448
|
const json = await res.json();
|
|
@@ -559,23 +556,21 @@ class SidechatAPIClient {
|
|
|
559
556
|
throw new SidechatAPIError("User is not authenticated.");
|
|
560
557
|
}
|
|
561
558
|
try {
|
|
562
|
-
const data = JSON.stringify({
|
|
563
|
-
type: "comment",
|
|
564
|
-
assets: assetList,
|
|
565
|
-
group_ids: [groupID],
|
|
566
|
-
text: text,
|
|
567
|
-
reply_post_id: replyCommentID,
|
|
568
|
-
parent_post_id: parentPostID,
|
|
569
|
-
dms_disabled: disableDMs,
|
|
570
|
-
});
|
|
571
559
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
572
560
|
method: "POST",
|
|
573
561
|
headers: {
|
|
574
562
|
...this.defaultHeaders,
|
|
575
563
|
Authorization: `Bearer ${this.userToken}`,
|
|
576
|
-
"Content-Length": data.length,
|
|
577
564
|
},
|
|
578
|
-
body:
|
|
565
|
+
body: 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
|
+
}),
|
|
579
574
|
});
|
|
580
575
|
const json = await res.json();
|
|
581
576
|
return await json.comment;
|
|
@@ -607,23 +602,21 @@ class SidechatAPIClient {
|
|
|
607
602
|
throw new SidechatAPIError("User is not authenticated.");
|
|
608
603
|
}
|
|
609
604
|
try {
|
|
610
|
-
const data = JSON.stringify({
|
|
611
|
-
type: "post",
|
|
612
|
-
assets: assetList,
|
|
613
|
-
group_ids: [groupID],
|
|
614
|
-
text: text,
|
|
615
|
-
attachments: [],
|
|
616
|
-
dms_disabled: disableDMs,
|
|
617
|
-
comments_disabled: disableComments,
|
|
618
|
-
});
|
|
619
605
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
620
606
|
method: "POST",
|
|
621
607
|
headers: {
|
|
622
608
|
...this.defaultHeaders,
|
|
623
609
|
Authorization: `Bearer ${this.userToken}`,
|
|
624
|
-
"Content-Length": data.length,
|
|
625
610
|
},
|
|
626
|
-
body:
|
|
611
|
+
body: JSON.stringify({
|
|
612
|
+
type: "post",
|
|
613
|
+
assets: assetList,
|
|
614
|
+
group_ids: [groupID],
|
|
615
|
+
text: text,
|
|
616
|
+
attachments: [],
|
|
617
|
+
dms_disabled: disableDMs,
|
|
618
|
+
comments_disabled: disableComments,
|
|
619
|
+
}),
|
|
627
620
|
});
|
|
628
621
|
const json = await res.json();
|
|
629
622
|
return await json.posts[0];
|
package/package.json
CHANGED
|
@@ -22,8 +22,7 @@ class SidechatAPIClient {
|
|
|
22
22
|
Accept: "application/json",
|
|
23
23
|
"Content-Type": "application/json",
|
|
24
24
|
"App-Version": "10.0.0",
|
|
25
|
-
Dnt:
|
|
26
|
-
Host: "sidechat.lol",
|
|
25
|
+
Dnt: 1,
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -433,10 +432,8 @@ class SidechatAPIClient {
|
|
|
433
432
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
434
433
|
method: "GET",
|
|
435
434
|
headers: {
|
|
436
|
-
|
|
437
|
-
"Content-Type": "application/json",
|
|
435
|
+
...this.defaultHeaders,
|
|
438
436
|
Authorization: `Bearer ${this.userToken}`,
|
|
439
|
-
Dnt: "1",
|
|
440
437
|
},
|
|
441
438
|
});
|
|
442
439
|
const json = await res.json();
|
|
@@ -550,23 +547,21 @@ class SidechatAPIClient {
|
|
|
550
547
|
throw new SidechatAPIError("User is not authenticated.");
|
|
551
548
|
}
|
|
552
549
|
try {
|
|
553
|
-
const data = JSON.stringify({
|
|
554
|
-
type: "comment",
|
|
555
|
-
assets: assetList,
|
|
556
|
-
group_ids: [groupID],
|
|
557
|
-
text: text,
|
|
558
|
-
reply_post_id: replyCommentID,
|
|
559
|
-
parent_post_id: parentPostID,
|
|
560
|
-
dms_disabled: disableDMs,
|
|
561
|
-
});
|
|
562
550
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
563
551
|
method: "POST",
|
|
564
552
|
headers: {
|
|
565
553
|
...this.defaultHeaders,
|
|
566
554
|
Authorization: `Bearer ${this.userToken}`,
|
|
567
|
-
"Content-Length": data.length,
|
|
568
555
|
},
|
|
569
|
-
body:
|
|
556
|
+
body: JSON.stringify({
|
|
557
|
+
type: "comment",
|
|
558
|
+
assets: assetList,
|
|
559
|
+
group_ids: [groupID],
|
|
560
|
+
text: text,
|
|
561
|
+
reply_post_id: replyCommentID,
|
|
562
|
+
parent_post_id: parentPostID,
|
|
563
|
+
dms_disabled: disableDMs,
|
|
564
|
+
}),
|
|
570
565
|
});
|
|
571
566
|
const json = await res.json();
|
|
572
567
|
return await json.comment;
|
|
@@ -598,23 +593,21 @@ class SidechatAPIClient {
|
|
|
598
593
|
throw new SidechatAPIError("User is not authenticated.");
|
|
599
594
|
}
|
|
600
595
|
try {
|
|
601
|
-
const data = JSON.stringify({
|
|
602
|
-
type: "post",
|
|
603
|
-
assets: assetList,
|
|
604
|
-
group_ids: [groupID],
|
|
605
|
-
text: text,
|
|
606
|
-
attachments: [],
|
|
607
|
-
dms_disabled: disableDMs,
|
|
608
|
-
comments_disabled: disableComments,
|
|
609
|
-
});
|
|
610
596
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
611
597
|
method: "POST",
|
|
612
598
|
headers: {
|
|
613
599
|
...this.defaultHeaders,
|
|
614
600
|
Authorization: `Bearer ${this.userToken}`,
|
|
615
|
-
"Content-Length": data.length,
|
|
616
601
|
},
|
|
617
|
-
body:
|
|
602
|
+
body: JSON.stringify({
|
|
603
|
+
type: "post",
|
|
604
|
+
assets: assetList,
|
|
605
|
+
group_ids: [groupID],
|
|
606
|
+
text: text,
|
|
607
|
+
attachments: [],
|
|
608
|
+
dms_disabled: disableDMs,
|
|
609
|
+
comments_disabled: disableComments,
|
|
610
|
+
}),
|
|
618
611
|
});
|
|
619
612
|
const json = await res.json();
|
|
620
613
|
return await json.posts[0];
|