migrate to "export default"
also, set no-use-before-define in linter
This commit is contained in:
+29
-28
@@ -1,6 +1,6 @@
|
||||
import assert from 'node:assert';
|
||||
import BoxError from './boxerror.js';
|
||||
import * as database from './database.js';
|
||||
import database from './database.js';
|
||||
import debugModule from 'debug';
|
||||
import eventlog from './eventlog.js';
|
||||
import hat from './hat.js';
|
||||
@@ -12,33 +12,6 @@ const debug = debugModule('box:backups');
|
||||
const BACKUP_TYPE_APP = 'app';
|
||||
const BACKUP_STATE_NORMAL = 'normal';
|
||||
|
||||
export default {
|
||||
get,
|
||||
getByIdentifierAndStatePaged,
|
||||
getLatestInTargetByIdentifier, // brutal function name
|
||||
add,
|
||||
update,
|
||||
listByTypePaged,
|
||||
del,
|
||||
|
||||
removePrivateFields,
|
||||
|
||||
clearTasks,
|
||||
startIntegrityCheck,
|
||||
stopIntegrityCheck,
|
||||
setIntegrityResult,
|
||||
|
||||
BACKUP_IDENTIFIER_BOX: 'box',
|
||||
BACKUP_IDENTIFIER_MAIL: 'mail',
|
||||
|
||||
BACKUP_TYPE_APP,
|
||||
BACKUP_TYPE_BOX: 'box',
|
||||
BACKUP_TYPE_MAIL: 'mail',
|
||||
|
||||
BACKUP_STATE_NORMAL,
|
||||
BACKUP_STATE_CREATING: 'creating',
|
||||
BACKUP_STATE_ERROR: 'error',
|
||||
};
|
||||
|
||||
const BACKUPS_FIELDS = [ 'id', 'remotePath', 'label', 'identifier', 'creationTime', 'packageVersion', 'type', 'integrityJson',
|
||||
'statsJson', 'dependsOnJson', 'state', 'manifestJson', 'preserveSecs', 'encryptionVersion', 'appConfigJson', 'siteId',
|
||||
@@ -254,3 +227,31 @@ async function stopIntegrityCheck(backup, auditSource) {
|
||||
async function clearTasks() {
|
||||
await database.query('UPDATE backups SET integrityCheckTaskId = NULL');
|
||||
}
|
||||
|
||||
export default {
|
||||
get,
|
||||
getByIdentifierAndStatePaged,
|
||||
getLatestInTargetByIdentifier, // brutal function name
|
||||
add,
|
||||
update,
|
||||
listByTypePaged,
|
||||
del,
|
||||
|
||||
removePrivateFields,
|
||||
|
||||
clearTasks,
|
||||
startIntegrityCheck,
|
||||
stopIntegrityCheck,
|
||||
setIntegrityResult,
|
||||
|
||||
BACKUP_IDENTIFIER_BOX: 'box',
|
||||
BACKUP_IDENTIFIER_MAIL: 'mail',
|
||||
|
||||
BACKUP_TYPE_APP,
|
||||
BACKUP_TYPE_BOX: 'box',
|
||||
BACKUP_TYPE_MAIL: 'mail',
|
||||
|
||||
BACKUP_STATE_NORMAL,
|
||||
BACKUP_STATE_CREATING: 'creating',
|
||||
BACKUP_STATE_ERROR: 'error',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user