Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arranger/middleware

Package Overview
Dependencies
Maintainers
8
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arranger/middleware - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

4

dist/buildAggregations/injectNestedFiltersToAggs.js

@@ -60,3 +60,3 @@ "use strict";

bool: {
must: nestedSqonFilters[aggContent.nested.path].filter(function (sqonFilter) {
should: nestedSqonFilters[aggContent.nested.path].filter(function (sqonFilter) {
return aggregationsFilterThemselves || aggName.split(':')[0] !== sqonFilter.content.field;

@@ -97,2 +97,2 @@ }).map(function (sqonFilter) {

exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZEFnZ3JlZ2F0aW9ucy9pbmplY3ROZXN0ZWRGaWx0ZXJzVG9BZ2dzLmpzIl0sIm5hbWVzIjpbImluamVjdE5lc3RlZEZpbHRlcnNUb0FnZ3MiLCJhZ2dzIiwibmVzdGVkU3FvbkZpbHRlcnMiLCJhZ2dyZWdhdGlvbnNGaWx0ZXJUaGVtc2VsdmVzIiwiT2JqZWN0IiwiZW50cmllcyIsInJlZHVjZSIsImFjYyIsImFnZ05hbWUiLCJhZ2dDb250ZW50Iiwic2tpcFRvTmV4dExldmVsIiwid3JhcEluRmlsdGVyQWdnIiwibmVzdGVkIiwicGF0aCIsImZpbHRlciIsImJvb2wiLCJtdXN0Iiwic3FvbkZpbHRlciIsInNwbGl0IiwiY29udGVudCIsImZpZWxkIiwibWFwIiwibmVzdGVkRmllbGRzIiwiZ2xvYmFsIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7O0FBQ0E7O0FBQ0E7O0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7QUFLQSxJQUFNQSx5QkFBeUIsR0F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ICAgIG5lc3RlZFNxb25GaWx0ZXJzLFxuICAgICAgICAgIGFnZ3JlZ2F0aW9uc0ZpbHRlclRoZW1zZWx2ZXMsXG4gICAgICAgIH0pLFxuICAgICAgfTtcbiAgICAgIHJldHVybiBhY2M7XG4gICAgfTtcbiAgICBjb25zdCB3cmFwSW5GaWx0ZXJBZ2cgPSAoKSA9PiB7XG4gICAgICBhY2NbYWdnTmFtZV0gPSB7XG4gICAgICAgIC4uLmFnZ0NvbnRlbnQsXG4gICAgICAgIGFnZ3M6IHtcbiAgICAgICAgICBbYCR7YWdnQ29udGVudC5uZXN0ZWQucGF0aH06JHtBR0dTX1dSQVBQRVJfRklMVEVSRUR9YF06IHtcbiAgICAgICAgICAgIGZpbHRlcjoge1xuICAgICAgICAgICAgICBib29sOiB7XG4gICAgICAgICAgICAgICAgbXVzdDogbmVzdGVkU3FvbkZpbHRlcnNbYWdnQ29udGVudC5uZXN0ZWQucGF0aF1cbiAgICAgICAgICAgICAgICAgIC5maWx0ZXIoXG4gICAgICAgICAgICAgICAgICAgIHNxb25GaWx0ZXIgPT5cbiAgICAgICAgICAgICAgICAgICAgICBhZ2dyZWdhdGlvbnNGaWx0ZXJUaGVtc2VsdmVzIHx8XG4gICAgICAgICAgICAgICAgICAgICAgYWdnTmFtZS5zcGxpdCgnOicpWzBdICE9PSBzcW9uRmlsdGVyLmNvbnRlbnQuZmllbGQsXG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAubWFwKHNxb25GaWx0ZXIgPT5cbiAgICAgICAgICAgICAgICAgICAgb3BTd2l0Y2goe1xuICAgICAgICAgICAgICAgICAgICAgIG5lc3RlZEZpZWxkczogW10sXG4gICAgICAgICAgICAgICAgICAgICAgZmlsdGVyOiBub3JtYWxpemVGaWx0ZXJzKHNxb25GaWx0ZXIpLFxuICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWdnczogaW5qZWN0TmVzdGVkRmlsdGVyc1RvQWdncyh7XG4gICAgICAgICAgICAgIGFnZ3M6IGFnZ0NvbnRlbnQuYWdncyxcbiAgICAgICAgICAgICAgbmVzdGVkU3FvbkZpbHRlcnMsXG4gICAgICAgICAgICAgIGFnZ3JlZ2F0aW9uc0ZpbHRlclRoZW1zZWx2ZXMsXG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgICAgfTtcbiAgICAgIHJldHVybiBhY2M7XG4gICAgfTtcblxuICAgIGlmIChhZ2dDb250ZW50Lmdsb2JhbCB8fCBhZ2dDb250ZW50LmZpbHRlcikge1xuICAgICAgcmV0dXJuIHNraXBUb05leHRMZXZlbCgpO1xuICAgIH0gZWxzZSBpZiAoYWdnQ29udGVudC5uZXN0ZWQpIHtcbiAgICAgIGlmIChuZXN0ZWRTcW9uRmlsdGVyc1thZ2dDb250ZW50Lm5lc3RlZC5wYXRoXSkge1xuICAgICAgICByZXR1cm4gd3JhcEluRmlsdGVyQWdnKCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gc2tpcFRvTmV4dExldmVsKCk7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBhY2M7XG4gICAgfVxuICB9LCBjbG9uZURlZXAoYWdncykpO1xuXG5leHBvcnQgZGVmYXVsdCBpbmplY3ROZXN0ZWRGaWx0ZXJzVG9BZ2dzO1xuIl19
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZEFnZ3JlZ2F0aW9ucy9pbmplY3ROZXN0ZWRGaWx0ZXJzVG9BZ2dzLmpzIl0sIm5hbWVzIjpbImluamVjdE5lc3RlZEZpbHRlcnNUb0FnZ3MiLCJhZ2dzIiwibmVzdGVkU3FvbkZpbHRlcnMiLCJhZ2dyZWdhdGlvbnNGaWx0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b25zRmlsdGVyVGhlbXNlbHZlcyB8fFxuICAgICAgICAgICAgICAgICAgICAgIGFnZ05hbWUuc3BsaXQoJzonKVswXSAhPT0gc3FvbkZpbHRlci5jb250ZW50LmZpZWxkLFxuICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgLm1hcChzcW9uRmlsdGVyID0+XG4gICAgICAgICAgICAgICAgICAgIG9wU3dpdGNoKHtcbiAgICAgICAgICAgICAgICAgICAgICBuZXN0ZWRGaWVsZHM6IFtdLFxuICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcjogbm9ybWFsaXplRmlsdGVycyhzcW9uRmlsdGVyKSxcbiAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGFnZ3M6IGluamVjdE5lc3RlZEZpbHRlcnNUb0FnZ3Moe1xuICAgICAgICAgICAgICBhZ2dzOiBhZ2dDb250ZW50LmFnZ3MsXG4gICAgICAgICAgICAgIG5lc3RlZFNxb25GaWx0ZXJzLFxuICAgICAgICAgICAgICBhZ2dyZWdhdGlvbnNGaWx0ZXJUaGVtc2VsdmVzLFxuICAgICAgICAgICAgfSksXG4gICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgIH07XG4gICAgICByZXR1cm4gYWNjO1xuICAgIH07XG5cbiAgICBpZiAoYWdnQ29udGVudC5nbG9iYWwgfHwgYWdnQ29udGVudC5maWx0ZXIpIHtcbiAgICAgIHJldHVybiBza2lwVG9OZXh0TGV2ZWwoKTtcbiAgICB9IGVsc2UgaWYgKGFnZ0NvbnRlbnQubmVzdGVkKSB7XG4gICAgICBpZiAobmVzdGVkU3FvbkZpbHRlcnNbYWdnQ29udGVudC5uZXN0ZWQucGF0aF0pIHtcbiAgICAgICAgcmV0dXJuIHdyYXBJbkZpbHRlckFnZygpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIHNraXBUb05leHRMZXZlbCgpO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gYWNjO1xuICAgIH1cbiAgfSwgY2xvbmVEZWVwKGFnZ3MpKTtcblxuZXhwb3J0IGRlZmF1bHQgaW5qZWN0TmVzdGVkRmlsdGVyc1RvQWdncztcbiJdfQ==

@@ -215,4 +215,2 @@ "use strict";

if (isNested && pivot === ((_esFilters$2 = esFilters[0]) === null || _esFilters$2 === void 0 ? void 0 : _esFilters$2.nested.path)) {
return applyBooleanWrapper(esFilters);
} else {
var flattned = esFilters.reduce(function (bools, esFilter) {

@@ -225,2 +223,4 @@ return op === _constants.AND_OP || op === _constants.NOT_OP ? collapseNestedFilters({

return applyBooleanWrapper(flattned);
} else {
return applyBooleanWrapper(esFilters);
}

@@ -308,2 +308,19 @@ }

}
} else if ([_constants.ALL_OP].includes(op)) {
return getGroupFilter({
nestedFields: nestedFields,
filter: {
op: _constants.AND_OP,
pivot: pivot || '.',
content: filter.content.value.map(function (v) {
return {
op: _constants.IN_OP,
content: {
field: filter.content.field,
value: [v]
}
};
})
}
});
} else if ([_constants.GT_OP, _constants.GTE_OP, _constants.LT_OP, _constants.LTE_OP].includes(op)) {

@@ -335,13 +352,7 @@ return getRangeFilter({

if (Object.keys(rawFilters || {}).length === 0) return {};
var output = opSwitch({
return opSwitch({
nestedFields: nestedFields,
filter: (0, _normalizeFilters.default)(rawFilters)
});
console.log('input: ', JSON.stringify({
nestedFields: nestedFields,
filters: rawFilters
}));
console.log('output: ', JSON.stringify(output));
return output;
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZFF1ZXJ5L2luZGV4LmpzIl0sIm5hbWVzIjpbIndyYXBGaWx0ZXIiLCJlc0ZpbHRlciIsIm5lc3RlZEZpZWxkcyIsImZpbHRlciIsImlzTm90IiwiY29udGVudCIsImZpZWxkIiwic3BsaXQiLCJ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bnRlbnQudmFsdWUubWFwKHYgPT4gKHtcbiAgICAgICAgICBvcDogSU5fT1AsXG4gICAgICAgICAgY29udGVudDoge1xuICAgICAgICAgICAgZmllbGQ6IGZpbHRlci5jb250ZW50LmZpZWxkLFxuICAgICAgICAgICAgdmFsdWU6IFt2XSxcbiAgICAgICAgICB9LFxuICAgICAgICB9KSksXG4gICAgICB9LFxuICAgIH0pO1xuICB9IGVsc2UgaWYgKFtHVF9PUCwgR1RFX09QLCBMVF9PUCwgTFRFX09QXS5pbmNsdWRlcyhvcCkpIHtcbiAgICByZXR1cm4gZ2V0UmFuZ2VGaWx0ZXIoeyBuZXN0ZWRGaWVsZHMsIGZpbHRlciB9KTtcbiAgfSBlbHNlIGlmIChbQkVUV0VFTl9PUF0uaW5jbHVkZXMob3ApKSB7XG4gICAgcmV0dXJuIGdldEJldHdlZW5GaWx0ZXIoeyBuZXN0ZWRGaWVsZHMsIGZpbHRlciB9KTtcbiAgfSBlbHNlIGlmIChGSUxURVJfT1AgPT09IG9wKSB7XG4gICAgcmV0dXJuIGdldEZ1enp5RmlsdGVyKHsgbmVzdGVkRmllbGRzLCBmaWx0ZXIgfSk7XG4gIH0gZWxzZSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCd1bmtub3duIG9wJyk7XG4gIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKHsgbmVzdGVkRmllbGRzLCBmaWx0ZXJzOiByYXdGaWx0ZXJzIH0pIHtcbiAgaWYgKE9iamVjdC5rZXlzKHJhd0ZpbHRlcnMgfHwge30pLmxlbmd0aCA9PT0gMCkgcmV0dXJuIHt9O1xuICByZXR1cm4gb3BTd2l0Y2goe1xuICAgIG5lc3RlZEZpZWxkcyxcbiAgICBmaWx0ZXI6IG5vcm1hbGl6ZUZpbHRlcnMocmF3RmlsdGVycyksXG4gIH0pO1xufVxuIl19

@@ -12,4 +12,2 @@ "use strict";

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); }

@@ -70,30 +68,3 @@

};
/**
* Special handlings for ALL_OP:
* - "all" special default for "pivot" based on the content
* field
* - preserves grouping so for easy conversion to ES query based on pivot
**/
var transformAllOp = function transformAllOp(filter) {
var _applyDefaultPivots;
var content = filter.content;
var field = content.field;
var fieldPaths = field.includes('.') ? field.split('.') : [];
var defaultPivot = fieldPaths.length ? fieldPaths.slice(0, fieldPaths.length - 1).join('.') : null;
return applyDefaultPivots((_applyDefaultPivots = {
op: _constants.AND_OP
}, _defineProperty(_applyDefaultPivots, _UNFLAT_KEY_, true), _defineProperty(_applyDefaultPivots, "pivot", filter.pivot || defaultPivot), _defineProperty(_applyDefaultPivots, "content", filter.content.value.map(function (val) {
return {
op: _constants.IN_OP,
content: {
field: filter.content.field,
value: [val]
}
};
})), _applyDefaultPivots));
};
function normalizeFilters(filter) {

@@ -142,4 +113,2 @@ var op = filter.op,

});
} else if ([_constants.ALL_OP].includes(op)) {
return transformAllOp(filter);
} else if ([_constants.AND_OP, _constants.OR_OP, _constants.NOT_OP].includes(op)) {

@@ -158,2 +127,2 @@ return groupingOptimizer(filter);

exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9idWlsZFF1ZXJ5L25vcm1hbGl6ZUZpbHRlcnMuanMiXSwibmFtZXMiOlsiX1VORkxBVF9LRVlfIiwiZ3JvdXBpbmdPcHRpbWl6ZXIiLCJvcCIsImNvbnRlbnQiLCJwaXZvdCIsIm1hcCIsIm5vcm1hbGl6ZUZpbHRlcnMiLCJyZWR1Y2UiLCJmaWx0ZXJzIiwiZiIsInNhbWVQaXZvd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1dDtcbn07XG4iXX0=
{
"name": "@arranger/middleware",
"version": "1.1.7",
"version": "1.1.8",
"description": "Arranger Middleware",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -217,3 +217,3 @@ import buildAggregations from '../../src/buildAggregations';

bool: {
must: [],
should: [],
},

@@ -419,3 +419,3 @@ },

bool: {
must: [
should: [
{

@@ -550,3 +550,3 @@ terms: {

bool: {
must: [
should: [
{

@@ -646,3 +646,3 @@ terms: {

bool: {
must: [
should: [
{

@@ -649,0 +649,0 @@ terms: {

@@ -84,2 +84,128 @@ import buildQuery from '../../src/buildQuery';

test('buildQuery "all" ops', () => {
const tests = [
{
input: {
nestedFields: ['diagnoses'],
filters: {
op: 'and',
content: [
{
op: 'all',
content: {
field: 'diagnoses.diagnosis',
value: ['ganglioglioma', 'low grade glioma'],
},
},
],
},
},
output: {
bool: {
must: [
{
bool: {
must: [
{
nested: {
path: 'diagnoses',
query: {
bool: {
must: [
{
terms: {
'diagnoses.diagnosis': ['ganglioglioma'],
boost: 0,
},
},
],
},
},
},
},
{
nested: {
path: 'diagnoses',
query: {
bool: {
must: [
{
terms: {
'diagnoses.diagnosis': ['low grade glioma'],
boost: 0,
},
},
],
},
},
},
},
],
},
},
],
},
},
},
{
input: {
nestedFields: ['diagnoses'],
filters: {
op: 'and',
content: [
{
op: 'all',
pivot: 'diagnoses',
content: {
field: 'diagnoses.diagnosis',
value: ['ganglioglioma', 'low grade glioma'],
},
},
],
},
},
output: {
bool: {
must: [
{
bool: {
must: [
{
nested: {
path: 'diagnoses',
query: {
bool: {
must: [
{
terms: {
'diagnoses.diagnosis': ['ganglioglioma'],
boost: 0,
},
},
{
terms: {
'diagnoses.diagnosis': ['low grade glioma'],
boost: 0,
},
},
],
},
},
},
},
],
},
},
],
},
},
},
];
tests.forEach(({ input, output }) => {
const actualOutput = buildQuery(input);
console.log('actualOutput: ', JSON.stringify(actualOutput));
expect(actualOutput).toEqual(output);
});
});
test('buildQuery "and", "or" ops nested inside each other', () => {

@@ -140,9 +266,3 @@ const tests = [

nestedFields: [],
filters: {
op: '!=',
content: {
field: 'project_code',
value: 'ACC',
},
},
filters: { op: '!=', content: { field: 'project_code', value: 'ACC' } },
},

@@ -159,16 +279,4 @@ output: {

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '=', content: { field: 'status', value: ['legacy'] } },
],

@@ -192,16 +300,4 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '!=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '!=', content: { field: 'status', value: ['legacy'] } },
],

@@ -230,25 +326,7 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '=',
content: {
field: 'project',
value: ['ACC'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '=', content: { field: 'project', value: ['ACC'] } },
],
},
{
op: '=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'status', value: ['legacy'] } },
],

@@ -276,25 +354,7 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '=',
content: {
field: 'project',
value: ['ACC'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '=', content: { field: 'project', value: ['ACC'] } },
],
},
{
op: '!=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '!=', content: { field: 'status', value: ['legacy'] } },
],

@@ -324,25 +384,7 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '!=',
content: {
field: 'project',
value: ['ACC'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '!=', content: { field: 'project', value: ['ACC'] } },
],
},
{
op: '=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'status', value: ['legacy'] } },
],

@@ -370,25 +412,7 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '!=',
content: {
field: 'project',
value: ['ACC'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '!=', content: { field: 'project', value: ['ACC'] } },
],
},
{
op: '!=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '!=', content: { field: 'status', value: ['legacy'] } },
],

@@ -401,9 +425,5 @@ },

{ terms: { program: ['TCGA'], boost: 0 } },
{ bool: { must_not: [{ terms: { project: ['ACC'], boost: 0 } }] } },
{
bool: {
must_not: [
{ terms: { project: ['ACC'], boost: 0 } },
{ terms: { status: ['legacy'], boost: 0 } },
],
},
bool: { must_not: [{ terms: { status: ['legacy'], boost: 0 } }] },
},

@@ -420,16 +440,4 @@ ],

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '=', content: { field: 'status', value: ['legacy'] } },
],

@@ -453,16 +461,4 @@ },

content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '!=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '!=', content: { field: 'status', value: ['legacy'] } },
],

@@ -488,26 +484,8 @@ },

content: [
{ op: '=', content: { field: 'project', value: ['ACC'] } },
{
op: '=',
content: {
field: 'project',
value: ['ACC'],
},
},
{
op: 'and',
content: [
{
op: '=',
content: {
field: 'program',
value: ['TCGA'],
},
},
{
op: '=',
content: {
field: 'status',
value: ['legacy'],
},
},
{ op: '=', content: { field: 'program', value: ['TCGA'] } },
{ op: '=', content: { field: 'status', value: ['legacy'] } },
],

@@ -540,15 +518,9 @@ },

content: [
{ op: '!=', content: { field: 'access', value: 'protected' } },
{
op: '!=',
content: { field: 'access', value: 'protected' },
},
{
op: 'and',
content: [
{ op: '=', content: { field: 'center.code', value: '01' } },
{
op: '=',
content: { field: 'center.code', value: '01' },
},
{
op: '=',
content: {

@@ -581,9 +553,3 @@ field: 'cases.project.primary_site',

nestedFields: [],
filters: {
op: '=',
content: {
field: 'is_canonical',
value: [true],
},
},
filters: { op: '=', content: { field: 'is_canonical', value: [true] } },
},

@@ -595,9 +561,3 @@ output: { terms: { is_canonical: [true], boost: 0 } },

nestedFields: [],
filters: {
op: '=',
content: {
field: 'case_count',
value: [24601],
},
},
filters: { op: '=', content: { field: 'case_count', value: [24601] } },
},

@@ -608,3 +568,3 @@ output: { terms: { case_count: [24601], boost: 0 } },

tests.forEach(({ input, output }) => {
tests.forEach(({ input, output }, i) => {
const actualOutput = buildQuery(input);

@@ -611,0 +571,0 @@ expect(actualOutput).toEqual(output);

@@ -68,2 +68,13 @@ import buildQuery from '../../src/buildQuery';

},
],
},
},
},
},
{
nested: {
path: 'participants',
query: {
bool: {
must: [
{

@@ -105,3 +116,3 @@ nested: {

test('buildQuery ">=" and "<=" nested', () => {
test('buildQuery single ">="', () => {
const nestedFields = ['files', 'files.foo', 'files.foo.bar', 'files.nn.baz'];

@@ -114,9 +125,3 @@ const tests = [

content: [
{
content: {
field: 'files.foo.name',
value: 7,
},
op: '>=',
},
{ content: { field: 'files.foo.name', value: 7 }, op: '>=' },
],

@@ -131,2 +136,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -137,2 +143,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -143,6 +150,3 @@ bool: {

range: {
'files.foo.name': {
boost: 0,
gte: 7,
},
'files.foo.name': { boost: 0, gte: 7 },
},

@@ -153,3 +157,2 @@ },

},
path: 'files.foo',
},

@@ -160,3 +163,2 @@ },

},
path: 'files',
},

@@ -211,2 +213,3 @@ },

nested: {
path: 'files',
query: {

@@ -217,15 +220,35 @@ bool: {

terms: {
boost: 0,
'files.data_category': [
'Simple Nucleotide Variation',
],
boost: 0,
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
terms: {
'files.experimental_strategy': ['WXS'],
boost: 0,
'files.experimental_strategy': ['WXS'],
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must_not: [

@@ -242,3 +265,2 @@ {

},
path: 'files',
},

@@ -444,6 +466,3 @@ },

{
content: {
field: 'project.project_id',
value: 'TCGA-BRCA',
},
content: { field: 'project.project_id', value: 'TCGA-BRCA' },
op: '=',

@@ -463,2 +482,3 @@ },

nested: {
path: 'files',
query: {

@@ -473,6 +493,17 @@ bool: {

},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
terms: {
'files.experimental_strategy': ['WGS'],
boost: 0,
'files.experimental_strategy': ['WGS'],
},

@@ -483,3 +514,2 @@ },

},
path: 'files',
},

@@ -505,13 +535,7 @@ },

{
content: {
field: 'files.experimental_strategy',
value: 'WGS',
},
content: { field: 'files.experimental_strategy', value: 'WGS' },
op: '=',
},
{
content: {
field: 'project.project_id',
value: 'TCGA-BRCA',
},
content: { field: 'project.project_id', value: 'TCGA-BRCA' },
op: '=',

@@ -528,2 +552,3 @@ },

nested: {
path: 'files',
query: {

@@ -538,6 +563,17 @@ bool: {

},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
terms: {
'files.experimental_strategy': ['WGS'],
boost: 0,
'files.experimental_strategy': ['WGS'],
},

@@ -548,3 +584,2 @@ },

},
path: 'files',
},

@@ -570,6 +605,3 @@ },

{
content: {
field: 'project.primary_site',
value: 'Brain',
},
content: { field: 'project.primary_site', value: 'Brain' },
op: '=',

@@ -589,11 +621,20 @@ },

nested: {
path: 'files',
query: {
bool: {
must: [{ terms: { 'files.access': ['open'], boost: 0 } }],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{ terms: { boost: 0, 'files.access': ['open'] } },
{ terms: { boost: 0, 'files.center.code': ['01'] } },
{ terms: { 'files.center.code': ['01'], boost: 0 } },
],
},
},
path: 'files',
},

@@ -622,6 +663,3 @@ },

{
content: {
field: 'project.primary_site',
value: 'Brain',
},
content: { field: 'project.primary_site', value: 'Brain' },
op: '=',

@@ -641,13 +679,22 @@ },

nested: {
path: 'files',
query: {
bool: {
must_not: [
{ terms: { boost: 0, 'files.access': ['protected'] } },
{ terms: { 'files.access': ['protected'], boost: 0 } },
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{ terms: { boost: 0, 'files.center.code': ['01'] } },
{ terms: { 'files.center.code': ['01'], boost: 0 } },
],
},
},
path: 'files',
},

@@ -687,23 +734,22 @@ },

nested: {
path: 'files',
query: {
bool: {
must_not: [
{
terms: {
boost: 0,
'files.center.code': ['04'],
},
},
],
must: [
{
terms: {
boost: 0,
'files.access': ['protected4'],
},
},
{ terms: { 'files.access': ['protected4'], boost: 0 } },
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must_not: [
{ terms: { 'files.center.code': ['04'], boost: 0 } },
],
},
},
},

@@ -720,23 +766,11 @@ },

content: [
{ content: { field: 'files.access', value: 'protected' }, op: '=' },
{
content: {
field: 'files.access',
value: 'protected',
},
op: '=',
},
{
content: [
{
content: {
field: 'files.center.code',
value: '01',
},
content: { field: 'files.center.code', value: '01' },
op: '!=',
},
{
content: {
field: 'project.primary_site',
value: 'Brain',
},
content: { field: 'project.primary_site', value: 'Brain' },
op: '=',

@@ -756,31 +790,25 @@ },

nested: {
path: 'files',
query: {
bool: {
must_not: [
{
terms: {
boost: 0,
'files.center.code': ['01'],
},
},
],
must: [
{
terms: {
boost: 0,
'files.access': ['protected'],
},
},
{ terms: { 'files.access': ['protected'], boost: 0 } },
],
},
},
path: 'files',
},
},
{
terms: {
'project.primary_site': ['Brain'],
boost: 0,
nested: {
path: 'files',
query: {
bool: {
must_not: [
{ terms: { 'files.center.code': ['01'], boost: 0 } },
],
},
},
},
},
{ terms: { 'project.primary_site': ['Brain'], boost: 0 } },
],

@@ -795,16 +823,4 @@ },

content: [
{
content: {
field: 'files.foo.name',
value: 'cname',
},
op: '=',
},
{
content: {
field: 'files.foo.code',
value: '01',
},
op: '=',
},
{ content: { field: 'files.foo.name', value: 'cname' }, op: '=' },
{ content: { field: 'files.foo.code', value: '01' }, op: '=' },
],

@@ -819,2 +835,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -825,2 +842,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -835,7 +853,26 @@ bool: {

},
],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{
terms: {
boost: 0,
'files.foo.code': ['01'],
},
terms: { 'files.foo.code': ['01'], boost: 0 },
},

@@ -845,3 +882,2 @@ ],

},
path: 'files.foo',
},

@@ -852,3 +888,2 @@ },

},
path: 'files',
},

@@ -865,16 +900,4 @@ },

content: [
{
content: {
field: 'files.foo.name',
value: 'cname',
},
op: '=',
},
{
content: {
field: 'files.foo.code',
value: '01',
},
op: '!=',
},
{ content: { field: 'files.foo.name', value: 'cname' }, op: '=' },
{ content: { field: 'files.foo.code', value: '01' }, op: '!=' },
],

@@ -889,2 +912,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -895,18 +919,36 @@ bool: {

nested: {
path: 'files.foo',
query: {
bool: {
must_not: [
must: [
{
terms: {
'files.foo.name': ['cname'],
boost: 0,
'files.foo.code': ['01'],
},
},
],
must: [
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must_not: [
{
terms: {
'files.foo.name': ['cname'],
boost: 0,
},
terms: { 'files.foo.code': ['01'], boost: 0 },
},

@@ -916,3 +958,2 @@ ],

},
path: 'files.foo',
},

@@ -923,3 +964,2 @@ },

},
path: 'files',
},

@@ -936,16 +976,4 @@ },

content: [
{
content: {
field: 'files.foo.name',
value: 'cname',
},
op: '!=',
},
{
content: {
field: 'files.foo.code',
value: '01',
},
op: '=',
},
{ content: { field: 'files.foo.name', value: 'cname' }, op: '!=' },
{ content: { field: 'files.foo.code', value: '01' }, op: '=' },
],

@@ -960,2 +988,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -966,2 +995,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -977,8 +1007,25 @@ bool: {

],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{
terms: {
boost: 0,
'files.foo.code': ['01'],
},
terms: { 'files.foo.code': ['01'], boost: 0 },
},

@@ -988,3 +1035,2 @@ ],

},
path: 'files.foo',
},

@@ -995,3 +1041,2 @@ },

},
path: 'files',
},

@@ -1008,9 +1053,3 @@ },

content: [
{
content: {
field: 'files.foo.name',
value: 'cname',
},
op: '!=',
},
{ content: { field: 'files.foo.name', value: 'cname' }, op: '!=' },
],

@@ -1025,2 +1064,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -1031,2 +1071,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -1044,3 +1085,2 @@ bool: {

},
path: 'files.foo',
},

@@ -1051,3 +1091,2 @@ },

},
path: 'files',
},

