@@ -164,7 +164,7 @@ var Query = /** @class */ (function () {
164164 var _a ;
165165 var fieldPath = Item_1 . Item . getPathByField ( "type" ) ;
166166 if ( values . length > 0 ) {
167- this . universeFilters = tslib_1 . __assign ( { } , this . universeFilters , ( _a = { } , _a [ "type" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
167+ this . universeFilters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . universeFilters ) , ( _a = { } , _a [ "type" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
168168 }
169169 else {
170170 delete this . universeFilters . type ;
@@ -181,18 +181,18 @@ var Query = /** @class */ (function () {
181181 * @return {Query }
182182 */
183183 Query . prototype . filterByTypes = function ( values , aggregate , aggregationSort ) {
184+ var _a , _b ;
184185 if ( aggregate === void 0 ) { aggregate = true ; }
185186 if ( aggregationSort === void 0 ) { aggregationSort = Aggregation_2 . AGGREGATION_SORT_BY_COUNT_DESC ; }
186- var _a , _b ;
187187 var fieldPath = Item_1 . Item . getPathByField ( "type" ) ;
188188 if ( values . length > 0 ) {
189- this . filters = tslib_1 . __assign ( { } , this . filters , ( _a = { } , _a [ "type" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
189+ this . filters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . filters ) , ( _a = { } , _a [ "type" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
190190 }
191191 else {
192192 delete this . filters . type ;
193193 }
194194 if ( aggregate ) {
195- this . aggregations = tslib_1 . __assign ( { } , this . aggregations , ( _b = { } , _b [ "type" ] = Aggregation_1 . Aggregation . create ( "type" , fieldPath , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD , [ ] , aggregationSort ) , _b ) ) ;
195+ this . aggregations = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . aggregations ) , ( _b = { } , _b [ "type" ] = Aggregation_1 . Aggregation . create ( "type" , fieldPath , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD , [ ] , aggregationSort ) , _b ) ) ;
196196 }
197197 return this ;
198198 } ;
@@ -207,7 +207,7 @@ var Query = /** @class */ (function () {
207207 var _a ;
208208 var fieldPath = Item_1 . Item . getPathByField ( "id" ) ;
209209 if ( values . length > 0 ) {
210- this . universeFilters = tslib_1 . __assign ( { } , this . universeFilters , ( _a = { } , _a [ "id" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
210+ this . universeFilters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . universeFilters ) , ( _a = { } , _a [ "id" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
211211 }
212212 else {
213213 delete this . universeFilters . id ;
@@ -225,7 +225,7 @@ var Query = /** @class */ (function () {
225225 var _a ;
226226 var fieldPath = Item_1 . Item . getPathByField ( "id" ) ;
227227 if ( values . length > 0 ) {
228- this . filters = tslib_1 . __assign ( { } , this . filters , ( _a = { } , _a [ "id" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
228+ this . filters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . filters ) , ( _a = { } , _a [ "id" ] = Filter_1 . Filter . create ( fieldPath , values , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
229229 }
230230 else {
231231 delete this . filters . id ;
@@ -242,11 +242,11 @@ var Query = /** @class */ (function () {
242242 * @return {Query }
243243 */
244244 Query . prototype . filterUniverseBy = function ( field , values , applicationType ) {
245- if ( applicationType === void 0 ) { applicationType = Filter_2 . FILTER_AT_LEAST_ONE ; }
246245 var _a ;
246+ if ( applicationType === void 0 ) { applicationType = Filter_2 . FILTER_AT_LEAST_ONE ; }
247247 var fieldPath = Item_1 . Item . getPathByField ( field ) ;
248248 if ( values . length > 0 ) {
249- this . universeFilters = tslib_1 . __assign ( { } , this . universeFilters , ( _a = { } , _a [ field ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
249+ this . universeFilters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . universeFilters ) , ( _a = { } , _a [ field ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
250250 }
251251 else {
252252 delete this . universeFilters [ field ] ;
@@ -266,13 +266,13 @@ var Query = /** @class */ (function () {
266266 * @return {Query }
267267 */
268268 Query . prototype . filterBy = function ( filterName , field , values , applicationType , aggregate , aggregationSort ) {
269+ var _a ;
269270 if ( applicationType === void 0 ) { applicationType = Filter_2 . FILTER_AT_LEAST_ONE ; }
270271 if ( aggregate === void 0 ) { aggregate = true ; }
271272 if ( aggregationSort === void 0 ) { aggregationSort = Aggregation_2 . AGGREGATION_SORT_BY_COUNT_DESC ; }
272- var _a ;
273273 var fieldPath = Item_1 . Item . getPathByField ( field ) ;
274274 if ( values . length > 0 ) {
275- this . filters = tslib_1 . __assign ( { } , this . filters , ( _a = { } , _a [ filterName ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
275+ this . filters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . filters ) , ( _a = { } , _a [ filterName ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
276276 }
277277 else {
278278 delete this . filters [ filterName ] ;
@@ -293,12 +293,12 @@ var Query = /** @class */ (function () {
293293 * @return {Query }
294294 */
295295 Query . prototype . filterUniverseByRange = function ( field , values , applicationType , rangeType ) {
296+ var _a ;
296297 if ( applicationType === void 0 ) { applicationType = Filter_2 . FILTER_AT_LEAST_ONE ; }
297298 if ( rangeType === void 0 ) { rangeType = Filter_2 . FILTER_TYPE_RANGE ; }
298- var _a ;
299299 var fieldPath = Item_1 . Item . getPathByField ( field ) ;
300300 if ( values . length > 0 ) {
301- this . universeFilters = tslib_1 . __assign ( { } , this . universeFilters , ( _a = { } , _a [ field ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , rangeType ) , _a ) ) ;
301+ this . universeFilters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . universeFilters ) , ( _a = { } , _a [ field ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , rangeType ) , _a ) ) ;
302302 }
303303 else {
304304 delete this . universeFilters [ field ] ;
@@ -333,14 +333,14 @@ var Query = /** @class */ (function () {
333333 * @return {Query }
334334 */
335335 Query . prototype . filterByRange = function ( filterName , field , options , values , applicationType , rangeType , aggregate , aggregationSort ) {
336+ var _a ;
336337 if ( applicationType === void 0 ) { applicationType = Filter_2 . FILTER_AT_LEAST_ONE ; }
337338 if ( rangeType === void 0 ) { rangeType = Filter_2 . FILTER_TYPE_RANGE ; }
338339 if ( aggregate === void 0 ) { aggregate = true ; }
339340 if ( aggregationSort === void 0 ) { aggregationSort = Aggregation_2 . AGGREGATION_SORT_BY_COUNT_DESC ; }
340- var _a ;
341341 var fieldPath = Item_1 . Item . getPathByField ( field ) ;
342342 if ( values . length !== 0 ) {
343- this . filters = tslib_1 . __assign ( { } , this . filters , ( _a = { } , _a [ filterName ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , rangeType ) , _a ) ) ;
343+ this . filters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . filters ) , ( _a = { } , _a [ filterName ] = Filter_1 . Filter . create ( fieldPath , values , applicationType , rangeType ) , _a ) ) ;
344344 }
345345 else {
346346 delete this . filters [ filterName ] ;
@@ -378,7 +378,7 @@ var Query = /** @class */ (function () {
378378 */
379379 Query . prototype . filterUniverseByLocation = function ( locationRange ) {
380380 var _a ;
381- this . universeFilters = tslib_1 . __assign ( { } , this . universeFilters , ( _a = { } , _a [ "coordinate" ] = Filter_1 . Filter . create ( "coordinate" , locationRange . toArray ( ) , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_GEO ) , _a ) ) ;
381+ this . universeFilters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . universeFilters ) , ( _a = { } , _a [ "coordinate" ] = Filter_1 . Filter . create ( "coordinate" , locationRange . toArray ( ) , Filter_2 . FILTER_AT_LEAST_ONE , Filter_2 . FILTER_TYPE_GEO ) , _a ) ) ;
382382 return this ;
383383 } ;
384384 /**
@@ -429,10 +429,10 @@ var Query = /** @class */ (function () {
429429 * @return {Query }
430430 */
431431 Query . prototype . aggregateBy = function ( filterName , field , applicationType , aggregationSort , limit ) {
432+ var _a ;
432433 if ( aggregationSort === void 0 ) { aggregationSort = Aggregation_2 . AGGREGATION_SORT_BY_COUNT_DESC ; }
433434 if ( limit === void 0 ) { limit = Aggregation_2 . AGGREGATION_NO_LIMIT ; }
434- var _a ;
435- this . aggregations = tslib_1 . __assign ( { } , this . aggregations , ( _a = { } , _a [ filterName ] = Aggregation_1 . Aggregation . create ( filterName , Item_1 . Item . getPathByField ( field ) , applicationType , Filter_2 . FILTER_TYPE_FIELD , [ ] , aggregationSort , limit ) , _a ) ) ;
435+ this . aggregations = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . aggregations ) , ( _a = { } , _a [ filterName ] = Aggregation_1 . Aggregation . create ( filterName , Item_1 . Item . getPathByField ( field ) , applicationType , Filter_2 . FILTER_TYPE_FIELD , [ ] , aggregationSort , limit ) , _a ) ) ;
436436 return this ;
437437 } ;
438438 /**
@@ -449,14 +449,14 @@ var Query = /** @class */ (function () {
449449 * @return {Query }
450450 */
451451 Query . prototype . aggregateByRange = function ( filterName , field , options , applicationType , rangeType , aggregationSort , limit ) {
452+ var _a ;
452453 if ( rangeType === void 0 ) { rangeType = Filter_2 . FILTER_TYPE_RANGE ; }
453454 if ( aggregationSort === void 0 ) { aggregationSort = Aggregation_2 . AGGREGATION_SORT_BY_COUNT_DESC ; }
454455 if ( limit === void 0 ) { limit = Aggregation_2 . AGGREGATION_NO_LIMIT ; }
455- var _a ;
456456 if ( options . length === 0 ) {
457457 return this ;
458458 }
459- this . aggregations = tslib_1 . __assign ( { } , this . aggregations , ( _a = { } , _a [ filterName ] = Aggregation_1 . Aggregation . create ( filterName , Item_1 . Item . getPathByField ( field ) , applicationType , rangeType , options , aggregationSort , limit ) , _a ) ) ;
459+ this . aggregations = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . aggregations ) , ( _a = { } , _a [ filterName ] = Aggregation_1 . Aggregation . create ( filterName , Item_1 . Item . getPathByField ( field ) , applicationType , rangeType , options , aggregationSort , limit ) , _a ) ) ;
460460 return this ;
461461 } ;
462462 /**
@@ -754,12 +754,12 @@ var Query = /** @class */ (function () {
754754 * @return {Query }
755755 */
756756 Query . prototype . excludeUUIDs = function ( ) {
757+ var _a ;
757758 var uuids = [ ] ;
758759 for ( var _i = 0 ; _i < arguments . length ; _i ++ ) {
759760 uuids [ _i ] = arguments [ _i ] ;
760761 }
761- var _a ;
762- this . filters = tslib_1 . __assign ( { } , this . filters , ( _a = { } , _a [ "excluded_ids" ] = Filter_1 . Filter . create ( "_id" , uuids . map ( function ( uuid ) { return uuid . composedUUID ( ) ; } ) , Filter_2 . FILTER_EXCLUDE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
762+ this . filters = tslib_1 . __assign ( tslib_1 . __assign ( { } , this . filters ) , ( _a = { } , _a [ "excluded_ids" ] = Filter_1 . Filter . create ( "_id" , uuids . map ( function ( uuid ) { return uuid . composedUUID ( ) ; } ) , Filter_2 . FILTER_EXCLUDE , Filter_2 . FILTER_TYPE_FIELD ) , _a ) ) ;
763763 return this ;
764764 } ;
765765 /**
0 commit comments