Add no trailing whitespace and force eol at end of file. (#3154)
This commit is contained in:
committed by
Florent Vilmart
parent
7292fa7f11
commit
11f7712651
@@ -15,6 +15,8 @@
|
|||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": ["error", 2],
|
"indent": ["error", 2],
|
||||||
"linebreak-style": ["error", "unix"]
|
"linebreak-style": ["error", "unix"],
|
||||||
|
"no-trailing-spaces": 2,
|
||||||
|
"eol-last": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ export class AccountLockout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if the failed login count is greater than the threshold
|
* if the failed login count is greater than the threshold
|
||||||
* then sets lockout expiration to 'currenttime + accountPolicy.duration', i.e., account is locked out for the next 'accountPolicy.duration' minutes
|
* then sets lockout expiration to 'currenttime + accountPolicy.duration', i.e., account is locked out for the next 'accountPolicy.duration' minutes
|
||||||
* else do nothing
|
* else do nothing
|
||||||
*/
|
*/
|
||||||
_setLockoutExpiration() {
|
_setLockoutExpiration() {
|
||||||
@@ -147,8 +147,8 @@ export class AccountLockout {
|
|||||||
* set and/or increment _failed_login_count
|
* set and/or increment _failed_login_count
|
||||||
* if _failed_login_count > threshold
|
* if _failed_login_count > threshold
|
||||||
* set the _account_lockout_expires_at to current_time + accountPolicy.duration
|
* set the _account_lockout_expires_at to current_time + accountPolicy.duration
|
||||||
* else
|
* else
|
||||||
* do nothing
|
* do nothing
|
||||||
*/
|
*/
|
||||||
_handleFailedLoginAttempt() {
|
_handleFailedLoginAttempt() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -175,7 +175,7 @@ export class AccountLockout {
|
|||||||
if (!this._config.accountLockout) {
|
if (!this._config.accountLockout) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this._notLocked()
|
this._notLocked()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*eslint no-unused-vars: "off"*/
|
/*eslint no-unused-vars: "off"*/
|
||||||
export class AnalyticsAdapter {
|
export class AnalyticsAdapter {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@param parameters: the analytics request body, analytics info will be in the dimensions property
|
@param parameters: the analytics request body, analytics info will be in the dimensions property
|
||||||
@param req: the original http request
|
@param req: the original http request
|
||||||
@@ -8,7 +8,7 @@ export class AnalyticsAdapter {
|
|||||||
appOpened(parameters, req) {
|
appOpened(parameters, req) {
|
||||||
return Promise.resolve({});
|
return Promise.resolve({});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@param eventName: the name of the custom eventName
|
@param eventName: the name of the custom eventName
|
||||||
@param parameters: the analytics request body, analytics info will be in the dimensions property
|
@param parameters: the analytics request body, analytics info will be in the dimensions property
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export class MailAdapter {
|
|||||||
* - subject: the subject of the email
|
* - subject: the subject of the email
|
||||||
*/
|
*/
|
||||||
sendMail(options) {}
|
sendMail(options) {}
|
||||||
|
|
||||||
/* You can implement those methods if you want
|
/* You can implement those methods if you want
|
||||||
* to provide HTML templates etc...
|
* to provide HTML templates etc...
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ const transformKey = (className, fieldName, schema) => {
|
|||||||
case 'updatedAt': return '_updated_at';
|
case 'updatedAt': return '_updated_at';
|
||||||
case 'sessionToken': return '_session_token';
|
case 'sessionToken': return '_session_token';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schema.fields[fieldName] && schema.fields[fieldName].__type == 'Pointer') {
|
if (schema.fields[fieldName] && schema.fields[fieldName].__type == 'Pointer') {
|
||||||
fieldName = '_p_' + fieldName;
|
fieldName = '_p_' + fieldName;
|
||||||
} else if (schema.fields[fieldName] && schema.fields[fieldName].type == 'Pointer') {
|
} else if (schema.fields[fieldName] && schema.fields[fieldName].type == 'Pointer') {
|
||||||
@@ -911,7 +911,7 @@ var BytesCoder = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
isValidDatabaseObject(object) {
|
isValidDatabaseObject(object) {
|
||||||
return (object instanceof mongodb.Binary) || this.isBase64Value(object);
|
return (object instanceof mongodb.Binary) || this.isBase64Value(object);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const handleDotFields = (object) => {
|
|||||||
value = undefined;
|
value = undefined;
|
||||||
}
|
}
|
||||||
/* eslint-disable no-cond-assign */
|
/* eslint-disable no-cond-assign */
|
||||||
while(next = components.shift()) {
|
while(next = components.shift()) {
|
||||||
/* eslint-enable no-cond-assign */
|
/* eslint-enable no-cond-assign */
|
||||||
currentObj[next] = currentObj[next] || {};
|
currentObj[next] = currentObj[next] || {};
|
||||||
if (components.length === 0) {
|
if (components.length === 0) {
|
||||||
@@ -149,7 +149,7 @@ const validateKeys = (object) => {
|
|||||||
|
|
||||||
if(key.includes('$') || key.includes('.')){
|
if(key.includes('$') || key.includes('.')){
|
||||||
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
|
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ const joinTablesForSchema = (schema) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildWhereClause = ({ schema, query, index }) => {
|
const buildWhereClause = ({ schema, query, index }) => {
|
||||||
let patterns = [];
|
let patterns = [];
|
||||||
@@ -174,8 +174,8 @@ const buildWhereClause = ({ schema, query, index }) => {
|
|||||||
|
|
||||||
schema = toPostgresSchema(schema);
|
schema = toPostgresSchema(schema);
|
||||||
for (let fieldName in query) {
|
for (let fieldName in query) {
|
||||||
let isArrayField = schema.fields
|
let isArrayField = schema.fields
|
||||||
&& schema.fields[fieldName]
|
&& schema.fields[fieldName]
|
||||||
&& schema.fields[fieldName].type === 'Array';
|
&& schema.fields[fieldName].type === 'Array';
|
||||||
let initialPatternsLength = patterns.length;
|
let initialPatternsLength = patterns.length;
|
||||||
let fieldValue = query[fieldName];
|
let fieldValue = query[fieldName];
|
||||||
@@ -186,14 +186,14 @@ const buildWhereClause = ({ schema, query, index }) => {
|
|||||||
if (fieldValue.$exists === false) {
|
if (fieldValue.$exists === false) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldName.indexOf('.') >= 0) {
|
if (fieldName.indexOf('.') >= 0) {
|
||||||
let components = fieldName.split('.').map((cmpt, index) => {
|
let components = fieldName.split('.').map((cmpt, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
return `"${cmpt}"`;
|
return `"${cmpt}"`;
|
||||||
}
|
}
|
||||||
return `'${cmpt}'`;
|
return `'${cmpt}'`;
|
||||||
});
|
});
|
||||||
let name = components.slice(0, components.length-1).join('->');
|
let name = components.slice(0, components.length-1).join('->');
|
||||||
name+='->>'+components[components.length-1];
|
name+='->>'+components[components.length-1];
|
||||||
@@ -252,7 +252,7 @@ const buildWhereClause = ({ schema, query, index }) => {
|
|||||||
const isInOrNin = Array.isArray(fieldValue.$in) || Array.isArray(fieldValue.$nin);
|
const isInOrNin = Array.isArray(fieldValue.$in) || Array.isArray(fieldValue.$nin);
|
||||||
if (Array.isArray(fieldValue.$in) &&
|
if (Array.isArray(fieldValue.$in) &&
|
||||||
isArrayField &&
|
isArrayField &&
|
||||||
schema.fields[fieldName].contents &&
|
schema.fields[fieldName].contents &&
|
||||||
schema.fields[fieldName].contents.type === 'String') {
|
schema.fields[fieldName].contents.type === 'String') {
|
||||||
let inPatterns = [];
|
let inPatterns = [];
|
||||||
let allowNull = false;
|
let allowNull = false;
|
||||||
@@ -439,7 +439,7 @@ export class PostgresStorageAdapter {
|
|||||||
return this._client.tx(t => {
|
return this._client.tx(t => {
|
||||||
const q1 = this.createTable(className, schema, t);
|
const q1 = this.createTable(className, schema, t);
|
||||||
const q2 = t.none('INSERT INTO "_SCHEMA" ("className", "schema", "isParseClass") VALUES ($<className>, $<schema>, true)', { className, schema });
|
const q2 = t.none('INSERT INTO "_SCHEMA" ("className", "schema", "isParseClass") VALUES ($<className>, $<schema>, true)', { className, schema });
|
||||||
|
|
||||||
return t.batch([q1, q2]);
|
return t.batch([q1, q2]);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -680,7 +680,7 @@ export class PostgresStorageAdapter {
|
|||||||
delete object[fieldName];
|
delete object[fieldName];
|
||||||
fieldName = 'authData';
|
fieldName = 'authData';
|
||||||
}
|
}
|
||||||
|
|
||||||
columnsArray.push(fieldName);
|
columnsArray.push(fieldName);
|
||||||
if (!schema.fields[fieldName] && className === '_User') {
|
if (!schema.fields[fieldName] && className === '_User') {
|
||||||
if (fieldName === '_email_verify_token' ||
|
if (fieldName === '_email_verify_token' ||
|
||||||
@@ -726,7 +726,7 @@ export class PostgresStorageAdapter {
|
|||||||
} else {
|
} else {
|
||||||
valuesArray.push(JSON.stringify(object[fieldName]));
|
valuesArray.push(JSON.stringify(object[fieldName]));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Object':
|
case 'Object':
|
||||||
case 'String':
|
case 'String':
|
||||||
case 'Number':
|
case 'Number':
|
||||||
@@ -843,7 +843,7 @@ export class PostgresStorageAdapter {
|
|||||||
// This recursively sets the json_object
|
// This recursively sets the json_object
|
||||||
// Only 1 level deep
|
// Only 1 level deep
|
||||||
let generate = (jsonb, key, value) => {
|
let generate = (jsonb, key, value) => {
|
||||||
return `json_object_set_key(COALESCE(${jsonb}, '{}'::jsonb), ${key}, ${value})::jsonb`;
|
return `json_object_set_key(COALESCE(${jsonb}, '{}'::jsonb), ${key}, ${value})::jsonb`;
|
||||||
}
|
}
|
||||||
let lastKey = `$${index}:name`;
|
let lastKey = `$${index}:name`;
|
||||||
let fieldNameIndex = index;
|
let fieldNameIndex = index;
|
||||||
@@ -926,7 +926,7 @@ export class PostgresStorageAdapter {
|
|||||||
&& schema.fields[fieldName]
|
&& schema.fields[fieldName]
|
||||||
&& schema.fields[fieldName].type === 'Object') {
|
&& schema.fields[fieldName].type === 'Object') {
|
||||||
const keysToDelete = Object.keys(originalUpdate).filter(k => {
|
const keysToDelete = Object.keys(originalUpdate).filter(k => {
|
||||||
// choose top level fields that have a delete operation set
|
// choose top level fields that have a delete operation set
|
||||||
return originalUpdate[k].__op === 'Delete' && k.split('.').length === 2
|
return originalUpdate[k].__op === 'Delete' && k.split('.').length === 2
|
||||||
}).map(k => k.split('.')[1]);
|
}).map(k => k.split('.')[1]);
|
||||||
|
|
||||||
@@ -990,7 +990,7 @@ export class PostgresStorageAdapter {
|
|||||||
let values = [className];
|
let values = [className];
|
||||||
let where = buildWhereClause({ schema, query, index: 2 })
|
let where = buildWhereClause({ schema, query, index: 2 })
|
||||||
values.push(...where.values);
|
values.push(...where.values);
|
||||||
|
|
||||||
const wherePattern = where.pattern.length > 0 ? `WHERE ${where.pattern}` : '';
|
const wherePattern = where.pattern.length > 0 ? `WHERE ${where.pattern}` : '';
|
||||||
const limitPattern = hasLimit ? `LIMIT $${values.length + 1}` : '';
|
const limitPattern = hasLimit ? `LIMIT $${values.length + 1}` : '';
|
||||||
if (hasLimit) {
|
if (hasLimit) {
|
||||||
|
|||||||
@@ -903,7 +903,7 @@ DatabaseController.prototype.performInitizalization = function() {
|
|||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create tables for volatile classes
|
// Create tables for volatile classes
|
||||||
let adapterInit = this.adapter.performInitialization({ VolatileClassesSchemas: SchemaController.VolatileClassesSchemas });
|
let adapterInit = this.adapter.performInitialization({ VolatileClassesSchemas: SchemaController.VolatileClassesSchemas });
|
||||||
return Promise.all([usernameUniqueness, emailUniqueness, adapterInit]);
|
return Promise.all([usernameUniqueness, emailUniqueness, adapterInit]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ class ParseLiveQueryServer {
|
|||||||
if (classSubscriptions.size === 0) {
|
if (classSubscriptions.size === 0) {
|
||||||
this.subscriptions.delete(className);
|
this.subscriptions.delete(className);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!notifyClient) {
|
if (!notifyClient) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ function ParseServerRESTController(applicationId, router) {
|
|||||||
function handleRequest(method, path, data = {}, options = {}) {
|
function handleRequest(method, path, data = {}, options = {}) {
|
||||||
// Store the arguments, for later use if internal fails
|
// Store the arguments, for later use if internal fails
|
||||||
let args = arguments;
|
let args = arguments;
|
||||||
|
|
||||||
let config = new Config(applicationId);
|
let config = new Config(applicationId);
|
||||||
let serverURL = URL.parse(config.serverURL);
|
let serverURL = URL.parse(config.serverURL);
|
||||||
if (path.indexOf(serverURL.path) === 0) {
|
if (path.indexOf(serverURL.path) === 0) {
|
||||||
|
|||||||
@@ -674,7 +674,7 @@ RestWrite.prototype.handleInstallation = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Updating _Installation but not updating anything critical
|
// Updating _Installation but not updating anything critical
|
||||||
if (this.query && !this.data.deviceToken
|
if (this.query && !this.data.deviceToken
|
||||||
&& !installationId && !this.data.deviceType) {
|
&& !installationId && !this.data.deviceType) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ export class CloudCodeRouter extends PromiseRouter {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const APP_STORE_ERRORS = {
|
|||||||
21005: "The receipt server is not currently available.",
|
21005: "The receipt server is not currently available.",
|
||||||
21006: "This receipt is valid but the subscription has expired.",
|
21006: "This receipt is valid but the subscription has expired.",
|
||||||
21007: "This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead.",
|
21007: "This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead.",
|
||||||
21008: "This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead."
|
21008: "This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead."
|
||||||
}
|
}
|
||||||
|
|
||||||
function appStoreError(status) {
|
function appStoreError(status) {
|
||||||
@@ -49,7 +49,7 @@ function getFileForProductIdentifier(productIdentifier, req) {
|
|||||||
// Error not found or too many
|
// Error not found or too many
|
||||||
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Object not found.')
|
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Object not found.')
|
||||||
}
|
}
|
||||||
|
|
||||||
var download = products[0].download;
|
var download = products[0].download;
|
||||||
return Promise.resolve({response: download});
|
return Promise.resolve({response: download});
|
||||||
});
|
});
|
||||||
@@ -58,16 +58,16 @@ function getFileForProductIdentifier(productIdentifier, req) {
|
|||||||
|
|
||||||
|
|
||||||
export class IAPValidationRouter extends PromiseRouter {
|
export class IAPValidationRouter extends PromiseRouter {
|
||||||
|
|
||||||
handleRequest(req) {
|
handleRequest(req) {
|
||||||
let receipt = req.body.receipt;
|
let receipt = req.body.receipt;
|
||||||
const productIdentifier = req.body.productIdentifier;
|
const productIdentifier = req.body.productIdentifier;
|
||||||
|
|
||||||
if (!receipt || ! productIdentifier) {
|
if (!receipt || ! productIdentifier) {
|
||||||
// TODO: Error, malformed request
|
// TODO: Error, malformed request
|
||||||
throw new Parse.Error(Parse.Error.INVALID_JSON, "missing receipt or productIdentifier");
|
throw new Parse.Error(Parse.Error.INVALID_JSON, "missing receipt or productIdentifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform the object if there
|
// Transform the object if there
|
||||||
// otherwise assume it's in Base64 already
|
// otherwise assume it's in Base64 already
|
||||||
if (typeof receipt == "object") {
|
if (typeof receipt == "object") {
|
||||||
@@ -75,7 +75,7 @@ export class IAPValidationRouter extends PromiseRouter {
|
|||||||
receipt = receipt.base64;
|
receipt = receipt.base64;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.NODE_ENV == "test" && req.body.bypassAppStoreValidation) {
|
if (process.env.NODE_ENV == "test" && req.body.bypassAppStoreValidation) {
|
||||||
return getFileForProductIdentifier(productIdentifier, req);
|
return getFileForProductIdentifier(productIdentifier, req);
|
||||||
}
|
}
|
||||||
@@ -87,9 +87,9 @@ export class IAPValidationRouter extends PromiseRouter {
|
|||||||
function errorCallback(error) {
|
function errorCallback(error) {
|
||||||
return Promise.resolve({response: appStoreError(error.status) });
|
return Promise.resolve({response: appStoreError(error.status) });
|
||||||
}
|
}
|
||||||
|
|
||||||
return validateWithAppStore(IAP_PRODUCTION_URL, receipt).then( () => {
|
return validateWithAppStore(IAP_PRODUCTION_URL, receipt).then( () => {
|
||||||
|
|
||||||
return successCallback();
|
return successCallback();
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
@@ -100,12 +100,12 @@ export class IAPValidationRouter extends PromiseRouter {
|
|||||||
return errorCallback(error);
|
return errorCallback(error);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return errorCallback(error);
|
return errorCallback(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mountRoutes() {
|
mountRoutes() {
|
||||||
this.route("POST","/validate_purchase", this.handleRequest);
|
this.route("POST","/validate_purchase", this.handleRequest);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,4 +221,4 @@ OAuth.signRequest = function(request, oauth_parameters, consumer_secret, auth_to
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = OAuth;
|
module.exports = OAuth;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function validateAuthToken(id, token) {
|
|||||||
// Returns a promise that fulfills if this user id is valid.
|
// Returns a promise that fulfills if this user id is valid.
|
||||||
function validateAuthData(authData) {
|
function validateAuthData(authData) {
|
||||||
if (authData.id_token) {
|
if (authData.id_token) {
|
||||||
return validateIdToken(authData.id, authData.id_token);
|
return validateIdToken(authData.id, authData.id_token);
|
||||||
} else {
|
} else {
|
||||||
return validateAuthToken(authData.id, authData.access_token).then(() => {
|
return validateAuthToken(authData.id, authData.access_token).then(() => {
|
||||||
// Validation with auth token worked
|
// Validation with auth token worked
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function validateAuthData(authData, options) {
|
|||||||
client.host = "api.twitter.com";
|
client.host = "api.twitter.com";
|
||||||
client.auth_token = authData.auth_token;
|
client.auth_token = authData.auth_token;
|
||||||
client.auth_token_secret = authData.auth_token_secret;
|
client.auth_token_secret = authData.auth_token_secret;
|
||||||
|
|
||||||
return client.get("/1.1/account/verify_credentials.json").then((data) => {
|
return client.get("/1.1/account/verify_credentials.json").then((data) => {
|
||||||
if (data && data.id_str == ''+authData.id) {
|
if (data && data.id_str == ''+authData.id) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ var Parse = require('parse/node').Parse;
|
|||||||
var logger = require('../logger').default;
|
var logger = require('../logger').default;
|
||||||
|
|
||||||
// Returns a promise that fulfills iff this user id is valid.
|
// Returns a promise that fulfills iff this user id is valid.
|
||||||
function validateAuthData(authData, params) {
|
function validateAuthData(authData, params) {
|
||||||
return vkOAuth2Request(params).then(function (response) {
|
return vkOAuth2Request(params).then(function (response) {
|
||||||
if (response && response && response.access_token) {
|
if (response && response && response.access_token) {
|
||||||
return request("api.vk.com", "method/secure.checkToken?token=" + authData.access_token + "&client_secret=" + params.appSecret + "&access_token=" + response.access_token).then(function (response) {
|
return request("api.vk.com", "method/secure.checkToken?token=" + authData.access_token + "&client_secret=" + params.appSecret + "&access_token=" + response.access_token).then(function (response) {
|
||||||
@@ -59,4 +59,4 @@ function request(host, path) {
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
validateAppId: validateAppId,
|
validateAppId: validateAppId,
|
||||||
validateAuthData: validateAuthData
|
validateAuthData: validateAuthData
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function makeBatchRoutingPathFunction(originalUrl, serverURL, publicServerURL) {
|
|||||||
return path.posix.join('/', requestPath.slice(apiPrefix.length));
|
return path.posix.join('/', requestPath.slice(apiPrefix.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serverURL && publicServerURL
|
if (serverURL && publicServerURL
|
||||||
&& (serverURL.path != publicServerURL.path)) {
|
&& (serverURL.path != publicServerURL.path)) {
|
||||||
let localPath = serverURL.path;
|
let localPath = serverURL.path;
|
||||||
let publicPath = publicServerURL.path;
|
let publicPath = publicServerURL.path;
|
||||||
|
|||||||
@@ -35,4 +35,4 @@ export default function({
|
|||||||
start(program, options, function() {
|
start(program, options, function() {
|
||||||
logStartupOptions(options);
|
logStartupOptions(options);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default class HTTPResponse {
|
|||||||
} else if (!_text && _data) {
|
} else if (!_text && _data) {
|
||||||
_text = JSON.stringify(_data);
|
_text = JSON.stringify(_data);
|
||||||
}
|
}
|
||||||
return _text;
|
return _text;
|
||||||
}
|
}
|
||||||
|
|
||||||
let getData = () => {
|
let getData = () => {
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ export function handleParseHeaders(req, res, next) {
|
|||||||
|
|
||||||
return Promise.resolve().then(() => {
|
return Promise.resolve().then(() => {
|
||||||
// handle the upgradeToRevocableSession path on it's own
|
// handle the upgradeToRevocableSession path on it's own
|
||||||
if (info.sessionToken &&
|
if (info.sessionToken &&
|
||||||
req.url === '/upgradeToRevocableSession' &&
|
req.url === '/upgradeToRevocableSession' &&
|
||||||
info.sessionToken.indexOf('r:') != 0) {
|
info.sessionToken.indexOf('r:') != 0) {
|
||||||
return auth.getAuthForLegacySessionToken({ config: req.config, installationId: info.installationId, sessionToken: info.sessionToken })
|
return auth.getAuthForLegacySessionToken({ config: req.config, installationId: info.installationId, sessionToken: info.sessionToken })
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ function del(config, auth, className, objectId) {
|
|||||||
objectId: objectId
|
objectId: objectId
|
||||||
}, options);
|
}, options);
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
return triggers.maybeRunTrigger(triggers.Types.afterDelete, auth, inflatedObject, null, config);
|
return triggers.maybeRunTrigger(triggers.Types.afterDelete, auth, inflatedObject, null, config);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ export function getResponseObject(request, resolve, reject) {
|
|||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (request.triggerName === Types.afterFind) {
|
if (request.triggerName === Types.afterFind) {
|
||||||
if(!response){
|
if(!response){
|
||||||
response = request.objects;
|
response = request.objects;
|
||||||
}
|
}
|
||||||
response = response.map(object => {
|
response = response.map(object => {
|
||||||
return object.toJSON();
|
return object.toJSON();
|
||||||
@@ -255,11 +255,11 @@ export function maybeRunAfterFindTrigger(triggerType, auth, className, objects,
|
|||||||
if (!trigger) {
|
if (!trigger) {
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
const request = getRequestObject(triggerType, auth, null, null, config);
|
const request = getRequestObject(triggerType, auth, null, null, config);
|
||||||
const response = getResponseObject(request,
|
const response = getResponseObject(request,
|
||||||
object => {
|
object => {
|
||||||
resolve(object);
|
resolve(object);
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user