feat: local backup enhancements (#714)
This commit is contained in:
committed by
GitHub
parent
39bb9647b2
commit
804c09415b
@ -27,6 +27,7 @@ import {
|
||||
getPathDepth,
|
||||
localForage,
|
||||
} from './lib/util';
|
||||
import { getEntryBackupKey } from './lib/util/backup.util';
|
||||
import {
|
||||
selectAllowDeletion,
|
||||
selectAllowNewEntries,
|
||||
@ -47,6 +48,7 @@ import createEntry from './valueObjects/createEntry';
|
||||
import type {
|
||||
BackendClass,
|
||||
BackendInitializer,
|
||||
BackupEntry,
|
||||
BaseField,
|
||||
Collection,
|
||||
CollectionFile,
|
||||
@ -104,15 +106,6 @@ export class LocalStorageAuthStore {
|
||||
}
|
||||
}
|
||||
|
||||
function getEntryBackupKey(collectionName?: string, slug?: string) {
|
||||
const baseKey = 'backup';
|
||||
if (!collectionName) {
|
||||
return baseKey;
|
||||
}
|
||||
const suffix = slug ? `.${slug}` : '';
|
||||
return `${baseKey}.${collectionName}${suffix}`;
|
||||
}
|
||||
|
||||
export function getEntryField(field: string, entry: Entry): string {
|
||||
const value = get(entry.data, field);
|
||||
if (value) {
|
||||
@ -254,13 +247,6 @@ export interface MediaFile {
|
||||
isDirectory?: boolean;
|
||||
}
|
||||
|
||||
interface BackupEntry {
|
||||
raw: string;
|
||||
path: string;
|
||||
mediaFiles: MediaFile[];
|
||||
i18n?: Record<string, { raw: string }>;
|
||||
}
|
||||
|
||||
function collectionDepth<EF extends BaseField>(collection: Collection<EF>) {
|
||||
let depth;
|
||||
depth =
|
||||
|
Reference in New Issue
Block a user