-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip(pds): add device & account stores
- Loading branch information
1 parent
0c062f4
commit c324415
Showing
10 changed files
with
291 additions
and
94 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/pds/src/account-manager/db/schema/device-account.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Selectable } from 'kysely' | ||
|
||
export interface DeviceAccount { | ||
did: string | ||
device_id: string | ||
authTime: string | ||
remember: boolean | ||
trustedClients: string | ||
} | ||
|
||
export type DeviceAccountEntry = Selectable<DeviceAccount> | ||
|
||
export const tableName = 'device_account' | ||
|
||
export type PartialDB = { [tableName]: DeviceAccount } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Selectable } from 'kysely' | ||
|
||
export interface Device { | ||
id: string // Index this | ||
sessionId: `ses-${string}` // Index this | ||
userAgent: string | null | ||
ipAddress: string | ||
lastSeenAt: string | ||
} | ||
|
||
export type DeviceEntry = Selectable<Device> | ||
|
||
export const tableName = 'device' | ||
|
||
export type PartialDB = { [tableName]: Device } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.