sidechat.js 2.2.8 → 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 -28
- package/dist/index.mjs +20 -28
- package/package.json +1 -1
- package/src/classes/SidechatAPIClient.js +20 -28
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,7 +35,7 @@ class SidechatAPIClient {
|
|
|
35
35
|
Accept: "application/json",
|
|
36
36
|
"Content-Type": "application/json",
|
|
37
37
|
"App-Version": "10.0.0",
|
|
38
|
-
Dnt:
|
|
38
|
+
Dnt: 1,
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -445,10 +445,8 @@ class SidechatAPIClient {
|
|
|
445
445
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
446
446
|
method: "GET",
|
|
447
447
|
headers: {
|
|
448
|
-
|
|
449
|
-
"Content-Type": "application/json",
|
|
448
|
+
...this.defaultHeaders,
|
|
450
449
|
Authorization: `Bearer ${this.userToken}`,
|
|
451
|
-
Dnt: "1",
|
|
452
450
|
},
|
|
453
451
|
});
|
|
454
452
|
const json = await res.json();
|
|
@@ -562,24 +560,21 @@ class SidechatAPIClient {
|
|
|
562
560
|
throw new SidechatAPIError("User is not authenticated.");
|
|
563
561
|
}
|
|
564
562
|
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
|
-
});
|
|
574
563
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
575
564
|
method: "POST",
|
|
576
565
|
headers: {
|
|
577
566
|
...this.defaultHeaders,
|
|
578
567
|
Authorization: `Bearer ${this.userToken}`,
|
|
579
|
-
"Content-Length": data.length,
|
|
580
|
-
Host: "www.sidechat.lol",
|
|
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,24 +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
|
-
Host: "www.sidechat.lol",
|
|
630
614
|
},
|
|
631
|
-
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
|
+
}),
|
|
632
624
|
});
|
|
633
625
|
const json = await res.json();
|
|
634
626
|
return await json.posts[0];
|
package/dist/index.mjs
CHANGED
|
@@ -31,7 +31,7 @@ class SidechatAPIClient {
|
|
|
31
31
|
Accept: "application/json",
|
|
32
32
|
"Content-Type": "application/json",
|
|
33
33
|
"App-Version": "10.0.0",
|
|
34
|
-
Dnt:
|
|
34
|
+
Dnt: 1,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -441,10 +441,8 @@ class SidechatAPIClient {
|
|
|
441
441
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
442
442
|
method: "GET",
|
|
443
443
|
headers: {
|
|
444
|
-
|
|
445
|
-
"Content-Type": "application/json",
|
|
444
|
+
...this.defaultHeaders,
|
|
446
445
|
Authorization: `Bearer ${this.userToken}`,
|
|
447
|
-
Dnt: "1",
|
|
448
446
|
},
|
|
449
447
|
});
|
|
450
448
|
const json = await res.json();
|
|
@@ -558,24 +556,21 @@ class SidechatAPIClient {
|
|
|
558
556
|
throw new SidechatAPIError("User is not authenticated.");
|
|
559
557
|
}
|
|
560
558
|
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
|
-
});
|
|
570
559
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
571
560
|
method: "POST",
|
|
572
561
|
headers: {
|
|
573
562
|
...this.defaultHeaders,
|
|
574
563
|
Authorization: `Bearer ${this.userToken}`,
|
|
575
|
-
"Content-Length": data.length,
|
|
576
|
-
Host: "www.sidechat.lol",
|
|
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,24 +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
|
-
Host: "www.sidechat.lol",
|
|
626
610
|
},
|
|
627
|
-
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
|
+
}),
|
|
628
620
|
});
|
|
629
621
|
const json = await res.json();
|
|
630
622
|
return await json.posts[0];
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ class SidechatAPIClient {
|
|
|
22
22
|
Accept: "application/json",
|
|
23
23
|
"Content-Type": "application/json",
|
|
24
24
|
"App-Version": "10.0.0",
|
|
25
|
-
Dnt:
|
|
25
|
+
Dnt: 1,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -432,10 +432,8 @@ class SidechatAPIClient {
|
|
|
432
432
|
const res = await fetch(`https://api.sidechat.lol/v1/groups/explore`, {
|
|
433
433
|
method: "GET",
|
|
434
434
|
headers: {
|
|
435
|
-
|
|
436
|
-
"Content-Type": "application/json",
|
|
435
|
+
...this.defaultHeaders,
|
|
437
436
|
Authorization: `Bearer ${this.userToken}`,
|
|
438
|
-
Dnt: "1",
|
|
439
437
|
},
|
|
440
438
|
});
|
|
441
439
|
const json = await res.json();
|
|
@@ -549,24 +547,21 @@ class SidechatAPIClient {
|
|
|
549
547
|
throw new SidechatAPIError("User is not authenticated.");
|
|
550
548
|
}
|
|
551
549
|
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
|
-
});
|
|
561
550
|
const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
|
|
562
551
|
method: "POST",
|
|
563
552
|
headers: {
|
|
564
553
|
...this.defaultHeaders,
|
|
565
554
|
Authorization: `Bearer ${this.userToken}`,
|
|
566
|
-
"Content-Length": data.length,
|
|
567
|
-
Host: "www.sidechat.lol",
|
|
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,24 +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
|
-
Host: "www.sidechat.lol",
|
|
617
601
|
},
|
|
618
|
-
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
|
+
}),
|
|
619
611
|
});
|
|
620
612
|
const json = await res.json();
|
|
621
613
|
return await json.posts[0];
|