lib/helpers/get-form-view-model.js
function getAccountStores(application, callback) {
  var options = { expand: 'accountStore' };

  // Get account store mappings.
  application.getAccountStoreMappings(options, function (err, accountStoreMappings) {
    if (err) {
      return callback(err);
    }

    // Iterate over all account stores, and filter out the ones that
    // don't have a provider (Organizations dont have providers)
    accountStoreMappings.filter(function (accountStoreMapping, next) {
      next(!!accountStoreMapping.accountStore.provider);
    }, function (accountStoreMappings) {
      if (err) {
        return callback(err);
      }

      // Get the account store, and expand the provider so that we can
      // inspect the provider ID
      async.map(accountStoreMappings, function (accountStoreMapping, next) {
        accountStoreMapping.getAccountStore({ expand: 'provider' }, next);
      }, callback);
    });
  });
}
function getAccountStores(application, callback) {
  var options = { expand: 'accountStore' };

  // Get account store mappings.
  application.getAccountStoreMappings(options, function (err, accountStoreMappings) {
    if (err) {
      return callback(err);
    }

    // Iterate over all account stores, and filter out the ones that
    // don't have a provider (Organizations dont have providers)
    accountStoreMappings.filter(function (accountStoreMapping, next) {
      next(!!accountStoreMapping.accountStore.provider);
    }, function (accountStoreMappings) {
      if (err) {
        return callback(err);
      }

      // Get the account store, and expand the provider so that we can
      // inspect the provider ID
      async.map(accountStoreMappings, function (accountStoreMapping, next) {
        accountStoreMapping.getAccountStore({ expand: 'provider' }, next);
      }, callback);
    });
  });
}
function getAccountStores ( application , callback ) { var options = { expand : 'accountStore' } ; // Get account store mappings. application . getAccountStoreMappings ( options , function ( err , accountStoreMappings ) { if ( err ) { return callback ( err ) ; } // Iterate over all account stores, and filter out the ones that // don't have a provider (Organizations dont have providers) accountStoreMappings . filter ( function ( accountStoreMapping , next ) { next ( ! ! accountStoreMapping . accountStore . provider ) ; } , function ( accountStoreMappings ) { if ( err ) { return callback ( err ) ; } // Get the account store, and expand the provider so that we can // inspect the provider ID async . map ( accountStoreMappings , function ( accountStoreMapping , next ) { accountStoreMapping . getAccountStore ( { expand : 'provider' } , next ) ; } , callback ) ; } ) ; } ) ; }
Returns a list of account stores for the specified application.

@method

@param {Object} application - The Stormpath Application to get account stores from.
@param {Function} callback - Callback function (error, providers).
Returns a list of account stores for the specified application .