add login with oskeychain
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
GitRepositoryFile,
|
||||
GitSearchHit,
|
||||
GitStatus,
|
||||
StoredCredential,
|
||||
} from "./types";
|
||||
|
||||
export function openRepository(path: string): Promise<GitStatus> {
|
||||
@@ -54,6 +55,27 @@ export function push(path: string, username?: string, password?: string): Promis
|
||||
return invoke<GitStatus>("push", { path, username: username ?? null, password: password ?? null });
|
||||
}
|
||||
|
||||
export function getRemoteUrl(path: string): Promise<string | null> {
|
||||
return invoke<string | null>("get_remote_url", { path });
|
||||
}
|
||||
|
||||
export function credLoad(key: string): Promise<StoredCredential | null> {
|
||||
return invoke<StoredCredential | null>("cred_load", { key });
|
||||
}
|
||||
|
||||
export function credSave(
|
||||
key: string,
|
||||
username: string,
|
||||
password: string,
|
||||
expiresAt: string | null,
|
||||
): Promise<void> {
|
||||
return invoke<void>("cred_save", { key, username, password, expiresAt });
|
||||
}
|
||||
|
||||
export function credDelete(key: string): Promise<void> {
|
||||
return invoke<void>("cred_delete", { key });
|
||||
}
|
||||
|
||||
export function listCommits(path: string, limit = 100): Promise<GitCommit[]> {
|
||||
return invoke<GitCommit[]>("list_commits", { path, limit });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user