04769dec78
Desktop Client Build / Resolve Build Metadata (push) Successful in 26s
Frontend CI / Frontend (push) Successful in 2m47s
Backend CI / Backend (push) Failing after 10m1s
Desktop Client Build / Build Desktop Client (push) Successful in 23m3s
Desktop Client Build / Publish Client Artifacts to NAS (push) Successful in 29s
186 lines
6.0 KiB
TypeScript
186 lines
6.0 KiB
TypeScript
import type {
|
|
CreatePublishJobResponse,
|
|
DesktopAccountInfo,
|
|
DesktopBugReportSubmitRequest,
|
|
DesktopBugReportSubmitResponse,
|
|
DesktopClientReleaseCheckResponse,
|
|
DesktopClientRotateResponse,
|
|
DesktopClientUpdateProgressEvent,
|
|
DesktopClientUpdateResult,
|
|
DesktopPublishTaskListResponse,
|
|
DesktopRuntimeSessionSyncRequest,
|
|
DesktopTaskInfo,
|
|
ListDesktopPublishTasksParams,
|
|
} from '@geo/shared-types'
|
|
import type { DesktopObservedRequest } from '../shared/network-debug'
|
|
import type { DesktopRuntimeSnapshot } from './types'
|
|
|
|
export {}
|
|
|
|
declare global {
|
|
interface DesktopAppSettings {
|
|
openAtLogin: boolean
|
|
keepRunningInBackground: boolean
|
|
autoCleanStorageWeekly: boolean
|
|
}
|
|
|
|
interface DesktopLoginCredentials {
|
|
identifier: string
|
|
password: string
|
|
}
|
|
|
|
interface DesktopStorageEntry {
|
|
id: string
|
|
label: string
|
|
kind: 'app-cache' | 'bound-account' | 'unbound-session'
|
|
partition: string | null
|
|
accountId: string | null
|
|
sizeBytes: number
|
|
cleanableBytes: number
|
|
lastModifiedAt: number | null
|
|
cleanable: boolean
|
|
active: boolean
|
|
}
|
|
|
|
interface DesktopStorageSnapshot {
|
|
generatedAt: number
|
|
totalBytes: number
|
|
cleanableBytes: number
|
|
appCacheBytes: number
|
|
boundAccountBytes: number
|
|
boundAccountCleanableBytes: number
|
|
unboundSessionBytes: number
|
|
unboundSessionCount: number
|
|
boundAccountCount: number
|
|
entries: DesktopStorageEntry[]
|
|
autoCleanStorageWeekly: boolean
|
|
lastCleanupAt: number | null
|
|
nextCleanupAt: number | null
|
|
}
|
|
|
|
interface DesktopStorageCleanupResult {
|
|
cleanedAt: number
|
|
cleanedBytes: number
|
|
removedEntries: number
|
|
before: DesktopStorageSnapshot
|
|
after: DesktopStorageSnapshot
|
|
}
|
|
|
|
interface WorkbenchNavigationState {
|
|
canGoBack: boolean
|
|
canGoForward: boolean
|
|
loading: boolean
|
|
url: string
|
|
title: string
|
|
host: string
|
|
secure: boolean
|
|
}
|
|
|
|
interface DesktopAuthRecoveryRequest {
|
|
reason: 'desktop-client-token-unauthorized'
|
|
method: string
|
|
path: string
|
|
status: number
|
|
code?: number
|
|
message: string
|
|
requestId: string
|
|
at: number
|
|
}
|
|
|
|
interface Window {
|
|
desktopBridge: {
|
|
app: {
|
|
ping(): Promise<string>
|
|
versionInfo(): Promise<{
|
|
version: string
|
|
channel: string
|
|
}>
|
|
checkClientRelease(): Promise<DesktopClientReleaseCheckResponse>
|
|
clientReleaseDownloadURL(): Promise<{ download_url: string }>
|
|
quitApp(): Promise<null>
|
|
startClientUpdate(): Promise<DesktopClientUpdateResult>
|
|
deviceInfo(): Promise<{
|
|
device_name: string
|
|
os: string
|
|
cpu_arch: string
|
|
}>
|
|
clientId(scope: {
|
|
tenant_id: number
|
|
workspace_id: number
|
|
user_id: number
|
|
}): Promise<string>
|
|
runtimeSnapshot(): Promise<DesktopRuntimeSnapshot>
|
|
runtimeAccountSnapshot(
|
|
accountId: string,
|
|
): Promise<DesktopRuntimeSnapshot['accounts'][number] | null>
|
|
submitBugReport(
|
|
payload: DesktopBugReportSubmitRequest,
|
|
): Promise<DesktopBugReportSubmitResponse>
|
|
bindPublishAccount(platformId: string): Promise<DesktopAccountInfo>
|
|
refreshRuntimeAccounts(): Promise<null>
|
|
probeRuntimeAccount(
|
|
accountId: string,
|
|
): Promise<DesktopRuntimeSnapshot['accounts'][number] | null>
|
|
openPublishAccountConsole(account: {
|
|
id: string
|
|
platform: string
|
|
platformUid: string
|
|
displayName: string
|
|
}): Promise<null>
|
|
unbindPublishAccount(accountId: string, syncVersion: number): Promise<null>
|
|
listPublishTasks(
|
|
params?: ListDesktopPublishTasksParams,
|
|
): Promise<DesktopPublishTaskListResponse>
|
|
retryPublishTask(taskId: string): Promise<CreatePublishJobResponse>
|
|
cancelPublishTask(taskId: string): Promise<DesktopTaskInfo>
|
|
deletePublishRecord(recordId: number): Promise<{ deleted: boolean }>
|
|
openExternalUrl(url: string): Promise<null>
|
|
openSettingsWindow(): Promise<null>
|
|
getAppSettings(): Promise<DesktopAppSettings>
|
|
getLoginCredentials(): Promise<DesktopLoginCredentials | null>
|
|
saveLoginCredentials(credentials: DesktopLoginCredentials): Promise<DesktopLoginCredentials>
|
|
clearLoginCredentials(): Promise<null>
|
|
setAppSetting(key: keyof DesktopAppSettings, value: boolean): Promise<DesktopAppSettings>
|
|
storageSnapshot(): Promise<DesktopStorageSnapshot>
|
|
cleanStorage(): Promise<DesktopStorageCleanupResult>
|
|
syncRuntimeSession(session: DesktopRuntimeSessionSyncRequest | null): Promise<null>
|
|
rotateRuntimeClientToken(): Promise<DesktopClientRotateResponse>
|
|
releaseRuntimeSession(revoke?: boolean, options?: { skipRemote?: boolean }): Promise<null>
|
|
setWindowMode(
|
|
mode: 'login' | 'main',
|
|
request?: {
|
|
source?: 'auth-state' | 'login' | 'logout'
|
|
animate?: boolean
|
|
},
|
|
): Promise<null>
|
|
onAuthRecoveryRequested(listener: (event: DesktopAuthRecoveryRequest) => void): () => void
|
|
onRuntimeInvalidated(
|
|
listener: (event: {
|
|
reason:
|
|
| 'account-health'
|
|
| 'publish-task-lease'
|
|
| 'publish-task-progress'
|
|
| 'playwright-cdp-recovery'
|
|
| 'playwright-cdp-fatal'
|
|
at: number
|
|
accountId?: string
|
|
taskId?: string
|
|
message?: string
|
|
}) => void,
|
|
): () => void
|
|
onNetworkObserved(listener: (event: DesktopObservedRequest) => void): () => void
|
|
onClientUpdateProgress(
|
|
listener: (event: DesktopClientUpdateProgressEvent) => void,
|
|
): () => void
|
|
}
|
|
workbenchNavigation: {
|
|
getState(): Promise<WorkbenchNavigationState>
|
|
goBack(): Promise<null>
|
|
goForward(): Promise<null>
|
|
reload(): Promise<null>
|
|
onStateChanged(listener: (state: WorkbenchNavigationState) => void): () => void
|
|
}
|
|
}
|
|
}
|
|
}
|