@arranger/middleware
Advanced tools
Comparing version 0.2.2 to 0.2.4
@@ -12,8 +12,12 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -46,35 +50,42 @@ | ||
query = _ref5.query; | ||
var filtered = Object.entries((0, _lodash.get)(query, _constants.ES_BOOL, {})).reduce(function (bool, _ref6) { | ||
var _ref7 = _slicedToArray(_ref6, 2), | ||
type = _ref7[0], | ||
values = _ref7[1]; | ||
var nested = (0, _lodash.get)(query, _constants.ES_NESTED); | ||
var nestedQuery = (0, _lodash.get)(nested, _constants.ES_QUERY); | ||
var bool = (0, _lodash.get)(query, _constants.ES_BOOL); | ||
var filteredValues = values.map(function (value) { | ||
if (['terms', 'range'].some(function (k) { | ||
return (0, _lodash.get)(value, [k, field]); | ||
})) return null; | ||
var nested = (0, _lodash.get)(value, _constants.ES_NESTED); | ||
var nestedQuery = (0, _lodash.get)(nested, _constants.ES_QUERY); | ||
if (['terms', 'range'].some(function (k) { | ||
return (0, _lodash.get)(query, [k, field]); | ||
})) { | ||
return null; | ||
} else if (nestedQuery) { | ||
var cleaned = removeFieldFromQuery({ | ||
field: field, | ||
query: nestedQuery | ||
}); | ||
return cleaned && _objectSpread({}, query, _defineProperty({}, _constants.ES_NESTED, _objectSpread({}, nested, _defineProperty({}, _constants.ES_QUERY, cleaned)))); | ||
} else if (bool) { | ||
var filtered = Object.entries(bool).reduce(function (bool, _ref6) { | ||
var _ref7 = _slicedToArray(_ref6, 2), | ||
type = _ref7[0], | ||
values = _ref7[1]; | ||
if (nestedQuery) { | ||
var cleaned = removeFieldFromQuery({ | ||
var filteredValues = values.map(function (value) { | ||
return removeFieldFromQuery({ | ||
field: field, | ||
query: nestedQuery | ||
query: value | ||
}); | ||
return cleaned && _defineProperty({}, _constants.ES_NESTED, _extends({}, nested, _defineProperty({}, _constants.ES_QUERY, cleaned))); | ||
} else { | ||
return value; | ||
} | ||
}).filter(Boolean); | ||
return filteredValues.length > 0 ? _extends({}, bool, _defineProperty({}, type, filteredValues)) : bool; | ||
}, {}); | ||
return Object.keys(filtered).length > 0 ? _defineProperty({}, _constants.ES_BOOL, filtered) : null; | ||
}).filter(Boolean); | ||
return filteredValues.length > 0 ? _objectSpread({}, bool, _defineProperty({}, type, filteredValues)) : bool; | ||
}, {}); | ||
return Object.keys(filtered).length > 0 ? _defineProperty({}, _constants.ES_BOOL, filtered) : null; | ||
} else { | ||
return query; | ||
} | ||
} | ||
function createNumericAggregation(_ref10) { | ||
var type = _ref10.type, | ||
field = _ref10.field, | ||
graphqlField = _ref10.graphqlField; | ||
function createNumericAggregation(_ref9) { | ||
var type = _ref9.type, | ||
field = _ref9.field, | ||
graphqlField = _ref9.graphqlField; | ||
var args = (0, _lodash.get)(graphqlField, [type, 'arguments', 0]) || {}; | ||
return _defineProperty({}, "".concat(field, ":").concat(type), _defineProperty({}, type, _extends({ | ||
return _defineProperty({}, "".concat(field, ":").concat(type), _defineProperty({}, type, _objectSpread({ | ||
field: field | ||
@@ -86,6 +97,6 @@ }, type === _constants.HISTOGRAM ? { | ||
function createTermAggregation(_ref12) { | ||
var field = _ref12.field, | ||
isNested = _ref12.isNested; | ||
return _defineProperty({}, field, _extends({}, isNested ? { | ||
function createTermAggregation(_ref11) { | ||
var field = _ref11.field, | ||
isNested = _ref11.isNested; | ||
return _defineProperty({}, field, _objectSpread({}, isNested ? { | ||
aggs: { | ||
@@ -104,8 +115,8 @@ rn: { | ||
function createAggregation(_ref14) { | ||
var field = _ref14.field, | ||
_ref14$graphqlField = _ref14.graphqlField, | ||
graphqlField = _ref14$graphqlField === void 0 ? {} : _ref14$graphqlField, | ||
_ref14$isNested = _ref14.isNested, | ||
isNested = _ref14$isNested === void 0 ? false : _ref14$isNested; | ||
function createAggregation(_ref13) { | ||
var field = _ref13.field, | ||
_ref13$graphqlField = _ref13.graphqlField, | ||
graphqlField = _ref13$graphqlField === void 0 ? {} : _ref13$graphqlField, | ||
_ref13$isNested = _ref13.isNested, | ||
isNested = _ref13$isNested === void 0 ? false : _ref13$isNested; | ||
var type = [_constants.BUCKETS, _constants.STATS, _constants.HISTOGRAM].find(function (t) { | ||
@@ -131,5 +142,5 @@ return graphqlField[t]; | ||
function getNestedPathsInField(_ref15) { | ||
var field = _ref15.field, | ||
nestedFields = _ref15.nestedFields; | ||
function getNestedPathsInField(_ref14) { | ||
var field = _ref14.field, | ||
nestedFields = _ref14.nestedFields; | ||
return field.split('.').map(function (s, i, arr) { | ||
@@ -142,7 +153,7 @@ return arr.slice(0, i + 1).join('.'); | ||
function wrapWithFilters(_ref16) { | ||
var field = _ref16.field, | ||
query = _ref16.query, | ||
aggregationsFilterThemselves = _ref16.aggregationsFilterThemselves, | ||
aggregation = _ref16.aggregation; | ||
function wrapWithFilters(_ref15) { | ||
var field = _ref15.field, | ||
query = _ref15.query, | ||
aggregationsFilterThemselves = _ref15.aggregationsFilterThemselves, | ||
aggregation = _ref15.aggregation; | ||
@@ -170,11 +181,11 @@ if (!aggregationsFilterThemselves) { | ||
function _default(_ref17) { | ||
var graphqlFields = _ref17.graphqlFields, | ||
nestedFields = _ref17.nestedFields, | ||
query = _ref17.query, | ||
aggregationsFilterThemselves = _ref17.aggregationsFilterThemselves; | ||
return Object.entries(graphqlFields).reduce(function (aggregations, _ref18) { | ||
var _ref19 = _slicedToArray(_ref18, 2), | ||
fieldKey = _ref19[0], | ||
graphqlField = _ref19[1]; | ||
function _default(_ref16) { | ||
var graphqlFields = _ref16.graphqlFields, | ||
nestedFields = _ref16.nestedFields, | ||
query = _ref16.query, | ||
aggregationsFilterThemselves = _ref16.aggregationsFilterThemselves; | ||
return Object.entries(graphqlFields).reduce(function (aggregations, _ref17) { | ||
var _ref18 = _slicedToArray(_ref17, 2), | ||
fieldKey = _ref18[0], | ||
graphqlField = _ref18[1]; | ||
@@ -199,3 +210,3 @@ var field = fieldKey.replace(/__/g, '.'); | ||
}, fieldAggregation); | ||
return _extends({}, aggregations, wrapWithFilters({ | ||
return _objectSpread({}, aggregations, wrapWithFilters({ | ||
query: query, | ||
@@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sRmllbGQsXG4gICAgICAgIGlzTmVzdGVkOiBuZXN0ZWRQYXRocy5sZW5ndGgsXG4gICAgICB9KTtcblxuICAgICAgY29uc3QgYWdncmVnYXRpb24gPSBuZXN0ZWRQYXRocy5yZXZlcnNlKCkucmVkdWNlKFxuICAgICAgICAoYWdncywgcGF0aCkgPT4gKHtcbiAgICAgICAgICBbYCR7ZmllbGR9OiR7QUdHU19XUkFQUEVSX05FU1RFRH1gXTogeyBuZXN0ZWQ6IHsgcGF0aCB9LCBhZ2dzIH0sXG4gICAgICAgIH0pLFxuICAgICAgICBmaWVsZEFnZ3JlZ2F0aW9uLFxuICAgICAgKTtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgLi4uYWdncmVnYXRpb25zLFxuICAgICAgICAuLi53cmFwV2l0aEZpbHRlcnMoe1xuICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgIGZpZWxkLFxuICAgICAgICAgIGFnZ3JlZ2F0aW9uLFxuICAgICAgICAgIGFnZ3JlZ2F0aW9uc0ZpbHRlclRoZW1zZWx2ZXMsXG4gICAgICAgIH0pLFxuICAgICAgfTtcbiAgICB9LFxuICAgIHt9LFxuICApO1xufVxuIl19 |
@@ -20,12 +20,22 @@ "use strict"; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function wrapFilter(_ref) { | ||
@@ -102,3 +112,3 @@ var esFilter = _ref.esFilter, | ||
}) || ''; | ||
return _extends({}, map, _defineProperty({}, group, _toConsumableArray(map[group] || []).concat([field]))); | ||
return _objectSpread({}, map, _defineProperty({}, group, _toConsumableArray(map[group] || []).concat([field]))); | ||
}, {}); // construct one multi match per nested group | ||
@@ -110,4 +120,4 @@ | ||
return wrapFilter({ | ||
filter: _extends({}, filter, { | ||
content: _extends({}, content, { | ||
filter: _objectSpread({}, filter, { | ||
content: _objectSpread({}, content, { | ||
field: fields[0] | ||
@@ -255,2 +265,2 @@ }) | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZFF1ZXJ5L2luZGV4LmpzIl0sIm5hbWVzIjpbIndyYXBGaWx0ZXIiLCJlc0ZpbHRlciIsIm5lc3RlZEZpZWxkcyIsImZpbHRlciIsImlzTm90IiwiY29udGVudCIsImZpZWxkIiwic3BsaXQiLCJzbGljZSIsIm1hcCIsInAiLCJpIiwic2VnbWVudHMiLCJqb2luIiwiaW5jbHVkZXMiLCJyZXZlcnNlIiwicmVkdWNlIiwicGF0aCIsImdldFJlZ2V4RmlsdGVyIiwib3AiLCJ2YWx1ZSIsInJlZ2V4cCIsInJlcGxhY2UiLCJnZXRUZXJtRmlsdGVyIiwidGVybXMiLCJpdGVtIiwiZ2V0RnV6enlGaWx0ZXIiLCJmaWVsZHMiLCJzb3J0ZWROZXN0ZWQiLCJzb3J0IiwiYSIsImIiLCJsZW5ndGgiLCJuZXN0ZWRNYXAiLCJncm91cCIsImZpbmQiLCJ5IiwiT2JqZWN0IiwidmFsdWVzIiwiZ2V0TWlzc2luZ0ZpbHRlciIsImV4aXN0cyIsImJvb3N0IiwiZ2V0UmFuZ2VGaWx0ZXIiLCJyYW5nZSIsIm1heCIsIm1pbiIsImNvbGxhcHNlTmVzdGVkRmlsdGVycyIsImJvb2xzIiwiZmls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RlciB9KTtcbiAgfSBlbHNlIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoJ3Vua25vd24gb3AnKTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbih7IG5lc3RlZEZpZWxkcywgZmlsdGVyczogcmF3RmlsdGVycyB9KSB7XG4gIGlmIChPYmplY3Qua2V5cyhyYXdGaWx0ZXJzIHx8IHt9KS5sZW5ndGggPT09IDApIHJldHVybiB7fTtcbiAgcmV0dXJuIG9wU3dpdGNoKHsgbmVzdGVkRmllbGRzLCBmaWx0ZXI6IG5vcm1hbGl6ZUZpbHRlcnMocmF3RmlsdGVycykgfSk7XG59XG4iXX0= |
@@ -10,6 +10,14 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function groupingOptimizer(_ref) { | ||
@@ -43,8 +51,8 @@ var op = _ref.op, | ||
if (_constants.OP_ALIASES[op]) { | ||
return normalizeFilters(_extends({}, filter, { | ||
return normalizeFilters(_objectSpread({}, filter, { | ||
op: _constants.OP_ALIASES[op] | ||
})); | ||
} else if (_constants.ARRAY_CONTENT.includes(op) && !Array.isArray(value)) { | ||
return normalizeFilters(_extends({}, filter, { | ||
content: _extends({}, content, { | ||
return normalizeFilters(_objectSpread({}, filter, { | ||
content: _objectSpread({}, content, { | ||
value: [].concat(value) | ||
@@ -56,4 +64,4 @@ }) | ||
var specialFilters = value.filter(isSpecialFilter).map(function (specialValue) { | ||
return _extends({}, filter, { | ||
content: _extends({}, content, { | ||
return _objectSpread({}, filter, { | ||
content: _objectSpread({}, content, { | ||
value: [specialValue] | ||
@@ -66,4 +74,4 @@ }) | ||
}); | ||
var filters = normalValues.length > 0 ? [_extends({}, filter, { | ||
content: _extends({}, content, { | ||
var filters = normalValues.length > 0 ? [_objectSpread({}, filter, { | ||
content: _objectSpread({}, content, { | ||
value: normalValues | ||
@@ -85,2 +93,2 @@ }) | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZFF1ZXJ5L25vcm1hbGl6ZUZpbHRlcnMuanMiXSwibmFtZXMiOlsiZ3JvdXBpbmdPcHRpbWl6ZXIiLCJvcCIsImNvbnRlbnQiLCJtYXAiLCJub3JtYWxpemVGaWx0ZXJzIiwicmVkdWNlIiwiZmlsdGVycyIsImYiLCJpc1NwZWNpYWxGaWx0ZXIiLCJ2YWx1ZSIsImluY2x1ZGVzIiwiZmlsdGVyIiwiRXJy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lY2lhbEZpbHRlcikubWFwKHNwZWNpYWxWYWx1ZSA9PiAoe1xuICAgICAgLi4uZmlsdGVyLFxuICAgICAgY29udGVudDogeyAuLi5jb250ZW50LCB2YWx1ZTogW3NwZWNpYWxWYWx1ZV0gfSxcbiAgICB9KSk7XG5cbiAgICBjb25zdCBub3JtYWxWYWx1ZXMgPSB2YWx1ZS5maWx0ZXIocHN2ID0+ICFpc1NwZWNpYWxGaWx0ZXIocHN2KSk7XG4gICAgY29uc3QgZmlsdGVycyA9XG4gICAgICBub3JtYWxWYWx1ZXMubGVuZ3RoID4gMFxuICAgICAgICA/IFtcbiAgICAgICAgICAgIHsgLi4uZmlsdGVyLCBjb250ZW50OiB7IC4uLmNvbnRlbnQsIHZhbHVlOiBub3JtYWxWYWx1ZXMgfSB9LFxuICAgICAgICAgICAgLi4uc3BlY2lhbEZpbHRlcnMsXG4gICAgICAgICAgXVxuICAgICAgICA6IHNwZWNpYWxGaWx0ZXJzO1xuXG4gICAgcmV0dXJuIG5vcm1hbGl6ZUZpbHRlcnMoeyBvcDogT1JfT1AsIGNvbnRlbnQ6IGZpbHRlcnMgfSk7XG4gIH0gZWxzZSBpZiAoW0FORF9PUCwgT1JfT1AsIE5PVF9PUF0uaW5jbHVkZXMob3ApKSB7XG4gICAgcmV0dXJuIGdyb3VwaW5nT3B0aW1pemVyKGZpbHRlcik7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIGZpbHRlcjtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBub3JtYWxpemVGaWx0ZXJzO1xuIl19 |
@@ -79,2 +79,2 @@ "use strict"; | ||
exports.AGGS_WRAPPER_NESTED = AGGS_WRAPPER_NESTED; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb25zdGFudHMuanMiXSwibmFtZXMiOlsiSU5fT1AiLCJOT1RfSU5fT1AiLCJTT01FX05PVF9JTl9PUCIs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BTT01FX05PVF9JTl9PUCxcbiAgR1RfT1AsXG4gIEdURV9PUCxcbiAgTFRfT1AsXG4gIExURV9PUCxcbl07XG5cbi8vIGVsYXN0aWNzZWFyY2ggdmFsdWVzXG5leHBvcnQgY29uc3QgRVNfTVVTVCA9ICdtdXN0JztcbmV4cG9ydCBjb25zdCBFU19NVVNUX05PVCA9ICdtdXN0X25vdCc7XG5leHBvcnQgY29uc3QgRVNfU0hPVUxEID0gJ3Nob3VsZCc7XG5leHBvcnQgY29uc3QgRVNfTkVTVEVEID0gJ25lc3RlZCc7XG5leHBvcnQgY29uc3QgRVNfQk9PTCA9ICdib29sJztcbmV4cG9ydCBjb25zdCBFU19RVUVSWSA9ICdxdWVyeSc7XG5leHBvcnQgY29uc3QgRVNfUEFUSCA9ICdwYXRoJztcbmV4cG9ydCBjb25zdCBFU19NVUxUSV9NQVRDSCA9ICdtdWx0aV9tYXRjaCc7XG5leHBvcnQgY29uc3QgRVNfRklFTERTID0gJ2ZpZWxkcyc7XG5leHBvcnQgY29uc3QgRVNfVFlQRSA9ICd0eXBlJztcbmV4cG9ydCBjb25zdCBFU19QSFJBU0VfUFJFRklYID0gJ3BocmFzZV9wcmVmaXgnO1xuXG5leHBvcnQgY29uc3QgQlVDS0VUUyA9ICdidWNrZXRzJztcbmV4cG9ydCBjb25zdCBTVEFUUyA9ICdzdGF0cyc7XG5leHBvcnQgY29uc3QgSElTVE9HUkFNID0gJ2hpc3RvZ3JhbSc7XG5leHBvcnQgY29uc3QgQUdHU19XUkFQUEVSX0dMT0JBTCA9ICdnbG9iYWwnO1xuZXhwb3J0IGNvbnN0IEFHR1NfV1JBUFBFUl9GSUxURVJFRCA9ICdmaWx0ZXJlZCc7XG5leHBvcnQgY29uc3QgQUdHU19XUkFQUEVSX05FU1RFRCA9ICduZXN0ZWQnO1xuIl19 |
@@ -12,12 +12,22 @@ "use strict"; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } | ||
function _sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } | ||
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function flattenAggregations(aggregations) { | ||
@@ -36,5 +46,5 @@ return Object.entries(aggregations).reduce(function (prunedAggs, _ref) { | ||
if ([_constants.STATS, _constants.HISTOGRAM].includes(aggregationType)) { | ||
return _extends({}, prunedAggs, _defineProperty({}, field, _extends({}, prunedAggs[field], _defineProperty({}, aggregationType, value)))); | ||
return _objectSpread({}, prunedAggs, _defineProperty({}, field, _objectSpread({}, prunedAggs[field], _defineProperty({}, aggregationType, value)))); | ||
} else if (Array.isArray(value.buckets)) { | ||
return _extends({}, prunedAggs, _defineProperty({}, field, { | ||
return _objectSpread({}, prunedAggs, _defineProperty({}, field, { | ||
buckets: _toConsumableArray(value.buckets.map(function (_ref3) { | ||
@@ -44,3 +54,3 @@ var rn = _ref3.rn, | ||
return _extends({}, bucket, { | ||
return _objectSpread({}, bucket, { | ||
doc_count: rn ? rn.doc_count : bucket.doc_count | ||
@@ -51,3 +61,3 @@ }); | ||
} else { | ||
return _extends({}, prunedAggs, flattenAggregations(value)); | ||
return _objectSpread({}, prunedAggs, flattenAggregations(value)); | ||
} | ||
@@ -59,2 +69,2 @@ }, {}); | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mbGF0dGVuQWdncmVnYXRpb25zLmpzIl0sIm5hbWVzIjpb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"use strict"; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IGRlZmF1bHQgYXMgYnVpbGRRdWVyeSB9IGZyb20gJy4vYnVpbGRRdWVyeSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIGZsYXR0ZW5BZ2dyZWdhdGlvbnMgfSBmcm9tICcuL2ZsYXR0ZW5BZ2dyZWdhdGlvbnMnO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBidWlsZEFnZ3JlZ2F0aW9ucyB9IGZyb20gJy4vYnVpbGRBZ2dyZWdhdGlvbnMnO1xuIl19 | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQSIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IGRlZmF1bHQgYXMgYnVpbGRRdWVyeSB9IGZyb20gJy4vYnVpbGRRdWVyeSc7XG5leHBvcnQgeyBkZWZhdWx0IGFzIGZsYXR0ZW5BZ2dyZWdhdGlvbnMgfSBmcm9tICcuL2ZsYXR0ZW5BZ2dyZWdhdGlvbnMnO1xuZXhwb3J0IHsgZGVmYXVsdCBhcyBidWlsZEFnZ3JlZ2F0aW9ucyB9IGZyb20gJy4vYnVpbGRBZ2dyZWdhdGlvbnMnO1xuIl19 |
@@ -23,8 +23,14 @@ "use strict"; | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); } | ||
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } | ||
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function mergePath(target, _ref, data) { | ||
@@ -35,3 +41,3 @@ var _ref2 = _toArray(_ref), | ||
return _extends({}, target, _defineProperty({}, key, path.length ? mergePath(_lodash.default.get(target, key, {}), path, data) : data)); | ||
return _objectSpread({}, target, _defineProperty({}, key, path.length ? mergePath(_lodash.default.get(target, key, {}), path, data) : data)); | ||
} | ||
@@ -68,2 +74,2 @@ | ||
} | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9lc0ZpbHRlci5qcyJdLCJuYW1lcyI6WyJtZXJnZVBhdGgiLCJ0YXJnZXQiLCJk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wTXVzdCh2YWx1ZSkge1xuICByZXR1cm4gd3JhcEJvb2woQ09OU1RBTlRTLkVTX01VU1QsIHZhbHVlKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHdyYXBTaG91bGQodmFsdWUpIHtcbiAgcmV0dXJuIHdyYXBCb29sKENPTlNUQU5UUy5FU19TSE9VTEQsIHZhbHVlKTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHdyYXBOZXN0ZWQoZXNGaWx0ZXIsIHBhdGgpIHtcbiAgcmV0dXJuIHtcbiAgICBbQ09OU1RBTlRTLkVTX05FU1RFRF06IHtcbiAgICAgIFtDT05TVEFOVFMuRVNfUEFUSF06IHBhdGgsXG4gICAgICBbQ09OU1RBTlRTLkVTX1FVRVJZXTogZXNGaWx0ZXJbQ09OU1RBTlRTLkVTX0JPT0xdXG4gICAgICAgID8gZXNGaWx0ZXJcbiAgICAgICAgOiB3cmFwTXVzdChlc0ZpbHRlciksXG4gICAgfSxcbiAgfTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHdyYXBCb29sKG9wLCB2YWx1ZSkge1xuICByZXR1cm4ge1xuICAgIFtDT05TVEFOVFMuRVNfQk9PTF06IHtcbiAgICAgIFtvcF06IEFycmF5LmlzQXJyYXkodmFsdWUpID8gdmFsdWUgOiBbdmFsdWVdLFxuICAgIH0sXG4gIH07XG59XG4iXX0= |
{ | ||
"name": "@arranger/middleware", | ||
"version": "0.2.2", | ||
"version": "0.2.4", | ||
"description": "Arranger Middleware", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import buildAggregations from '../src/buildAggregations.js'; | ||
import buildQuery from '../src/buildQuery'; | ||
test('build_aggregations should handle nested aggregations', () => { | ||
test('buildAggregations should handle nested aggregations', () => { | ||
const nestedFields = [ | ||
@@ -145,3 +145,3 @@ 'annotations', | ||
test('build_aggregations should handle nested aggregations with filters on same field', () => { | ||
test('buildAggregations should handle nested aggregations with filters on same field', () => { | ||
const nestedFields = ['participants']; | ||
@@ -199,3 +199,3 @@ const input = { | ||
test('build_aggregations should handle `aggregations_filter_themselves` variable set to false', () => { | ||
test('buildAggregations should handle `aggregations_filter_themselves` variable set to false', () => { | ||
let input = { | ||
@@ -266,3 +266,3 @@ nestedFields: [], | ||
test('build_aggregations should handle `aggregations_filter_themselves` variable set to true', () => { | ||
test('buildAggregations should handle `aggregations_filter_themselves` variable set to true', () => { | ||
let input = { | ||
@@ -305,1 +305,27 @@ nestedFields: [], | ||
}); | ||
test('buildAggregations should handle queries not in a group', () => { | ||
const nestedFields = []; | ||
const input = { | ||
query: buildQuery({ | ||
nestedFields, | ||
filters: { op: 'in', content: { field: 'case', value: [1] } }, | ||
}), | ||
nestedFields, | ||
graphqlFields: { | ||
access: { buckets: { key: {} } }, | ||
case: { buckets: { key: {} } }, | ||
}, | ||
aggregationsFilterThemselves: false, | ||
}; | ||
const expectedOutput = { | ||
access: { terms: { field: 'access', size: 300000 } }, | ||
'case:global': { | ||
aggs: { case: { terms: { field: 'case', size: 300000 } } }, | ||
global: {}, | ||
}, | ||
}; | ||
const actualOutput = buildAggregations(input); | ||
expect(actualOutput).toEqual(expectedOutput); | ||
}); |
299088
4927