@@ -1063,6 +1102,3 @@ },

filters: {
content: {
field: 'files.foo.code',
value: ['01'],
},
content: { field: 'files.foo.code', value: ['01'] },
op: 'not-in',

@@ -1073,2 +1109,3 @@ },

nested: {
path: 'files',
query: {

@@ -1079,15 +1116,10 @@ bool: {

nested: {
path: 'files.foo',
query: {
bool: {
must_not: [
{
terms: {
boost: 0,
'files.foo.code': ['01'],
},
},
{ terms: { 'files.foo.code': ['01'], boost: 0 } },
],
},
},
path: 'files.foo',
},

@@ -1098,3 +1130,2 @@ },

},
path: 'files',
},

@@ -1109,15 +1140,6 @@ },

{
content: {
field: 'files.foo.bar.name',
value: 'cname',
},
content: { field: 'files.foo.bar.name', value: 'cname' },
op: '=',
},
{
content: {
field: 'files.foo.bar.code',
value: '01',
},
op: '=',
},
{ content: { field: 'files.foo.bar.code', value: '01' }, op: '=' },
],

@@ -1132,2 +1154,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -1138,2 +1161,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -1144,2 +1168,3 @@ bool: {

nested: {
path: 'files.foo.bar',
query: {

@@ -1154,6 +1179,39 @@ bool: {

},
],
},
},
},
},
],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo.bar',
query: {
bool: {
must: [
{
terms: {
'files.foo.bar.code': ['01'],
boost: 0,
'files.foo.bar.code': ['01'],
},

@@ -1164,3 +1222,2 @@ },

},
path: 'files.foo.bar',
},

@@ -1171,3 +1228,2 @@ },

},
path: 'files.foo',
},

