feat: add signal repository + tests

This commit is contained in:
Adhiraj Singh
2023-03-18 12:25:47 +05:30
parent 2eea17fe9f
commit fe1d0649b5
21 changed files with 500 additions and 206 deletions

View File

@@ -4,8 +4,9 @@ import type { Agent } from 'https'
import type { Logger } from 'pino'
import type { URL } from 'url'
import { proto } from '../../WAProto'
import { AuthenticationState, TransactionCapabilityOptions } from './Auth'
import { AuthenticationState, SignalAuthState, TransactionCapabilityOptions } from './Auth'
import { MediaConnInfo } from './Message'
import { SignalRepository } from './Signal'
export type WAVersion = [number, number, number]
export type WABrowserDescription = [string, string, string]
@@ -106,7 +107,10 @@ export type SocketConfig = {
options: AxiosRequestConfig<{}>
/**
* fetch a message from your store
* implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried
* implement this so that messages failed to send
* (solves the "this message can take a while" issue) can be retried
* */
getMessage: (key: proto.IMessageKey) => Promise<proto.IMessage | undefined>
makeSignalRepository: (auth: SignalAuthState) => SignalRepository
}