sidechat.js 2.2.4 → 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.
@@ -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;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
@@ -562,21 +562,23 @@ class SidechatAPIClient {
562
562
  throw new SidechatAPIError("User is not authenticated.");
563
563
  }
564
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
+ });
565
574
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
566
575
  method: "POST",
567
576
  headers: {
568
577
  ...this.defaultHeaders,
569
578
  Authorization: `Bearer ${this.userToken}`,
579
+ "Content-Length": data.length,
570
580
  },
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
- }),
581
+ body: data,
580
582
  });
581
583
  const json = await res.json();
582
584
  return await json.comment;
@@ -608,21 +610,23 @@ class SidechatAPIClient {
608
610
  throw new SidechatAPIError("User is not authenticated.");
609
611
  }
610
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
+ });
611
622
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
612
623
  method: "POST",
613
624
  headers: {
614
625
  ...this.defaultHeaders,
615
626
  Authorization: `Bearer ${this.userToken}`,
627
+ "Content-Length": data.length,
616
628
  },
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
- }),
629
+ body: data,
626
630
  });
627
631
  const json = await res.json();
628
632
  return await json.posts[0];
package/dist/index.mjs CHANGED
@@ -558,21 +558,23 @@ class SidechatAPIClient {
558
558
  throw new SidechatAPIError("User is not authenticated.");
559
559
  }
560
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
+ });
561
570
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
562
571
  method: "POST",
563
572
  headers: {
564
573
  ...this.defaultHeaders,
565
574
  Authorization: `Bearer ${this.userToken}`,
575
+ "Content-Length": data.length,
566
576
  },
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
- }),
577
+ body: data,
576
578
  });
577
579
  const json = await res.json();
578
580
  return await json.comment;
@@ -604,21 +606,23 @@ class SidechatAPIClient {
604
606
  throw new SidechatAPIError("User is not authenticated.");
605
607
  }
606
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
+ });
607
618
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
608
619
  method: "POST",
609
620
  headers: {
610
621
  ...this.defaultHeaders,
611
622
  Authorization: `Bearer ${this.userToken}`,
623
+ "Content-Length": data.length,
612
624
  },
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
- }),
625
+ body: data,
622
626
  });
623
627
  const json = await res.json();
624
628
  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.5",
4
4
  "description": "A reverse-engineered API wrapper for Sidechat",
5
5
  "type": "module",
6
6
  "source": "./src/index.js",
@@ -549,21 +549,23 @@ class SidechatAPIClient {
549
549
  throw new SidechatAPIError("User is not authenticated.");
550
550
  }
551
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
+ });
552
561
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
553
562
  method: "POST",
554
563
  headers: {
555
564
  ...this.defaultHeaders,
556
565
  Authorization: `Bearer ${this.userToken}`,
566
+ "Content-Length": data.length,
557
567
  },
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
- }),
568
+ body: data,
567
569
  });
568
570
  const json = await res.json();
569
571
  return await json.comment;
@@ -595,21 +597,23 @@ class SidechatAPIClient {
595
597
  throw new SidechatAPIError("User is not authenticated.");
596
598
  }
597
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
+ });
598
609
  const res = await fetch(`https://api.sidechat.lol/v1/posts`, {
599
610
  method: "POST",
600
611
  headers: {
601
612
  ...this.defaultHeaders,
602
613
  Authorization: `Bearer ${this.userToken}`,
614
+ "Content-Length": data.length,
603
615
  },
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
- }),
616
+ body: data,
613
617
  });
614
618
  const json = await res.json();
615
619
  return await json.posts[0];