@@ -1178,3 +1234,2 @@ },

},
path: 'files',
},

@@ -1195,6 +1250,3 @@ },

},
{
content: { field: 'files.foo.bar.code', value: '01' },
op: '=',
},
{ content: { field: 'files.foo.bar.code', value: '01' }, op: '=' },
],

@@ -1209,2 +1261,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -1215,2 +1268,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -1221,2 +1275,3 @@ bool: {

nested: {
path: 'files.foo.bar',
query: {

@@ -1232,7 +1287,38 @@ bool: {

],
},
},
},
},
],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo.bar',
query: {
bool: {
must: [
{
terms: {
'files.foo.bar.code': ['01'],
boost: 0,
'files.foo.bar.code': ['01'],
},

@@ -1243,3 +1329,2 @@ },

},
path: 'files.foo.bar',
},

@@ -1250,3 +1335,2 @@ },

},
path: 'files.foo',
},

@@ -1257,3 +1341,2 @@ },

},
path: 'files',
},

@@ -1274,6 +1357,3 @@ },

},
{
content: { field: 'files.code', value: 'beep' },
op: '=',
},
{ content: { field: 'files.code', value: 'beep' }, op: '=' },
],

@@ -1288,2 +1368,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -1294,2 +1375,3 @@ bool: {

nested: {
path: 'files.nn.baz',
query: {

@@ -1307,10 +1389,17 @@ bool: {

},
path: 'files.nn.baz',
},
},
{ terms: { 'files.code': ['beep'], boost: 0 } },
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [{ terms: { 'files.code': ['beep'], boost: 0 } }],
},
},
},

