code: function resolveDataSourceOptions(resourceTree, dataSources, primaryName) {
      if (resourceTree.filter) {
          dataSources[primaryName].filter = resourceTree.filter.map(andFilter =>
              andFilter.map(filter => {
                  if (!filter.attribute[primaryName]) {
                      throw new ImplementationError('All filtered attributes must be mapped to primary DataSource');
                  }
  
                  filter.attribute = filter.attribute[primaryName];
                  if (filter.attribute.length === 1) {
                      filter.attribute = filter.attribute[0];
                  }
  
                  return filter;
              })
          );
      }
  
      if ('search' in resourceTree) {
          dataSources[primaryName].search = resourceTree.search;
      }
  
      if (resourceTree.order) {
          dataSources[primaryName].order = resourceTree.order.map(order => {
              if (!order.attribute[primaryName]) {
                  throw new ImplementationError('All ordered attributes must be mapped to primary DataSource');
              }
  
              order.attribute = order.attribute[primaryName];
  
              return order;
          });
      }
  
      // TODO: Allow filter/order in different than the primary DataSource?
  
      if (has(resourceTree, 'limit')) {
          dataSources[primaryName].limit = resourceTree.limit;
      }
  
      if (resourceTree.limitPerGroup && resourceTree.childKey) {
          const limitPer = resourceTree.childKey[primaryName];
          dataSources[primaryName].limitPer = limitPer.length === 1 ? limitPer[0] : limitPer;
      }
  
      if (resourceTree.page) {
          dataSources[primaryName].page = resourceTree.page;
      }
  }
docs: Process options: filter, search, order, limit, page and finally resolve them to
  primary DataSource.
  
  @private