@open-wa/wa-automate 4.48.0 → 4.49.1

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.
@@ -208,7 +208,8 @@ export declare class Client {
208
208
  */
209
209
  onPlugged(fn: (plugged: boolean) => void): Promise<Listener | boolean>;
210
210
  /**
211
- * Requires a Story License Key
211
+ * {@license:restricted@}
212
+ *
212
213
  * Listens to when a contact posts a new story.
213
214
  * @event
214
215
  *
@@ -1693,30 +1694,55 @@ export declare class Client {
1693
1694
  */
1694
1695
  postVideoStatus(data: DataURL, caption: Content): Promise<MessageId | string | boolean>;
1695
1696
  /**
1696
- * Consumes a list of id strings of statuses to delete.
1697
- * @param statusesToDelete string [] | stringan array of ids of statuses to delete.
1697
+ * {@license:restricted@}
1698
+ *
1699
+ * Consumes a list of id strings of stories to delete.
1700
+ *
1701
+ * @param statusesToDelete string [] | string an array of ids of stories to delete.
1698
1702
  * @returns boolean. True if it worked.
1699
1703
  */
1700
- deleteStatus(statusesToDelete: string | string[]): Promise<boolean>;
1704
+ deleteStory(statusesToDelete: string | string[]): Promise<boolean>;
1705
+ /**
1706
+ * @deprecated
1707
+ * Alias for deleteStory
1708
+ */
1709
+ deleteStatus: (statusesToDelete: string | string[]) => Promise<boolean>;
1701
1710
  /**
1702
- * Deletes all your existing statuses.
1711
+ * {@license:restricted@}
1712
+ *
1713
+ * Deletes all your existing stories.
1703
1714
  * @returns boolean. True if it worked.
1704
1715
  */
1705
- deleteAllStatus(): Promise<boolean>;
1716
+ deleteAllStories(): Promise<boolean>;
1717
+ /**
1718
+ * @deprecated
1719
+ * Alias for deleteStory
1720
+ */
1721
+ deleteAllStatus: () => Promise<boolean>;
1706
1722
  /**
1707
- * retrieves all existing statuses.
1723
+ * {@license:restricted@}
1724
+ *
1725
+ * Retrieves all existing stories.
1708
1726
  *
1709
1727
  * Only works with a Story License Key
1710
1728
  */
1711
- getMyStatusArray(): Promise<Message[]>;
1729
+ getMyStoryArray(): Promise<Message[]>;
1730
+ /**
1731
+ * @deprecated
1732
+ * Alias for deleteStory
1733
+ */
1734
+ getMyStatusArray: () => Promise<Message[]>;
1712
1735
  /**
1713
- * Retrieves an array of user ids that have 'read' your story.
1714
- *
1715
- * @param id string The id of the story
1716
- *
1717
- * Only works with a Story License Key
1718
- */
1719
- getStoryViewers(id: string): Promise<ContactId[]>;
1736
+ * {@license:restricted@}
1737
+ *
1738
+ * Retrieves an array of user ids that have 'read' your story.
1739
+ *
1740
+ * @param id string The id of the story
1741
+ *
1742
+ */
1743
+ getStoryViewers(id?: string): Promise<ContactId[] | {
1744
+ [k: MessageId]: ContactId[];
1745
+ }>;
1720
1746
  /**
1721
1747
  * Clears all chats of all messages. This does not delete chats. Please be careful with this as it will remove all messages from whatsapp web and the host device. This feature is great for privacy focussed bots.
1722
1748
  *
@@ -108,6 +108,21 @@ class Client {
108
108
  * Note: This would be much simpler if eventMode was the default (and only) listener strategy.
109
109
  */
110
110
  this._registeredWebhookListeners = {};
111
+ /**
112
+ * @deprecated
113
+ * Alias for deleteStory
114
+ */
115
+ this.deleteStatus = this.deleteStory;
116
+ /**
117
+ * @deprecated
118
+ * Alias for deleteStory
119
+ */
120
+ this.deleteAllStatus = this.deleteAllStories;
121
+ /**
122
+ * @deprecated
123
+ * Alias for deleteStory
124
+ */
125
+ this.getMyStatusArray = this.getMyStoryArray;
111
126
  /**
112
127
  * This exposes a simple express middlware that will allow users to quickly boot up an api based off this client. Checkout demo/index.ts for an example
113
128
  * How to use the middleware:
@@ -841,7 +856,8 @@ class Client {
841
856
  });
842
857
  }
843
858
  /**
844
- * Requires a Story License Key
859
+ * {@license:restricted@}
860
+ *
845
861
  * Listens to when a contact posts a new story.
846
862
  * @event
847
863
  *
@@ -3514,41 +3530,49 @@ class Client {
3514
3530
  });
3515
3531
  }
3516
3532
  /**
3517
- * Consumes a list of id strings of statuses to delete.
3518
- * @param statusesToDelete string [] | stringan array of ids of statuses to delete.
3533
+ * {@license:restricted@}
3534
+ *
3535
+ * Consumes a list of id strings of stories to delete.
3536
+ *
3537
+ * @param statusesToDelete string [] | string an array of ids of stories to delete.
3519
3538
  * @returns boolean. True if it worked.
3520
3539
  */
3521
- deleteStatus(statusesToDelete) {
3540
+ deleteStory(statusesToDelete) {
3522
3541
  return __awaiter(this, void 0, void 0, function* () {
3523
3542
  return yield this.pup(({ statusesToDelete }) => WAPI.deleteStatus(statusesToDelete), { statusesToDelete });
3524
3543
  });
3525
3544
  }
3526
3545
  /**
3527
- * Deletes all your existing statuses.
3546
+ * {@license:restricted@}
3547
+ *
3548
+ * Deletes all your existing stories.
3528
3549
  * @returns boolean. True if it worked.
3529
3550
  */
3530
- deleteAllStatus() {
3551
+ deleteAllStories() {
3531
3552
  return __awaiter(this, void 0, void 0, function* () {
3532
3553
  return yield this.pup(() => WAPI.deleteAllStatus());
3533
3554
  });
3534
3555
  }
3535
3556
  /**
3536
- * retrieves all existing statuses.
3557
+ * {@license:restricted@}
3558
+ *
3559
+ * Retrieves all existing stories.
3537
3560
  *
3538
3561
  * Only works with a Story License Key
3539
3562
  */
3540
- getMyStatusArray() {
3563
+ getMyStoryArray() {
3541
3564
  return __awaiter(this, void 0, void 0, function* () {
3542
3565
  return yield this.pup(() => WAPI.getMyStatusArray());
3543
3566
  });
3544
3567
  }
3545
3568
  /**
3546
- * Retrieves an array of user ids that have 'read' your story.
3547
- *
3548
- * @param id string The id of the story
3549
- *
3550
- * Only works with a Story License Key
3551
- */
3569
+ * {@license:restricted@}
3570
+ *
3571
+ * Retrieves an array of user ids that have 'read' your story.
3572
+ *
3573
+ * @param id string The id of the story
3574
+ *
3575
+ */
3552
3576
  getStoryViewers(id) {
3553
3577
  return __awaiter(this, void 0, void 0, function* () {
3554
3578
  return yield this.pup(({ id }) => WAPI.getStoryViewers(id), { id });
@@ -300,7 +300,8 @@ const deleteSessionData = (config) => {
300
300
  const mdDir = config['userDataDir'];
301
301
  if (mdDir) {
302
302
  logging_1.log.info(`Deleting MD session directory: ${mdDir}`);
303
- fs.rmdirSync(mdDir, { recursive: true });
303
+ //@ts-ignore
304
+ fs.rmdirSync(mdDir, { force: true, recursive: true });
304
305
  }
305
306
  return true;
306
307
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.48.0",
3
+ "version": "4.49.1",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",