@@ -1354,2 +1443,3 @@ },

nested: {
path: 'files',
query: {

@@ -1360,15 +1450,35 @@ bool: {

terms: {
boost: 0,
'files.data_category': [
'Simple Nucleotide Variation',
],
boost: 0,
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
terms: {
'files.experimental_strategy': ['WXS'],
boost: 0,
'files.experimental_strategy': ['WXS'],
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must_not: [

@@ -1385,3 +1495,2 @@ {

},
path: 'files',
},

@@ -1395,3 +1504,3 @@ },

tests.forEach(({ input, output }) => {
tests.forEach(({ input, output }, i) => {
const actualOutput = buildQuery(input);

@@ -1398,0 +1507,0 @@ expect(actualOutput).toEqual(output);

@@ -9,6 +9,3 @@ import buildQuery from '../../src/buildQuery';

nestedFields,
filters: {
content: { field: 'case_id', value: ['006*'] },
op: 'in',
},
filters: { content: { field: 'case_id', value: ['006*'] }, op: 'in' },
},

@@ -51,6 +48,3 @@ output: { regexp: { case_id: '006.*' } },

content: [
{
content: { field: 'case_id', value: ['006*', 'v1'] },
op: 'in',
},
{ content: { field: 'case_id', value: ['006*', 'v1'] }, op: 'in' },
],

@@ -80,13 +74,7 @@ op: 'and',

content: [
{ content: { field: 'case_id', value: ['006*', 'v1'] }, op: 'in' },
{
content: { field: 'case_id', value: ['006*', 'v1'] },
content: { field: 'project.primary_site', value: ['Brain'] },
op: 'in',
},
{
content: {
field: 'project.primary_site',
value: ['Brain'],
},
op: 'in',
},
],

@@ -127,2 +115,3 @@ op: 'and',

nested: {
path: 'files',
query: {

@@ -133,2 +122,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -141,3 +131,2 @@ bool: {

},
path: 'files.foo',
},

@@ -148,3 +137,2 @@ },

},
path: 'files',
},

@@ -180,2 +168,3 @@ },

nested: {
path: 'files',
query: {

@@ -186,2 +175,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -196,3 +186,2 @@ bool: {

},
path: 'files.foo',
},

@@ -203,3 +192,2 @@ },

},
path: 'files',
},

@@ -209,2 +197,3 @@ },

nested: {
path: 'files',
query: {

@@ -215,2 +204,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -225,3 +215,2 @@ bool: {

},
path: 'files.foo',
},

@@ -232,3 +221,2 @@ },

},
path: 'files',
},

