diff --git a/src/config/functions.ts b/src/config/functions.ts index b3412605..9ace79d1 100644 --- a/src/config/functions.ts +++ b/src/config/functions.ts @@ -23,7 +23,7 @@ export const fnSchema = { return config .getMany(['uuid', 'apiEndpoint', 'registered_at', 'deviceId']) .then(requiredValues => { - return _.every(_.values(requiredValues), Boolean); + return _.every(_.values(requiredValues)); }); }, osVersion: () => { diff --git a/src/config/index.ts b/src/config/index.ts index 86b4a15c..e1a21bdf 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -78,7 +78,7 @@ export class Config extends EventEmitter { }); } else if (FnSchema.fnSchema.hasOwnProperty(key)) { const fnKey = key as FnSchema.FnSchemaKey; - // Cast the promise as something that produes an unknown, and this means that + // Cast the promise as something that produces an unknown, and this means that // we can validate the output of the function as well, ensuring that the type matches const promiseValue = FnSchema.fnSchema[fnKey](this) as Bluebird< unknown @@ -220,15 +220,12 @@ export class Config extends EventEmitter { value = await this.configJsonBackend.get(key); break; case 'db': - value = await db('config') + const [conf] = await db('config') .select('value') - .where({ key }) - .then(([conf]: [{ value: string }]) => { - if (conf != null) { - return conf.value; - } - return; - }); + .where({ key }); + if (conf != null) { + return conf.value; + } break; } diff --git a/src/config/schema-type.ts b/src/config/schema-type.ts index 13a8aa82..7709b45c 100644 --- a/src/config/schema-type.ts +++ b/src/config/schema-type.ts @@ -24,7 +24,7 @@ export const schemaTypes = { }, deltaEndpoint: { type: t.string, - default: 'https://delta.resin.io', + default: 'https://delta.balena-cloud.com', }, uuid: { type: t.string,