Skip to content

Commit 88c8457

Browse files
authored
feat: update @wppconnect/wa-js to version 3.22.0 and refactor getMessagesFromRowId method (#2710)
1 parent 03fe90a commit 88c8457

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"webpack-cli": "^6.0.1"
9494
},
9595
"dependencies": {
96-
"@wppconnect/wa-js": "^3.20.1",
96+
"@wppconnect/wa-js": "^3.22.0",
9797
"@wppconnect/wa-version": "^1.5.3099",
9898
"atob": "^2.1.2",
9999
"axios": "^1.13.5",

src/api/layers/retriever.layer.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
import { ChatListOptions } from '@wppconnect/wa-js/dist/chat';
19+
import { GetMessagesFromRowIdOptions } from '@wppconnect/wa-js/dist/indexdb';
1920
import { Page } from 'puppeteer';
2021
import { CreateConfig } from '../../config/create-config';
2122
import { SessionToken } from '../../token-store';
@@ -655,15 +656,13 @@ export class RetrieverLayer extends SenderLayer {
655656
* @param options Options for fetching messages
656657
* @returns Promise that resolves to an array of message objects from IndexedDB
657658
*/
658-
public async getMessagesFromRowId(options: {
659-
minRowId: number;
660-
limit?: number;
661-
}): Promise<any[]> {
659+
public async getMessagesFromRowId(
660+
input: GetMessagesFromRowIdOptions
661+
): Promise<any[]> {
662662
return await evaluateAndReturn(
663663
this.page,
664-
// TODO: Change to WPP.indexdb.getMessagesFromRowId when version is released with this function
665-
(options) => (WPP as any).indexdb.getMessagesFromRowId(options),
666-
options
664+
(options) => WPP.indexdb.getMessagesFromRowId(options),
665+
input
667666
);
668667
}
669668
}

0 commit comments

Comments
 (0)