@@ -238,2 +226,3 @@ },

nested: {
path: 'files',
query: {

@@ -244,2 +233,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -254,3 +244,2 @@ bool: {

},
path: 'files.foo',
},

@@ -261,3 +250,2 @@ },

},
path: 'files',
},

@@ -289,2 +277,3 @@ },

nested: {
path: 'files',
query: {

@@ -295,2 +284,3 @@ bool: {

nested: {
path: 'files.foo',
query: {

@@ -300,3 +290,47 @@ bool: {

{ regexp: { 'files.foo.name1': '.*cname' } },
],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{ regexp: { 'files.foo.name2': 'cn.*me' } },
],
},
},
},
},
],
},
},
},
},
{
nested: {
path: 'files',
query: {
bool: {
must: [
{
nested: {
path: 'files.foo',
query: {
bool: {
must: [
{ regexp: { 'files.foo.name3': 'cname.*' } },

@@ -306,3 +340,2 @@ ],

},
path: 'files.foo',
},

@@ -313,3 +346,2 @@ },

},
path: 'files',
},

@@ -316,0 +348,0 @@ },

@@ -10,54 +10,2 @@ import normalizeFilters from '../../src/buildQuery/normalizeFilters';

test(`normalizeFilters must handle "all" op`, () => {
const input = {
op: AND_OP,
content: [
{
op: ALL_OP,
content: {
field: 'some_field',
value: ['val1', 'val2', 'val3'],
},
},
],
};
const output = {
op: AND_OP,
pivot: null,
content: [
{
op: AND_OP,
pivot: null,
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val1'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val2'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
],
},
],
};
expect(normalizeFilters(input)).toEqual(output);
});
test(`normalizeFilters must preserve pivots`, () => {

@@ -93,239 +41,1 @@ const input = {

});
test(`normalizeFilters must handle pivots for "all" op`, () => {
const input = {
op: AND_OP,
content: [
{
op: ALL_OP,
pivot: 'nested.nested1',
content: {
field: 'nested.nested1.some_field',
value: ['val1', 'val2'],
},
},
],
};
const output = {
op: AND_OP,
pivot: null,
content: [
{
op: AND_OP,
pivot: 'nested.nested1',
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'nested.nested1.some_field',
value: ['val1'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'nested.nested1.some_field',
value: ['val2'],
},
},
],
},
],
};
expect(normalizeFilters(input)).toEqual(output);
});
test(`normalizeFilters must initialize pivots for "all" op`, () => {
const input = {
op: AND_OP,
content: [
{
op: ALL_OP,
content: {
field: 'nested.nested1.some_field',
value: ['val1', 'val2'],
},
},
],
};
const output = {
op: AND_OP,
pivot: null,
content: [
{
op: AND_OP,
pivot: 'nested.nested1',
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'nested.nested1.some_field',
value: ['val1'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'nested.nested1.some_field',
value: ['val2'],
},
},
],
},
],
};
expect(normalizeFilters(input)).toEqual(output);
});
test(`normalizeFilters must optimize properly`, () => {
const input = {
op: AND_OP,
content: [
{
op: AND_OP,
content: [
{
op: IN_OP,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: OR_OP,
content: [
{
op: IN_OP,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: AND_OP,
content: [
{
op: IN_OP,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: AND_OP,
content: [
{
op: IN_OP,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: AND_OP,
content: [
{
op: ALL_OP,
content: {
field: 'some_field',
value: ['val3', 'val3', 'val3'],
},
},
],
},
],
},
],
},
],
},
],
},
],
};
const output = {
op: AND_OP,
pivot: null,
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: OR_OP,
pivot: null,
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: AND_OP,
pivot: null,
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: AND_OP,
pivot: null,
content: [
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
{
op: IN_OP,
pivot: null,
content: {
field: 'some_field',
value: ['val3'],
},
},
],
},
],
},
],
},
],
};
expect(normalizeFilters(input)).toEqual(output);
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc