Graphorin API reference v0.8.0
Graphorin API reference / @graphorin/store-sqlite / / SqlitePairingStore
Class: SqlitePairingStore
Defined in: packages/store-sqlite/src/pairing-store.ts:52
Default PairingStore implementation (migration 034). Expiry policy lives in the access controller of @graphorin/channels; this store only filters by the timestamps it is handed.
Stable
Implements
Constructors
Constructor
new SqlitePairingStore(conn): SqlitePairingStore;Defined in: packages/store-sqlite/src/pairing-store.ts:54
Parameters
| Parameter | Type |
|---|---|
conn | SqliteConnection |
Returns
SqlitePairingStore
Methods
addPairedPeer()
addPairedPeer(peer): Promise<void>;Defined in: packages/store-sqlite/src/pairing-store.ts:117
Parameters
| Parameter | Type |
|---|---|
peer | PairedPeerRecord |
Returns
Promise<void>
Implementation of
countPendingRequests()
countPendingRequests(channelId, nowIso): Promise<number>;Defined in: packages/store-sqlite/src/pairing-store.ts:98
Count pending requests on a channel whose expiresAt is after nowIso.
Parameters
| Parameter | Type |
|---|---|
channelId | string |
nowIso | string |
Returns
Promise<number>
Implementation of
PairingStore.countPendingRequests
deleteRequest()
deleteRequest(channelId, code): Promise<void>;Defined in: packages/store-sqlite/src/pairing-store.ts:91
Parameters
| Parameter | Type |
|---|---|
channelId | string |
code | string |
Returns
Promise<void>
Implementation of
findRequestByCode()
findRequestByCode(channelId, code): Promise<
| PairingRequestRecord
| null>;Defined in: packages/store-sqlite/src/pairing-store.ts:83
Parameters
| Parameter | Type |
|---|---|
channelId | string |
code | string |
Returns
Promise< | PairingRequestRecord | null>
Implementation of
PairingStore.findRequestByCode
findRequestByPeer()
findRequestByPeer(peer): Promise<
| PairingRequestRecord
| null>;Defined in: packages/store-sqlite/src/pairing-store.ts:74
Parameters
| Parameter | Type |
|---|---|
peer | PairingPeerRef |
Returns
Promise< | PairingRequestRecord | null>
Implementation of
PairingStore.findRequestByPeer
isPaired()
isPaired(peer): Promise<boolean>;Defined in: packages/store-sqlite/src/pairing-store.ts:126
Parameters
| Parameter | Type |
|---|---|
peer | PairingPeerRef |
Returns
Promise<boolean>
Implementation of
listPairedPeers()
listPairedPeers(channelId?): Promise<readonly PairedPeerRecord[]>;Defined in: packages/store-sqlite/src/pairing-store.ts:143
Parameters
| Parameter | Type |
|---|---|
channelId? | string |
Returns
Promise<readonly PairedPeerRecord[]>
Implementation of
pruneExpiredRequests()
pruneExpiredRequests(nowIso): Promise<number>;Defined in: packages/store-sqlite/src/pairing-store.ts:106
Delete requests whose expiresAt is at or before nowIso; returns the number removed.
Parameters
| Parameter | Type |
|---|---|
nowIso | string |
Returns
Promise<number>
Implementation of
PairingStore.pruneExpiredRequests
removePairedPeer()
removePairedPeer(peer): Promise<void>;Defined in: packages/store-sqlite/src/pairing-store.ts:135
Parameters
| Parameter | Type |
|---|---|
peer | PairingPeerRef |
Returns
Promise<void>
Implementation of
upsertRequest()
upsertRequest(request): Promise<void>;Defined in: packages/store-sqlite/src/pairing-store.ts:58
Insert or replace the (single) pending request for the peer.
Parameters
| Parameter | Type |
|---|---|
request | PairingRequestRecord |
Returns
Promise<void>