about summary refs log tree commit diff
path: root/bskylink/src/db/schema.ts
blob: d13a28038aba6e3d7454c6cff6c5f9806e07ca00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import {type ToolsOzoneSafelinkDefs} from '@atproto/api'
import {type Selectable} from 'kysely'

export type DbSchema = {
  link: Link
  safelink_rule: SafelinkRule
  safelink_cursor: SafelinkCursor
}

export interface Link {
  id: string
  type: LinkType
  path: string
}

export enum LinkType {
  StarterPack = 1,
}

export interface SafelinkRule {
  id: number
  eventType: ToolsOzoneSafelinkDefs.EventType
  url: string
  pattern: ToolsOzoneSafelinkDefs.PatternType
  action: ToolsOzoneSafelinkDefs.ActionType
  createdAt: string
}

export interface SafelinkCursor {
  id: number
  cursor: string
  updatedAt: Date
}

export type LinkEntry = Selectable<Link>
export type SafelinkRuleEntry = Selectable<SafelinkRule>
export type SafelinkCursorEntry = Selectable<SafelinkCursor>