about summary refs log tree commit diff
path: root/bskylink/src/db/schema.ts
diff options
context:
space:
mode:
authorhailey <hailey@blueskyweb.xyz>2025-09-02 13:36:20 -0700
committerGitHub <noreply@github.com>2025-09-02 13:36:20 -0700
commitacdc509630d5182f9f3d224b259e2a46000b1f27 (patch)
tree92d6b474bad9692e5b054ed8b693bca1cba816ac /bskylink/src/db/schema.ts
parentb2258fb6cbdb5de79a7c7d848347f3f157059aa5 (diff)
downloadvoidsky-acdc509630d5182f9f3d224b259e2a46000b1f27.tar.zst
safelink (#8917)
Co-authored-by: hailey <me@haileyok.com>
Co-authored-by: Stanislas Signoud <signez@stanisoft.net>
Co-authored-by: will berry <wsb@wills-MBP.attlocal.net>
Co-authored-by: BlueSkiesAndGreenPastures <will@blueskyweb.xyz>
Co-authored-by: Chenyu Huang <itschenyu@gmail.com>
Diffstat (limited to 'bskylink/src/db/schema.ts')
-rw-r--r--bskylink/src/db/schema.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/bskylink/src/db/schema.ts b/bskylink/src/db/schema.ts
index 8d97f5800..d13a28038 100644
--- a/bskylink/src/db/schema.ts
+++ b/bskylink/src/db/schema.ts
@@ -1,7 +1,10 @@
-import {Selectable} from 'kysely'
+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 {
@@ -14,4 +17,21 @@ 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>