option names now follow camelCase

This commit is contained in:
azivner
2018-04-02 21:47:46 -04:00
parent 429d3f518e
commit c6c76ba360
26 changed files with 77 additions and 63 deletions

View File

@@ -21,11 +21,11 @@ async function loginSync(req) {
const dbVersion = req.body.dbVersion;
if (dbVersion !== appInfo.db_version) {
return [400, { message: 'Non-matching db versions, local is version ' + appInfo.db_version }];
if (dbVersion !== appInfo.dbVersion) {
return [400, { message: 'Non-matching db versions, local is version ' + appInfo.dbVersion }];
}
const documentSecret = await options.getOption('document_secret');
const documentSecret = await options.getOption('documentSecret');
const expectedHash = utils.hmac(documentSecret, timestampStr);
const givenHash = req.body.hash;

View File

@@ -6,8 +6,8 @@ const appInfo = require('../../services/app_info');
async function getMigrationInfo() {
return {
db_version: parseInt(await optionService.getOption('db_version')),
app_db_version: appInfo.db_version
dbVersion: parseInt(await optionService.getOption('dbVersion')),
app_dbVersion: appInfo.dbVersion
};
}

View File

@@ -4,7 +4,7 @@ const sql = require('../../services/sql');
const optionService = require('../../services/options');
// options allowed to be updated directly in options dialog
const ALLOWED_OPTIONS = ['protected_session_timeout', 'note_revision_snapshot_time_interval'];
const ALLOWED_OPTIONS = ['protectedSessionTimeout', 'noteRevisionSnapshotTimeInterval'];
async function getOptions() {
const options = await sql.getMap("SELECT name, value FROM options WHERE name IN ("

View File

@@ -33,7 +33,7 @@ async function addRecentNote(req) {
await recentNote.save();
await optionService.setOption('start_note_path', notePath);
await optionService.setOption('startNotePath', notePath);
return await getRecentNotes();
}

View File

@@ -11,11 +11,11 @@ async function setup(req) {
await optionService.setOption('username', username);
await optionService.setOption('password_verification_salt', utils.randomSecureToken(32));
await optionService.setOption('password_derived_key_salt', utils.randomSecureToken(32));
await optionService.setOption('passwordVerificationSalt', utils.randomSecureToken(32));
await optionService.setOption('passwordDerivedKeySalt', utils.randomSecureToken(32));
const passwordVerificationKey = utils.toBase64(await myScryptService.getVerificationHash(password));
await optionService.setOption('password_verification_hash', passwordVerificationKey);
await optionService.setOption('passwordVerificationHash', passwordVerificationKey);
await passwordEncryptionService.setDataKey(password, utils.randomSecureToken(16));

View File

@@ -26,8 +26,8 @@ async function fillSyncRows() {
}
async function forceFullSync() {
await optionService.setOption('last_synced_pull', 0);
await optionService.setOption('last_synced_push', 0);
await optionService.setOption('lastSyncedPull', 0);
await optionService.setOption('lastSyncedPush', 0);
log.info("Forcing full sync.");

View File

@@ -51,7 +51,7 @@ async function getTree() {
});
return {
start_note_path: await optionService.getOption('start_note_path'),
startNotePath: await optionService.getOption('startNotePath'),
branches: branches,
notes: notes
};