Comparing version 0.6.0 to 0.6.1
@@ -121,4 +121,4 @@ import falcorPathParser from 'falcor-path-syntax'; | ||
}, { | ||
key: 'getManyMyTourTipViews', | ||
value: function getManyMyTourTipViews(options) { | ||
key: 'getManyTourTipViews', | ||
value: function getManyTourTipViews(options) { | ||
// TODO: Account for implicit assumptions in the final API: | ||
@@ -132,4 +132,6 @@ // - Query, filter, and paging options will need to be passed through | ||
var path = ['self', 'tour_tip_view_list', { from: from, to: to }, ['id', 'user_id', 'state']]; | ||
var properties = buildProperties(tourTipViews, options); | ||
var path = ['self', 'tour_tip_view_list', { from: from, to: to }, properties]; | ||
return this.falcor.get(path).then(function (response) { | ||
@@ -159,20 +161,4 @@ var viewsList = get(response, 'json.self.tour_tip_view_list'); | ||
// Determine which properties we'll start with | ||
var properties = concat([], options.properties || moments); | ||
var properties = buildProperties(moments, options); | ||
// Include any additional properties | ||
var toAnd = options.andProperties; | ||
if (isArray(toAnd) && !isEmpty(toAnd)) { | ||
properties = concat(properties, toAnd); | ||
} | ||
// Remove any excluded properties | ||
var toNot = options.notProperties; | ||
if (isArray(toNot) && !isEmpty(toNot)) { | ||
properties = pullAll(properties, toNot); | ||
} | ||
// Ensure we have a unique list of properties | ||
properties = uniq(properties); | ||
/* | ||
@@ -206,16 +192,4 @@ * As SuperGloo's property syntax is a subset of the Falcor | ||
var properties = concat([], options.properties || tourTipViews); | ||
var properties = buildProperties(tourTipViews, options); | ||
var toAnd = options.andProperties; | ||
if (isArray(toAnd) && !isEmpty(toAnd)) { | ||
properties = concat(properties, toAnd); | ||
} | ||
var toNot = options.notProperties; | ||
if (isArray(toNot) && !isEmpty(toNot)) { | ||
properties = pullAll(properties, toNot); | ||
} | ||
properties = uniq(properties); | ||
var falcorPaths = properties.map(function (property) { | ||
@@ -313,2 +287,20 @@ var path = falcorPathParser(property); | ||
function buildProperties(defaults, options) { | ||
var properties = concat([], options.properties || defaults); | ||
var toAnd = options.andProperties; | ||
if (isArray(toAnd) && !isEmpty(toAnd)) { | ||
properties = concat(properties, toAnd); | ||
} | ||
var toNot = options.notProperties; | ||
if (isArray(toNot) && !isEmpty(toNot)) { | ||
properties = pullAll(properties, toNot); | ||
} | ||
properties = uniq(properties); | ||
return properties; | ||
} | ||
var codeToMessageMap = { | ||
@@ -315,0 +307,0 @@ 400: 'malformed request', |
{ | ||
"name": "supergloo", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Easily work with data on the Gloo platform", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
329476
9667