lib/mbaasRequest/mbaasRequest.js
function validateCommonParams(params) {
  log.logger.debug({params: params}, "FH-MBAAS-CLIENT: validateCommonParams");
  var expectedParams = ["method", "data", "resourcePath", "environment", "domain"];

  var missingParam = validateParamsPresent(expectedParams, params);

  if (missingParam) {
    return missingParam;
  }

  //The resource Path Is Invalid If It Is An Object
  log.logger.debug('ResourcePath :: ', params.resourcePath);
  if (_.isObject(params.resourcePath)) {
    log.logger.debug('Resource Path Is Object, returning path key !!! ', params.resourcePath);
    return params.resourcePath.key;

  }

  //If it is a file request, the data entry must contain file params.
  if (params.fileRequest && params.fileUploadRequest) {
    missingParam = validateParamsPresent(["name", "type", "size", "stream"], params.data);
  }

  return missingParam;
}
function validateCommonParams(params) {
  log.logger.debug({params: params}, "FH-MBAAS-CLIENT: validateCommonParams");
  var expectedParams = ["method", "data", "resourcePath", "environment", "domain"];

  var missingParam = validateParamsPresent(expectedParams, params);

  if (missingParam) {
    return missingParam;
  }

  //The resource Path Is Invalid If It Is An Object
  log.logger.debug('ResourcePath :: ', params.resourcePath);
  if (_.isObject(params.resourcePath)) {
    log.logger.debug('Resource Path Is Object, returning path key !!! ', params.resourcePath);
    return params.resourcePath.key;

  }

  //If it is a file request, the data entry must contain file params.
  if (params.fileRequest && params.fileUploadRequest) {
    missingParam = validateParamsPresent(["name", "type", "size", "stream"], params.data);
  }

  return missingParam;
}
function validateCommonParams ( params ) { log . logger . debug ( { params : params } , "FH-MBAAS-CLIENT: validateCommonParams" ) ; var expectedParams = [ "method" , "data" , "resourcePath" , "environment" , "domain" ] ; var missingParam = validateParamsPresent ( expectedParams , params ) ; if ( missingParam ) { return missingParam ; } //The resource Path Is Invalid If It Is An Object log . logger . debug ( 'ResourcePath :: ' , params . resourcePath ) ; if ( _ . isObject ( params . resourcePath ) ) { log . logger . debug ( 'Resource Path Is Object, returning path key !!! ' , params . resourcePath ) ; return params . resourcePath . key ; } //If it is a file request, the data entry must contain file params. if ( params . fileRequest && params . fileUploadRequest ) { missingParam = validateParamsPresent ( [ "name" , "type" , "size" , "stream" ] , params . data ) ; } return missingParam ; }
Validating Common Params Between Admin and App MbaaS Requests
@param params
@private
Validating Common Params Between Admin and App MbaaS Requests