@@ -39,7 +39,7 @@ export class AdaptableController {
|
||||
|
||||
validateAdapter(adapter) {
|
||||
if (!adapter) {
|
||||
throw new Error(this.constructor.name+" requires an adapter");
|
||||
throw new Error(this.constructor.name + " requires an adapter");
|
||||
}
|
||||
|
||||
const Type = this.expectedAdapterType();
|
||||
|
||||
@@ -134,7 +134,7 @@ export class LoggerController extends AdaptableController {
|
||||
// until (optional) End time for the search. Defaults to current time.
|
||||
// order (optional) Direction of results returned, either “asc” or “desc”. Defaults to “desc”.
|
||||
// size (optional) Number of rows returned by search. Defaults to 10
|
||||
getLogs(options= {}) {
|
||||
getLogs(options = {}) {
|
||||
if (!this.adapter) {
|
||||
throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED,
|
||||
'Logger adapter is not available');
|
||||
|
||||
@@ -110,8 +110,8 @@ export class PushController extends AdaptableController {
|
||||
if (installation.deviceType != "ios") {
|
||||
badge = UNSUPPORTED_BADGE_KEY;
|
||||
}
|
||||
map[badge+''] = map[badge+''] || [];
|
||||
map[badge+''].push(installation);
|
||||
map[badge + ''] = map[badge + ''] || [];
|
||||
map[badge + ''].push(installation);
|
||||
return map;
|
||||
}, {});
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ export default class SchemaCache {
|
||||
}
|
||||
|
||||
put(key, value) {
|
||||
return this.cache.get(this.prefix+ALL_KEYS).then((allKeys) => {
|
||||
return this.cache.get(this.prefix + ALL_KEYS).then((allKeys) => {
|
||||
allKeys = allKeys || {};
|
||||
allKeys[key] = true;
|
||||
return Promise.all([this.cache.put(this.prefix+ALL_KEYS, allKeys, this.ttl), this.cache.put(key, value, this.ttl)]);
|
||||
return Promise.all([this.cache.put(this.prefix + ALL_KEYS, allKeys, this.ttl), this.cache.put(key, value, this.ttl)]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,32 +32,32 @@ export default class SchemaCache {
|
||||
if (!this.ttl) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.cache.get(this.prefix+MAIN_SCHEMA);
|
||||
return this.cache.get(this.prefix + MAIN_SCHEMA);
|
||||
}
|
||||
|
||||
setAllClasses(schema) {
|
||||
if (!this.ttl) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.put(this.prefix+MAIN_SCHEMA, schema);
|
||||
return this.put(this.prefix + MAIN_SCHEMA, schema);
|
||||
}
|
||||
|
||||
setOneSchema(className, schema) {
|
||||
if (!this.ttl) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.put(this.prefix+className, schema);
|
||||
return this.put(this.prefix + className, schema);
|
||||
}
|
||||
|
||||
getOneSchema(className) {
|
||||
if (!this.ttl) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
return this.cache.get(this.prefix+className).then((schema) => {
|
||||
return this.cache.get(this.prefix + className).then((schema) => {
|
||||
if (schema) {
|
||||
return Promise.resolve(schema);
|
||||
}
|
||||
return this.cache.get(this.prefix+MAIN_SCHEMA).then((cachedSchemas) => {
|
||||
return this.cache.get(this.prefix + MAIN_SCHEMA).then((cachedSchemas) => {
|
||||
cachedSchemas = cachedSchemas || [];
|
||||
schema = cachedSchemas.find((cachedSchema) => {
|
||||
return cachedSchema.className === className;
|
||||
@@ -72,7 +72,7 @@ export default class SchemaCache {
|
||||
|
||||
clear() {
|
||||
// That clears all caches...
|
||||
return this.cache.get(this.prefix+ALL_KEYS).then((allKeys) => {
|
||||
return this.cache.get(this.prefix + ALL_KEYS).then((allKeys) => {
|
||||
if (!allKeys) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -742,7 +742,7 @@ export default class SchemaController {
|
||||
if (missingColumns.length > 0) {
|
||||
throw new Parse.Error(
|
||||
Parse.Error.INCORRECT_TYPE,
|
||||
missingColumns[0]+' is required.');
|
||||
missingColumns[0] + ' is required.');
|
||||
}
|
||||
return Promise.resolve(this);
|
||||
}
|
||||
@@ -947,7 +947,7 @@ function getObjectType(obj) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, "This is not a valid "+obj.__type);
|
||||
throw new Parse.Error(Parse.Error.INCORRECT_TYPE, "This is not a valid " + obj.__type);
|
||||
}
|
||||
if (obj['$ne']) {
|
||||
return getObjectType(obj['$ne']);
|
||||
|
||||
Reference in New Issue
Block a user