Skip to content

Commit

Permalink
update all list functions and sync functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Jan 17, 2025
1 parent a9fd954 commit d73e55d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ export async function listDms<
clientInstallationId: InstallationId,
opts?: ConversationOptions | undefined,
limit?: number | undefined,
consentState?: ConsentState | undefined
consentStates?: ConsentState[] | undefined
): Promise<Dm<ContentTypes>[]> {
return (
await XMTPModule.listDms(
clientInstallationId,
JSON.stringify(opts),
limit,
consentState
consentStates
)
).map((json: string) => {
const group = JSON.parse(json)
Expand All @@ -402,14 +402,14 @@ export async function listConversations<
clientInstallationId: InstallationId,
opts?: ConversationOptions | undefined,
limit?: number | undefined,
consentState?: ConsentState | undefined
consentStates?: ConsentState[] | undefined
): Promise<Conversation<ContentTypes>[]> {
return (
await XMTPModule.listConversations(
clientInstallationId,
JSON.stringify(opts),
limit,
consentState
consentStates
)
).map((json: string) => {
const jsonObj = JSON.parse(json)
Expand Down Expand Up @@ -815,9 +815,9 @@ export async function syncConversations(installationId: InstallationId) {

export async function syncAllConversations(
installationId: InstallationId,
consentState?: ConsentState | undefined
consentStates?: ConsentState[] | undefined
): Promise<number> {
return await XMTPModule.syncAllConversations(installationId, consentState)
return await XMTPModule.syncAllConversations(installationId, consentStates)
}

export async function syncConversation(
Expand Down
10 changes: 5 additions & 5 deletions src/lib/Conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ export default class Conversations<
async listDms(
opts?: ConversationOptions | undefined,
limit?: number | undefined,
consentState?: ConsentState | undefined
consentStates?: ConsentState[] | undefined
): Promise<Dm<ContentTypes>[]> {
return await XMTPModule.listDms(
this.client.installationId,
opts,
limit,
consentState
consentStates
)
}

Expand All @@ -324,7 +324,7 @@ export default class Conversations<
async list(
opts?: ConversationOptions | undefined,
limit?: number | undefined,
consentState?: ConsentState | undefined
consentStates?: ConsentState[] | undefined
): Promise<Conversation<ContentTypes>[]> {
return await XMTPModule.listConversations(
this.client.installationId,
Expand Down Expand Up @@ -355,11 +355,11 @@ export default class Conversations<
* @returns {Promise<number>} A Promise that resolves to the number of conversations synced.
*/
async syncAllConversations(
consentState: ConsentState | undefined = undefined
consentStates?: ConsentState[] | undefined = undefined

Check failure on line 358 in src/lib/Conversations.ts

View workflow job for this annotation

GitHub Actions / lint

Parameter cannot have question mark and initializer.

Check failure on line 358 in src/lib/Conversations.ts

View workflow job for this annotation

GitHub Actions / test

Parameter cannot have question mark and initializer.

Check failure on line 358 in src/lib/Conversations.ts

View workflow job for this annotation

GitHub Actions / lint

Parameter cannot have question mark and initializer.
): Promise<number> {
return await XMTPModule.syncAllConversations(
this.client.installationId,
consentState
consentStates
)
}

Expand Down

0 comments on commit d73e55d

Please sign in to comment.