mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 08:06:56 +00:00
레포지토리 레이어의 코드를 Kysely 기반으로 모두 마이그레이션 (WiP)
This commit is contained in:
@@ -67,10 +67,12 @@ interface ClientTable {
|
||||
signature_public_key: string; // Base64
|
||||
}
|
||||
|
||||
export type UserClientState = "challenging" | "pending" | "active";
|
||||
|
||||
interface UserClientTable {
|
||||
user_id: number;
|
||||
client_id: number;
|
||||
state: "challenging" | "pending" | "active";
|
||||
state: ColumnType<UserClientState, UserClientState | undefined>;
|
||||
}
|
||||
|
||||
interface UserClientChallengeTable {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sqliteTable, text, integer, foreignKey } from "drizzle-orm/sqlite-core";
|
||||
import type { ColumnType, Generated, JSONColumnType } from "kysely";
|
||||
import type { ColumnType, Generated } from "kysely";
|
||||
import { hsk } from "./hsk";
|
||||
import { mek } from "./mek";
|
||||
import { user } from "./user";
|
||||
@@ -88,10 +88,10 @@ export const fileLog = sqliteTable("file_log", {
|
||||
newName: ciphertext("new_name"),
|
||||
});
|
||||
|
||||
type Ciphertext = JSONColumnType<{
|
||||
export type Ciphertext = {
|
||||
ciphertext: string; // Base64
|
||||
iv: string; // Base64
|
||||
}>;
|
||||
};
|
||||
|
||||
interface DirectoryTable {
|
||||
id: Generated<number>;
|
||||
|
||||
@@ -44,10 +44,12 @@ export const hskLog = sqliteTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export type HskState = "active";
|
||||
|
||||
interface HskTable {
|
||||
user_id: number;
|
||||
version: number;
|
||||
state: "active";
|
||||
state: HskState;
|
||||
master_encryption_key_version: number;
|
||||
encrypted_key: string; // Base64
|
||||
}
|
||||
|
||||
@@ -5,4 +5,5 @@ export * from "./mek";
|
||||
export * from "./session";
|
||||
export * from "./user";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export interface Database {}
|
||||
|
||||
@@ -60,10 +60,12 @@ export const clientMek = sqliteTable(
|
||||
}),
|
||||
);
|
||||
|
||||
export type MekState = "active" | "retired" | "dead";
|
||||
|
||||
interface MekTable {
|
||||
user_id: number;
|
||||
version: number;
|
||||
state: "active" | "retired" | "dead";
|
||||
state: MekState;
|
||||
}
|
||||
|
||||
interface MekLogTable {
|
||||
|
||||
Reference in New Issue
Block a user