sidechat.js 2.2.4 → 2.2.6

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.
@@ -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,CAsB1B;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"}
1
+ {"version":3,"file":"SidechatAPIClient.d.ts","sourceRoot":"","sources":["../../src/classes/SidechatAPIClient.js"],"names":[],"mappings":";AAGA;;;;GAIG;AACH;IAoBE;;;OAGG;IACH,uCAIC;IA3BD;;;SAGK;IACL,6BAAU;IACV;;;;;OAKG;IACH,oBAME;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
@@ -36,6 +36,7 @@ class SidechatAPIClient {
36
36
  "Content-Type": "application/json",
37
37
  "App-Version": "10.0.0",
38
38
  Dnt: "1",
39
+ Host: "sidechat.lol",
39
40
  };
40
41
 
41
42
  /**
@@ -562,21 +563,23 @@ class SidechatAPIClient {
562
563
  throw new SidechatAPIError("User is not authenticated.");
563
564
  }
564
565
  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
+ });
565
575
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
566
576
  method: "POST",
567
577
  headers: {
568
578
  ...this.defaultHeaders,
569
579
  Authorization: `Bearer ${this.userToken}`,
580
+ "Content-Length": data.length,
570
581
  },
571
- body: JSON.stringify({
572
- type: "comment",
573
- assets: assetList,
574
- group_ids: [groupID],
575
- text: text,
576
- reply_post_id: replyCommentID,
577
- parent_post_id: parentPostID,
578
- dms_disabled: disableDMs,
579
- }),
582
+ body: data,
580
583
  });
581
584
  const json = await res.json();
582
585
  return await json.comment;
@@ -608,21 +611,23 @@ class SidechatAPIClient {
608
611
  throw new SidechatAPIError("User is not authenticated.");
609
612
  }
610
613
  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
+ });
611
623
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
612
624
  method: "POST",
613
625
  headers: {
614
626
  ...this.defaultHeaders,
615
627
  Authorization: `Bearer ${this.userToken}`,
628
+ "Content-Length": data.length,
616
629
  },
617
- body: JSON.stringify({
618
- type: "post",
619
- assets: assetList,
620
- group_ids: [groupID],
621
- text: text,
622
- attachments: [],
623
- dms_disabled: disableDMs,
624
- comments_disabled: disableComments,
625
- }),
630
+ body: data,
626
631
  });
627
632
  const json = await res.json();
628
633
  return await json.posts[0];
package/dist/index.mjs CHANGED
@@ -32,6 +32,7 @@ class SidechatAPIClient {
32
32
  "Content-Type": "application/json",
33
33
  "App-Version": "10.0.0",
34
34
  Dnt: "1",
35
+ Host: "sidechat.lol",
35
36
  };
36
37
 
37
38
  /**
@@ -558,21 +559,23 @@ class SidechatAPIClient {
558
559
  throw new SidechatAPIError("User is not authenticated.");
559
560
  }
560
561
  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
+ });
561
571
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
562
572
  method: "POST",
563
573
  headers: {
564
574
  ...this.defaultHeaders,
565
575
  Authorization: `Bearer ${this.userToken}`,
576
+ "Content-Length": data.length,
566
577
  },
567
- body: JSON.stringify({
568
- type: "comment",
569
- assets: assetList,
570
- group_ids: [groupID],
571
- text: text,
572
- reply_post_id: replyCommentID,
573
- parent_post_id: parentPostID,
574
- dms_disabled: disableDMs,
575
- }),
578
+ body: data,
576
579
  });
577
580
  const json = await res.json();
578
581
  return await json.comment;
@@ -604,21 +607,23 @@ class SidechatAPIClient {
604
607
  throw new SidechatAPIError("User is not authenticated.");
605
608
  }
606
609
  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
+ });
607
619
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
608
620
  method: "POST",
609
621
  headers: {
610
622
  ...this.defaultHeaders,
611
623
  Authorization: `Bearer ${this.userToken}`,
624
+ "Content-Length": data.length,
612
625
  },
613
- body: 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
- }),
626
+ body: data,
622
627
  });
623
628
  const json = await res.json();
624
629
  return await json.posts[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sidechat.js",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "A reverse-engineered API wrapper for Sidechat",
5
5
  "type": "module",
6
6
  "source": "./src/index.js",
@@ -23,6 +23,7 @@ class SidechatAPIClient {
23
23
  "Content-Type": "application/json",
24
24
  "App-Version": "10.0.0",
25
25
  Dnt: "1",
26
+ Host: "sidechat.lol",
26
27
  };
27
28
 
28
29
  /**
@@ -549,21 +550,23 @@ class SidechatAPIClient {
549
550
  throw new SidechatAPIError("User is not authenticated.");
550
551
  }
551
552
  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
+ });
552
562
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
553
563
  method: "POST",
554
564
  headers: {
555
565
  ...this.defaultHeaders,
556
566
  Authorization: `Bearer ${this.userToken}`,
567
+ "Content-Length": data.length,
557
568
  },
558
- body: JSON.stringify({
559
- type: "comment",
560
- assets: assetList,
561
- group_ids: [groupID],
562
- text: text,
563
- reply_post_id: replyCommentID,
564
- parent_post_id: parentPostID,
565
- dms_disabled: disableDMs,
566
- }),
569
+ body: data,
567
570
  });
568
571
  const json = await res.json();
569
572
  return await json.comment;
@@ -595,21 +598,23 @@ class SidechatAPIClient {
595
598
  throw new SidechatAPIError("User is not authenticated.");
596
599
  }
597
600
  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
+ });
598
610
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
599
611
  method: "POST",
600
612
  headers: {
601
613
  ...this.defaultHeaders,
602
614
  Authorization: `Bearer ${this.userToken}`,
615
+ "Content-Length": data.length,
603
616
  },
604
- body: JSON.stringify({
605
- type: "post",
606
- assets: assetList,
607
- group_ids: [groupID],
608
- text: text,
609
- attachments: [],
610
- dms_disabled: disableDMs,
611
- comments_disabled: disableComments,
612
- }),
617
+ body: data,
613
618
  });
614
619
  const json = await res.json();
615
620
  return await json.posts[0];