- Add github_username to Settings type (Rust + TS) - Add device flow commands: github_device_flow_start, github_device_flow_poll, github_get_user - Replace manual token KeyField with "Login with GitHub" OAuth button - Show connected state with username after successful OAuth - Add disconnect functionality to clear OAuth token - Update mock-tauri.ts with device flow mock handlers - Update all tests for new Settings shape Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
86 lines
2.1 KiB
TypeScript
86 lines
2.1 KiB
TypeScript
export interface VaultEntry {
|
|
path: string
|
|
filename: string
|
|
title: string
|
|
isA: string | null
|
|
aliases: string[]
|
|
belongsTo: string[]
|
|
relatedTo: string[]
|
|
status: string | null
|
|
owner: string | null
|
|
cadence: string | null
|
|
archived: boolean
|
|
trashed: boolean
|
|
trashedAt: number | null
|
|
modifiedAt: number | null
|
|
createdAt: number | null
|
|
fileSize: number
|
|
snippet: string
|
|
/** Generic relationship fields: any frontmatter key whose value contains wikilinks. */
|
|
relationships: Record<string, string[]>
|
|
/** Phosphor icon name (kebab-case) for Type entries, e.g. "cooking-pot" */
|
|
icon: string | null
|
|
/** Accent color key for Type entries: "red" | "purple" | "blue" | "green" | "yellow" | "orange" */
|
|
color: string | null
|
|
/** Display order for Type entries in sidebar (lower = higher). null = use default order. */
|
|
order: number | null
|
|
}
|
|
|
|
export interface GitCommit {
|
|
hash: string
|
|
shortHash: string
|
|
message: string
|
|
author: string
|
|
date: number // unix timestamp
|
|
}
|
|
|
|
export interface ModifiedFile {
|
|
path: string
|
|
relativePath: string
|
|
status: 'modified' | 'added' | 'deleted' | 'untracked' | 'renamed'
|
|
}
|
|
|
|
export interface Settings {
|
|
anthropic_key: string | null
|
|
openai_key: string | null
|
|
google_key: string | null
|
|
github_token: string | null
|
|
github_username: string | null
|
|
}
|
|
|
|
export interface DeviceFlowStart {
|
|
device_code: string
|
|
user_code: string
|
|
verification_uri: string
|
|
expires_in: number
|
|
interval: number
|
|
}
|
|
|
|
export interface DeviceFlowPollResult {
|
|
status: 'pending' | 'complete' | 'expired' | 'error'
|
|
access_token: string | null
|
|
error: string | null
|
|
}
|
|
|
|
export interface GitHubUser {
|
|
login: string
|
|
name: string | null
|
|
avatar_url: string
|
|
}
|
|
|
|
export interface GithubRepo {
|
|
name: string
|
|
full_name: string
|
|
description: string | null
|
|
private: boolean
|
|
clone_url: string
|
|
html_url: string
|
|
updated_at: string | null
|
|
}
|
|
|
|
export type SidebarSelection =
|
|
| { kind: 'filter'; filter: 'all' | 'favorites' | 'archived' | 'trash' }
|
|
| { kind: 'sectionGroup'; type: string }
|
|
| { kind: 'entity'; entry: VaultEntry }
|
|
| { kind: 'topic'; entry: VaultEntry }
|