2022-10-04 02:02:58 +13:00
|
|
|
import { Document } from "../document"
|
2022-10-21 03:05:50 +13:00
|
|
|
import { User } from "../../"
|
2022-10-04 02:02:58 +13:00
|
|
|
|
2022-10-20 07:19:36 +13:00
|
|
|
export enum AppBackupType {
|
|
|
|
BACKUP = "backup",
|
|
|
|
RESTORE = "restore",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum AppBackupStatus {
|
|
|
|
STARTED = "started",
|
2022-10-22 06:25:35 +13:00
|
|
|
PENDING = "pending",
|
2022-10-20 07:19:36 +13:00
|
|
|
COMPLETE = "complete",
|
|
|
|
FAILED = "failed",
|
|
|
|
}
|
|
|
|
|
2022-10-04 02:02:58 +13:00
|
|
|
export enum AppBackupTrigger {
|
|
|
|
PUBLISH = "publish",
|
|
|
|
MANUAL = "manual",
|
|
|
|
SCHEDULED = "scheduled",
|
2022-10-21 07:07:10 +13:00
|
|
|
RESTORING = "restoring",
|
2022-10-04 02:02:58 +13:00
|
|
|
}
|
|
|
|
|
2022-10-20 07:19:36 +13:00
|
|
|
export interface AppBackupContents {
|
|
|
|
datasources: string[]
|
|
|
|
screens: string[]
|
|
|
|
automations: string[]
|
2022-10-18 07:42:36 +13:00
|
|
|
}
|
|
|
|
|
2022-10-20 04:48:32 +13:00
|
|
|
export interface AppBackupMetadata {
|
|
|
|
appId: string
|
2022-10-20 07:19:36 +13:00
|
|
|
trigger?: AppBackupTrigger
|
|
|
|
type: AppBackupType
|
|
|
|
status: AppBackupStatus
|
2022-10-20 04:48:32 +13:00
|
|
|
name?: string
|
2022-10-21 03:05:50 +13:00
|
|
|
createdBy?: string | User
|
2022-10-20 04:48:32 +13:00
|
|
|
timestamp: string
|
2022-10-28 05:31:39 +13:00
|
|
|
finishedAt?: string
|
|
|
|
startedAt?: string
|
2022-10-20 07:19:36 +13:00
|
|
|
contents?: AppBackupContents
|
2022-10-15 07:24:03 +13:00
|
|
|
}
|
|
|
|
|
2022-10-20 04:48:32 +13:00
|
|
|
export interface AppBackup extends Document, AppBackupMetadata {
|
2022-11-16 03:28:02 +13:00
|
|
|
_id: string
|
2022-10-20 07:19:36 +13:00
|
|
|
filename?: string
|
2022-10-20 04:48:32 +13:00
|
|
|
}
|
|
|
|
|
2022-10-15 07:24:03 +13:00
|
|
|
export type AppBackupFetchOpts = {
|
|
|
|
trigger?: AppBackupTrigger
|
2022-10-22 05:04:20 +13:00
|
|
|
type?: AppBackupType
|
2022-10-15 07:24:03 +13:00
|
|
|
limit?: number
|
|
|
|
page?: string
|
|
|
|
paginate?: boolean
|
|
|
|
startDate?: string
|
|
|
|
endDate?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface AppBackupQueueData {
|
|
|
|
appId: string
|
2022-10-20 07:19:36 +13:00
|
|
|
docId: string
|
|
|
|
docRev: string
|
2022-10-18 07:42:36 +13:00
|
|
|
export?: {
|
|
|
|
trigger: AppBackupTrigger
|
|
|
|
name?: string
|
|
|
|
createdBy?: string
|
|
|
|
}
|
|
|
|
import?: {
|
|
|
|
backupId: string
|
2022-10-21 07:07:10 +13:00
|
|
|
nameForBackup: string
|
2022-10-20 07:19:36 +13:00
|
|
|
createdBy?: string
|
2022-10-18 07:42:36 +13:00
|
|
|
}
|
2022-10-15 07:24:03 +13:00
|
|
|
}
|