@sisense/sdk-data 1.23.0 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/cjs/dimensional-model/filter-relations.d.ts +9 -0
  2. package/dist/cjs/dimensional-model/filter-relations.js +18 -0
  3. package/dist/cjs/dimensional-model/filters/factory.d.ts +84 -85
  4. package/dist/cjs/dimensional-model/filters/factory.js +126 -127
  5. package/dist/cjs/dimensional-model/filters/filter-config-utils.d.ts +25 -0
  6. package/dist/cjs/dimensional-model/filters/filter-config-utils.js +49 -0
  7. package/dist/cjs/dimensional-model/filters/filters.d.ts +28 -51
  8. package/dist/cjs/dimensional-model/filters/filters.js +51 -95
  9. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -4
  10. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +35 -28
  11. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +9 -5
  12. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +32 -8
  13. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +17 -27
  14. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +37 -39
  15. package/dist/cjs/dimensional-model/interfaces.d.ts +113 -15
  16. package/dist/cjs/dimensional-model/types.d.ts +18 -11
  17. package/dist/cjs/index.d.ts +2 -0
  18. package/dist/cjs/index.js +2 -0
  19. package/dist/cjs/interfaces.d.ts +8 -0
  20. package/dist/cjs/utils.d.ts +5 -3
  21. package/dist/cjs/utils.js +35 -9
  22. package/dist/dimensional-model/filter-relations.d.ts +9 -0
  23. package/dist/dimensional-model/filter-relations.js +14 -0
  24. package/dist/dimensional-model/filters/factory.d.ts +84 -85
  25. package/dist/dimensional-model/filters/factory.js +126 -127
  26. package/dist/dimensional-model/filters/filter-config-utils.d.ts +25 -0
  27. package/dist/dimensional-model/filters/filter-config-utils.js +39 -0
  28. package/dist/dimensional-model/filters/filters.d.ts +28 -51
  29. package/dist/dimensional-model/filters/filters.js +51 -95
  30. package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -4
  31. package/dist/dimensional-model/filters/utils/condition-filter-util.js +35 -28
  32. package/dist/dimensional-model/filters/utils/filter-code-util.d.ts +9 -5
  33. package/dist/dimensional-model/filters/utils/filter-code-util.js +32 -8
  34. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +17 -27
  35. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +36 -37
  36. package/dist/dimensional-model/interfaces.d.ts +113 -15
  37. package/dist/dimensional-model/types.d.ts +18 -11
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +2 -0
  40. package/dist/interfaces.d.ts +8 -0
  41. package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -1
  42. package/dist/utils.d.ts +5 -3
  43. package/dist/utils.js +33 -7
  44. package/package.json +3 -3
@@ -16,11 +16,11 @@ import { TextOperators, NumericOperators, DateOperators, LogicalOperators, Ranki
16
16
  * ])
17
17
  * ```
18
18
  * @param filters - Filters to union. The filters must all be on the same attribute.
19
- * @param guid - Optional GUID for the filter
19
+ * @param config - Optional configuration for the filter
20
20
  * @returns A filter instance
21
21
  */
22
- export function union(filters, guid) {
23
- return new LogicalAttributeFilter(filters, LogicalOperators.Union, guid);
22
+ export function union(filters, config) {
23
+ return new LogicalAttributeFilter(filters, LogicalOperators.Union, config);
24
24
  }
25
25
  /**
26
26
  * Creates a filter representing the intersection of multiple filters on the same attribute. The resulting
@@ -38,11 +38,11 @@ export function union(filters, guid) {
38
38
  * ])
39
39
  * ```
40
40
  * @param filters - Filters to intersect. The filters must all be on the same attribute.
41
- * @param guid - Optional GUID for the filter
41
+ * @param config - Optional configuration for the filter
42
42
  * @returns A filter instance
43
43
  */
44
- export function intersection(filters, guid) {
45
- return new LogicalAttributeFilter(filters, LogicalOperators.Intersection, guid);
44
+ export function intersection(filters, config) {
45
+ return new LogicalAttributeFilter(filters, LogicalOperators.Intersection, config);
46
46
  }
47
47
  /**
48
48
  * Creates a filter that excludes items matching the given filter
@@ -66,12 +66,12 @@ export function intersection(filters, guid) {
66
66
  * ```
67
67
  * @param filter - Filter to exclude
68
68
  * @param input - Input filter to exclude from, on the same attribute. If not provided, the filter excludes from all items.
69
- * @param guid - Optional GUID for the filter
69
+ * @param config - Optional configuration for the filter
70
70
  * @returns A filter representing an exclusion of the given filter
71
71
  * from all attribute members or from the optional input filter
72
72
  */
73
- export function exclude(filter, input, guid) {
74
- return new ExcludeFilter(filter, input, guid);
73
+ export function exclude(filter, input, config) {
74
+ return new ExcludeFilter(filter, input, config);
75
75
  }
76
76
  // TEXT / NUMERIC FILTERS
77
77
  /**
@@ -90,11 +90,11 @@ export function exclude(filter, input, guid) {
90
90
  * ```
91
91
  * @param attribute - Text attribute to filter on
92
92
  * @param value - Value to filter by
93
- * @param guid - Optional GUID for the filter
93
+ * @param config - Optional configuration for the filter
94
94
  * @returns A filter instance
95
95
  */
96
- export function doesntContain(attribute, value, guid) {
97
- return new TextFilter(attribute, TextOperators.DoesntContain, value, guid);
96
+ export function doesntContain(attribute, value, config) {
97
+ return new TextFilter(attribute, TextOperators.DoesntContain, value, config);
98
98
  }
99
99
  /**
100
100
  * Creates a filter to isolate attribute values that do not end with a specified string.
@@ -112,11 +112,11 @@ export function doesntContain(attribute, value, guid) {
112
112
  * ```
113
113
  * @param attribute - Text attribute to filter on
114
114
  * @param value - Value to filter by
115
- * @param guid - Optional GUID for the filter
115
+ * @param config - Optional configuration for the filter
116
116
  * @returns A filter instance
117
117
  */
118
- export function doesntEndWith(attribute, value, guid) {
119
- return new TextFilter(attribute, TextOperators.DoesntEndWith, value, guid);
118
+ export function doesntEndWith(attribute, value, config) {
119
+ return new TextFilter(attribute, TextOperators.DoesntEndWith, value, config);
120
120
  }
121
121
  /**
122
122
  * Creates a filter to isolate attribute values that do not start with a specified string.
@@ -134,11 +134,11 @@ export function doesntEndWith(attribute, value, guid) {
134
134
  * ```
135
135
  * @param attribute - Text attribute to filter on
136
136
  * @param value - Value to filter by
137
- * @param guid - Optional GUID for the filter
137
+ * @param config - Optional configuration for the filter
138
138
  * @returns A filter instance
139
139
  */
140
- export function doesntStartWith(attribute, value, guid) {
141
- return new TextFilter(attribute, TextOperators.DoesntStartWith, value, guid);
140
+ export function doesntStartWith(attribute, value, config) {
141
+ return new TextFilter(attribute, TextOperators.DoesntStartWith, value, config);
142
142
  }
143
143
  /**
144
144
  * Creates a filter to isolate attribute values that contain a specified string.
@@ -156,11 +156,11 @@ export function doesntStartWith(attribute, value, guid) {
156
156
  * ```
157
157
  * @param attribute - Text attribute to filter on
158
158
  * @param value - Value to filter by
159
- * @param guid - Optional GUID for the filter
159
+ * @param config - Optional configuration for the filter
160
160
  * @returns A filter instance
161
161
  */
162
- export function contains(attribute, value, guid) {
163
- return new TextFilter(attribute, TextOperators.Contains, value, guid);
162
+ export function contains(attribute, value, config) {
163
+ return new TextFilter(attribute, TextOperators.Contains, value, config);
164
164
  }
165
165
  /**
166
166
  * Creates a filter to isolate attribute values that end with a specified string.
@@ -178,11 +178,11 @@ export function contains(attribute, value, guid) {
178
178
  * ```
179
179
  * @param attribute - Text attribute to filter on
180
180
  * @param value - Value to filter by
181
- * @param guid - Optional GUID for the filter
181
+ * @param config - Optional configuration for the filter
182
182
  * @returns A filter instance
183
183
  */
184
- export function endsWith(attribute, value, guid) {
185
- return new TextFilter(attribute, TextOperators.EndsWith, value, guid);
184
+ export function endsWith(attribute, value, config) {
185
+ return new TextFilter(attribute, TextOperators.EndsWith, value, config);
186
186
  }
187
187
  /**
188
188
  * Creates a filter to isolate attribute values that start with a specified string.
@@ -200,11 +200,11 @@ export function endsWith(attribute, value, guid) {
200
200
  * ```
201
201
  * @param attribute - Text attribute to filter on
202
202
  * @param value - Value to filter by
203
- * @param guid - Optional GUID for the filter
203
+ * @param config - Optional configuration for the filter
204
204
  * @returns A filter instance
205
205
  */
206
- export function startsWith(attribute, value, guid) {
207
- return new TextFilter(attribute, TextOperators.StartsWith, value, guid);
206
+ export function startsWith(attribute, value, config) {
207
+ return new TextFilter(attribute, TextOperators.StartsWith, value, config);
208
208
  }
209
209
  /**
210
210
  * Creates a filter to isolate attribute values that match a specified string pattern.
@@ -227,11 +227,11 @@ export function startsWith(attribute, value, guid) {
227
227
  * ```
228
228
  * @param attribute - Text attribute to filter on
229
229
  * @param value - Value to filter by
230
- * @param guid - Optional GUID for the filter
230
+ * @param config - Optional configuration for the filter
231
231
  * @returns A filter instance
232
232
  */
233
- export function like(attribute, value, guid) {
234
- return new TextFilter(attribute, TextOperators.Like, value, guid);
233
+ export function like(attribute, value, config) {
234
+ return new TextFilter(attribute, TextOperators.Like, value, config);
235
235
  }
236
236
  /**
237
237
  * Creates a filter to isolate attribute values that do not equal a specified string or number.
@@ -249,14 +249,15 @@ export function like(attribute, value, guid) {
249
249
  * ```
250
250
  * @param attribute - Text or numeric attribute to filter on
251
251
  * @param value - Value to filter by
252
+ * @param config - Optional configuration for the filter
252
253
  * @returns A filter instance
253
254
  */
254
- export function doesntEqual(attribute, value, guid) {
255
+ export function doesntEqual(attribute, value, config) {
255
256
  if (typeof value === 'string') {
256
- return new TextFilter(attribute, TextOperators.DoesntEqual, value, guid);
257
+ return new TextFilter(attribute, TextOperators.DoesntEqual, value, config);
257
258
  }
258
259
  else {
259
- return numeric(attribute, NumericOperators.DoesntEqual, value, undefined, undefined, guid);
260
+ return numeric(attribute, NumericOperators.DoesntEqual, value, undefined, undefined, config);
260
261
  }
261
262
  }
262
263
  /**
@@ -275,15 +276,15 @@ export function doesntEqual(attribute, value, guid) {
275
276
  * ```
276
277
  * @param attribute - Text or numeric attribute to filter on
277
278
  * @param value - Value to filter by
278
- * @param guid - Optional GUID for the filter
279
+ * @param config - Optional configuration for the filter
279
280
  * @returns A filter instance
280
281
  */
281
- export function equals(attribute, value, guid) {
282
+ export function equals(attribute, value, config) {
282
283
  if (typeof value === 'string') {
283
- return new TextFilter(attribute, TextOperators.Equals, value, guid);
284
+ return new TextFilter(attribute, TextOperators.Equals, value, config);
284
285
  }
285
286
  else {
286
- return numeric(attribute, NumericOperators.Equals, value, undefined, undefined, guid);
287
+ return numeric(attribute, NumericOperators.Equals, value, undefined, undefined, config);
287
288
  }
288
289
  }
289
290
  /**
@@ -296,11 +297,11 @@ export function equals(attribute, value, guid) {
296
297
  * ```
297
298
  * @param attribute - Numeric attribute to filter on
298
299
  * @param value - Value to filter by
299
- * @param guid - Optional GUID for the filter
300
+ * @param config - Optional configuration for the filter
300
301
  * @returns A filter instance
301
302
  */
302
- export function greaterThan(attribute, value, guid) {
303
- return numeric(attribute, NumericOperators.FromNotEqual, value, undefined, undefined, guid);
303
+ export function greaterThan(attribute, value, config) {
304
+ return numeric(attribute, NumericOperators.FromNotEqual, value, undefined, undefined, config);
304
305
  }
305
306
  /**
306
307
  * Creates a filter to isolate attribute values greater than or equal to a specified number.
@@ -312,11 +313,11 @@ export function greaterThan(attribute, value, guid) {
312
313
  * ```
313
314
  * @param attribute - Numeric attribute to filter on
314
315
  * @param value - Value to filter by
315
- * @param guid - Optional GUID for the filter
316
+ * @param config - Optional configuration for the filter
316
317
  * @returns A filter instance
317
318
  */
318
- export function greaterThanOrEqual(attribute, value, guid) {
319
- return numeric(attribute, NumericOperators.From, value, undefined, undefined, guid);
319
+ export function greaterThanOrEqual(attribute, value, config) {
320
+ return numeric(attribute, NumericOperators.From, value, undefined, undefined, config);
320
321
  }
321
322
  /**
322
323
  * Creates a filter to isolate attribute values strictly less than a specified number.
@@ -328,11 +329,11 @@ export function greaterThanOrEqual(attribute, value, guid) {
328
329
  * ```
329
330
  * @param attribute - Numeric attribute to filter on
330
331
  * @param value - Value to filter by
331
- * @param guid - Optional GUID for the filter
332
+ * @param config - Optional configuration for the filter
332
333
  * @returns A filter instance
333
334
  */
334
- export function lessThan(attribute, value, guid) {
335
- return numeric(attribute, NumericOperators.ToNotEqual, value, undefined, undefined, guid);
335
+ export function lessThan(attribute, value, config) {
336
+ return numeric(attribute, NumericOperators.ToNotEqual, value, undefined, undefined, config);
336
337
  }
337
338
  /**
338
339
  * Creates a filter to isolate attribute values less than or equal to a specified number.
@@ -344,11 +345,11 @@ export function lessThan(attribute, value, guid) {
344
345
  * ```
345
346
  * @param attribute - Numeric attribute to filter on
346
347
  * @param value - Value to filter by
347
- * @param guid - Optional GUID for the filter
348
+ * @param config - Optional configuration for the filter
348
349
  * @returns A filter instance
349
350
  */
350
- export function lessThanOrEqual(attribute, value, guid) {
351
- return numeric(attribute, NumericOperators.To, value, undefined, undefined, guid);
351
+ export function lessThanOrEqual(attribute, value, config) {
352
+ return numeric(attribute, NumericOperators.To, value, undefined, undefined, config);
352
353
  }
353
354
  /**
354
355
  * Creates a filter to isolate attribute values within or exactly matching two specified numerical boundaries.
@@ -361,11 +362,11 @@ export function lessThanOrEqual(attribute, value, guid) {
361
362
  * @param attribute - Numeric attribute to filter on
362
363
  * @param valueA - Value to filter from
363
364
  * @param valueB - Value to filter to
364
- * @param guid - Optional GUID for the filter
365
+ * @param config - Optional configuration for the filter
365
366
  * @returns A filter instance
366
367
  */
367
- export function between(attribute, valueA, valueB, guid) {
368
- return numeric(attribute, NumericOperators.From, valueA, NumericOperators.To, valueB, guid);
368
+ export function between(attribute, valueA, valueB, config) {
369
+ return numeric(attribute, NumericOperators.From, valueA, NumericOperators.To, valueB, config);
369
370
  }
370
371
  /**
371
372
  * Creates a filter that isolates attribute values strictly within two specified numerical boundaries.
@@ -378,11 +379,11 @@ export function between(attribute, valueA, valueB, guid) {
378
379
  * @param attribute - Numeric attribute to filter on
379
380
  * @param valueA - Value to filter from
380
381
  * @param valueB - Value to filter to
381
- * @param guid - Optional GUID for the filter
382
+ * @param config - Optional configuration for the filter
382
383
  * @returns A filter instance
383
384
  */
384
- export function betweenNotEqual(attribute, valueA, valueB, guid) {
385
- return numeric(attribute, NumericOperators.FromNotEqual, valueA, NumericOperators.ToNotEqual, valueB, guid);
385
+ export function betweenNotEqual(attribute, valueA, valueB, config) {
386
+ return numeric(attribute, NumericOperators.FromNotEqual, valueA, NumericOperators.ToNotEqual, valueB, config);
386
387
  }
387
388
  /**
388
389
  * Creates a custom numeric filter that filters for given attribute values.
@@ -404,11 +405,11 @@ export function betweenNotEqual(attribute, valueA, valueB, guid) {
404
405
  * @param valueA - First value
405
406
  * @param operatorB - Second operator
406
407
  * @param valueB - Second value
407
- * @param guid - Optional GUID for the filter
408
+ * @param config - Optional configuration for the filter
408
409
  * @returns A custom numeric filter of the given attribute
409
410
  */
410
- export function numeric(attribute, operatorA, valueA, operatorB, valueB, guid) {
411
- return new NumericFilter(attribute, operatorA, valueA, operatorB, valueB, guid);
411
+ export function numeric(attribute, operatorA, valueA, operatorB, valueB, config) {
412
+ return new NumericFilter(attribute, operatorA, valueA, operatorB, valueB, config);
412
413
  }
413
414
  /**
414
415
  * Creates a filter to isolate attribute values that match any of the specified strings.
@@ -423,16 +424,12 @@ export function numeric(attribute, operatorA, valueA, operatorB, valueB, guid) {
423
424
  * ```
424
425
  * @param attribute - Attribute to filter on
425
426
  * @param members - Array of member values to filter by
426
- * @param excludeMembers - Whether selected members are for exclusion
427
- * @param guid - Optional GUID for the filter
428
- * @param deactivatedMembers - Array of deactivated member values
429
- * @param backgroundFilter - Optional background filter
430
- * @param multiSelection - Optional flag to disable multi-selection
427
+ * @param config - Optional configuration for the filter
431
428
  * @returns A filter instance
432
429
  * @shortDescription Creates filter on attribute to match certain string values
433
430
  */
434
- export function members(attribute, members, excludeMembers, guid, deactivatedMembers, backgroundFilter, multiSelection) {
435
- return new MembersFilter(attribute, members, excludeMembers, guid, deactivatedMembers, backgroundFilter, multiSelection);
431
+ export function members(attribute, members, config) {
432
+ return new MembersFilter(attribute, members, config);
436
433
  }
437
434
  // DATE FILTERS
438
435
  /**
@@ -445,10 +442,11 @@ export function members(attribute, members, excludeMembers, guid, deactivatedMem
445
442
  * ```
446
443
  * @param level - Date {@link LevelAttribute} to filter on
447
444
  * @param from - Date or string representing the value to filter from
445
+ * @param config - Optional configuration for the filter
448
446
  * @returns A filter instance
449
447
  */
450
- export function dateFrom(level, from, guid) {
451
- return dateRange(level, from, undefined, guid);
448
+ export function dateFrom(level, from, config) {
449
+ return dateRange(level, from, undefined, config);
452
450
  }
453
451
  /**
454
452
  * Creates a filter to isolate items up until and including the given date and level.
@@ -460,11 +458,11 @@ export function dateFrom(level, from, guid) {
460
458
  * ```
461
459
  * @param level - Date {@link LevelAttribute} to filter on
462
460
  * @param to - Date or string representing the last member to filter to
463
- * @param guid - Optional GUID for the filter
461
+ * @param config - Optional configuration for the filter
464
462
  * @returns A filter instance
465
463
  */
466
- export function dateTo(level, to, guid) {
467
- return dateRange(level, undefined, to, guid);
464
+ export function dateTo(level, to, config) {
465
+ return dateRange(level, undefined, to, config);
468
466
  }
469
467
  /**
470
468
  * Creates a filter to isolate items between and including the given dates and level.
@@ -477,11 +475,11 @@ export function dateTo(level, to, guid) {
477
475
  * @param level - Date {@link LevelAttribute} to filter on
478
476
  * @param from - Date or string representing the start member to filter from
479
477
  * @param to - Date or string representing the end member to filter to
480
- * @param guid - Optional GUID for the filter
478
+ * @param config - Optional configuration for the filter
481
479
  * @returns A filter instance
482
480
  */
483
- export function dateRange(level, from, to, guid) {
484
- return new DateRangeFilter(level, from, to, guid);
481
+ export function dateRange(level, from, to, config) {
482
+ return new DateRangeFilter(level, from, to, config);
485
483
  }
486
484
  /**
487
485
  * Creates a filter to isolate items with a date dimension value within a specified range after a
@@ -512,11 +510,11 @@ export function dateRange(level, from, to, guid) {
512
510
  * Positive numbers skip forwards and negative numbers skip backwards (e.g. `-6` is 6 months backwards when `level` is a months level attribute)
513
511
  * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
514
512
  * @param anchor - Date to filter from, defaults to the current day
515
- * @param guid - Optional GUID for the filter
513
+ * @param config - Optional configuration for the filter
516
514
  * @returns A filter instance
517
515
  */
518
- export function dateRelative(level, offset, count, anchor, guid) {
519
- return new RelativeDateFilter(level, offset, count, undefined, anchor, guid);
516
+ export function dateRelative(level, offset, count, anchor, config) {
517
+ return new RelativeDateFilter(level, offset, count, undefined, anchor, config);
520
518
  }
521
519
  /**
522
520
  * Creates a filter to isolate items with a date dimension value within a specified range after a
@@ -531,11 +529,11 @@ export function dateRelative(level, offset, count, anchor, guid) {
531
529
  * @param offset - Number of levels to skip from the given `anchor` or the default of the current day (e.g. `6` is 6 months when `level` is a months level attribute)
532
530
  * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
533
531
  * @param anchor - Date to filter from, defaults to the current day
534
- * @param guid - Optional GUID for the filter
532
+ * @param config - Optional configuration for the filter
535
533
  * @returns A filter instance
536
534
  */
537
- export function dateRelativeFrom(level, offset, count, anchor, guid) {
538
- return new RelativeDateFilter(level, offset, count, DateOperators.Next, anchor, guid);
535
+ export function dateRelativeFrom(level, offset, count, anchor, config) {
536
+ return new RelativeDateFilter(level, offset, count, DateOperators.Next, anchor, config);
539
537
  }
540
538
  /**
541
539
  * Creates a filter to isolate items with a date dimension value within a specified range before a
@@ -550,11 +548,11 @@ export function dateRelativeFrom(level, offset, count, anchor, guid) {
550
548
  * @param offset - Number of levels to skip from the given `anchor` or the default of the current day (e.g. `6` is 6 months when `level` is a months level attribute)
551
549
  * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
552
550
  * @param anchor - Date to filter to, defaults to the current day
553
- * @param guid - Optional GUID for the filter
551
+ * @param config - Optional configuration for the filter
554
552
  * @returns A filter instance
555
553
  */
556
- export function dateRelativeTo(level, offset, count, anchor, guid) {
557
- return new RelativeDateFilter(level, offset, count, DateOperators.Last, anchor, guid);
554
+ export function dateRelativeTo(level, offset, count, anchor, config) {
555
+ return new RelativeDateFilter(level, offset, count, DateOperators.Last, anchor, config);
558
556
  }
559
557
  /**
560
558
  * Creates a filter to isolate items with a date dimension value in the current calendar year.
@@ -565,11 +563,11 @@ export function dateRelativeTo(level, offset, count, anchor, guid) {
565
563
  * filterFactory.thisYear(DM.Commerce.Date)
566
564
  * ```
567
565
  * @param dimension - Date dimension to filter
568
- * @param guid - Optional GUID for the filter
566
+ * @param config - Optional configuration for the filter
569
567
  * @returns A filter instance
570
568
  */
571
- export function thisYear(dimension, guid) {
572
- return dateRelativeTo(dimension.Years, 0, 1, undefined, guid);
569
+ export function thisYear(dimension, config) {
570
+ return dateRelativeTo(dimension.Years, 0, 1, undefined, config);
573
571
  }
574
572
  /**
575
573
  * Creates a filter to isolate items with a date dimension value in the current calendar month.
@@ -580,11 +578,11 @@ export function thisYear(dimension, guid) {
580
578
  * filterFactory.thisMonth(DM.Commerce.Date)
581
579
  * ```
582
580
  * @param dimension - Date dimension to filter
583
- * @param guid - Optional GUID for the filter
581
+ * @param config - Optional configuration for the filter
584
582
  * @returns A filter instance
585
583
  */
586
- export function thisMonth(dimension, guid) {
587
- return dateRelativeTo(dimension.Months, 0, 1, undefined, guid);
584
+ export function thisMonth(dimension, config) {
585
+ return dateRelativeTo(dimension.Months, 0, 1, undefined, config);
588
586
  }
589
587
  /**
590
588
  * Creates a filter to isolate items with a date dimension value in the current quarter.
@@ -595,11 +593,11 @@ export function thisMonth(dimension, guid) {
595
593
  * filterFactory.thisQuarter(DM.Commerce.Date)
596
594
  * ```
597
595
  * @param dimension - Date dimension to filter
598
- * @param guid - Optional GUID for the filter
596
+ * @param config - Optional configuration for the filter
599
597
  * @returns A filter instance
600
598
  */
601
- export function thisQuarter(dimension, guid) {
602
- return dateRelativeTo(dimension.Quarters, 0, 1, undefined, guid);
599
+ export function thisQuarter(dimension, config) {
600
+ return dateRelativeTo(dimension.Quarters, 0, 1, undefined, config);
603
601
  }
604
602
  /**
605
603
  * Creates a filter to isolate items with a date dimension value of the current date.
@@ -610,11 +608,11 @@ export function thisQuarter(dimension, guid) {
610
608
  * filterFactory.today(DM.Commerce.Date)
611
609
  * ```
612
610
  * @param dimension - date dimension to filter
613
- * @param guid - Optional GUID for the filter
611
+ * @param config - Optional configuration for the filter
614
612
  * @returns A filter instance
615
613
  */
616
- export function today(dimension, guid) {
617
- return dateRelativeTo(dimension.Days, 0, 1, undefined, guid);
614
+ export function today(dimension, config) {
615
+ return dateRelativeTo(dimension.Days, 0, 1, undefined, config);
618
616
  }
619
617
  // MEASURE-RELATED FILTERS
620
618
  /**
@@ -626,12 +624,12 @@ export function today(dimension, guid) {
626
624
  * @param valueA - First value
627
625
  * @param operatorB - Operator to apply on `valueB` ({@link NumericOperators})
628
626
  * @param valueB - Second value
629
- * @param guid - Optional GUID for the filter
627
+ * @param config - Optional configuration for the filter
630
628
  * @returns A filter representing the provided logic
631
629
  * @internal
632
630
  */
633
- export function measureBase(attribute, measure, operatorA, valueA, operatorB, valueB, guid) {
634
- return new MeasureFilter(attribute, measure, operatorA, valueA, operatorB, valueB, guid);
631
+ export function measureBase(attribute, measure, operatorA, valueA, operatorB, valueB, config) {
632
+ return new MeasureFilter(attribute, measure, operatorA, valueA, operatorB, valueB, config);
635
633
  }
636
634
  /**
637
635
  * Creates a filter to isolate a measure value equal to a given number.
@@ -646,11 +644,11 @@ export function measureBase(attribute, measure, operatorA, valueA, operatorB, va
646
644
  * ```
647
645
  * @param measure - Measure to filter by
648
646
  * @param value - Value
649
- * @param guid - Optional GUID for the filter
647
+ * @param config - Optional configuration for the filter
650
648
  * @returns A filter instance
651
649
  */
652
- export function measureEquals(measure, value, guid) {
653
- return measureBase(measure.attribute, measure, NumericOperators.Equals, value, undefined, undefined, guid);
650
+ export function measureEquals(measure, value, config) {
651
+ return measureBase(measure.attribute, measure, NumericOperators.Equals, value, undefined, undefined, config);
654
652
  }
655
653
  /**
656
654
  * Creates a filter to isolate a measure value greater than to a given number.
@@ -666,11 +664,11 @@ export function measureEquals(measure, value, guid) {
666
664
  * ```
667
665
  * @param measure - Measure to filter by
668
666
  * @param value - Min value
669
- * @param guid - Optional GUID for the filter
667
+ * @param config - Optional configuration for the filter
670
668
  * @returns A filter instance
671
669
  */
672
- export function measureGreaterThan(measure, value, guid) {
673
- return measureBase(measure.attribute, measure, NumericOperators.FromNotEqual, value, undefined, undefined, guid);
670
+ export function measureGreaterThan(measure, value, config) {
671
+ return measureBase(measure.attribute, measure, NumericOperators.FromNotEqual, value, undefined, undefined, config);
674
672
  }
675
673
  /**
676
674
  * Creates a filter to isolate a measure value greater than or equal to a given number.
@@ -686,11 +684,11 @@ export function measureGreaterThan(measure, value, guid) {
686
684
  * ```
687
685
  * @param measure - Measure to filter by
688
686
  * @param value - Min value
689
- * @param guid - Optional GUID for the filter
687
+ * @param config - Optional configuration for the filter
690
688
  * @returns A filter instance
691
689
  */
692
- export function measureGreaterThanOrEqual(measure, value, guid) {
693
- return measureBase(measure.attribute, measure, NumericOperators.From, value, undefined, undefined, guid);
690
+ export function measureGreaterThanOrEqual(measure, value, config) {
691
+ return measureBase(measure.attribute, measure, NumericOperators.From, value, undefined, undefined, config);
694
692
  }
695
693
  /**
696
694
  * Creates a filter to isolate a measure value less than or equal to a given number.
@@ -706,11 +704,11 @@ export function measureGreaterThanOrEqual(measure, value, guid) {
706
704
  * ```
707
705
  * @param measure - Measure to filter by
708
706
  * @param value - Max value
709
- * @param guid - Optional GUID for the filter
707
+ * @param config - Optional configuration for the filter
710
708
  * @returns A filter instance
711
709
  */
712
- export function measureLessThanOrEqual(measure, value, guid) {
713
- return measureBase(measure.attribute, measure, NumericOperators.To, value, undefined, undefined, guid);
710
+ export function measureLessThanOrEqual(measure, value, config) {
711
+ return measureBase(measure.attribute, measure, NumericOperators.To, value, undefined, undefined, config);
714
712
  }
715
713
  /**
716
714
  * Creates a filter to isolate a measure value less than a given number.
@@ -725,11 +723,11 @@ export function measureLessThanOrEqual(measure, value, guid) {
725
723
  * ```
726
724
  * @param measure - Measure to filter by
727
725
  * @param value - Value
728
- * @param guid - Optional GUID for the filter
726
+ * @param config - Optional configuration for the filter
729
727
  * @returns A filter instance
730
728
  */
731
- export function measureLessThan(measure, value, guid) {
732
- return measureBase(measure.attribute, measure, NumericOperators.ToNotEqual, value, undefined, undefined, guid);
729
+ export function measureLessThan(measure, value, config) {
730
+ return measureBase(measure.attribute, measure, NumericOperators.ToNotEqual, value, undefined, undefined, config);
733
731
  }
734
732
  /**
735
733
  * Creates a filter to isolate a measure value between or equal to two given numbers.
@@ -747,11 +745,11 @@ export function measureLessThan(measure, value, guid) {
747
745
  * @param measure - Measure to filter by
748
746
  * @param valueA - Min value
749
747
  * @param valueB - Max value
750
- * @param guid - Optional GUID for the filter
748
+ * @param config - Optional configuration for the filter
751
749
  * @returns A filter instance
752
750
  */
753
- export function measureBetween(measure, valueA, valueB, guid) {
754
- return measureBase(measure.attribute, measure, NumericOperators.From, valueA, NumericOperators.To, valueB, guid);
751
+ export function measureBetween(measure, valueA, valueB, config) {
752
+ return measureBase(measure.attribute, measure, NumericOperators.From, valueA, NumericOperators.To, valueB, config);
755
753
  }
756
754
  /**
757
755
  * Creates a filter to isolate a measure value between but not equal to two given numbers.
@@ -769,11 +767,11 @@ export function measureBetween(measure, valueA, valueB, guid) {
769
767
  * @param measure - Measure to filter by
770
768
  * @param valueA - Min value
771
769
  * @param valueB - Max value
772
- * @param guid - Optional GUID for the filter
770
+ * @param config - Optional configuration for the filter
773
771
  * @returns A filter instance
774
772
  */
775
- export function measureBetweenNotEqual(measure, valueA, valueB, guid) {
776
- return measureBase(measure.attribute, measure, NumericOperators.FromNotEqual, valueA, NumericOperators.ToNotEqual, valueB, guid);
773
+ export function measureBetweenNotEqual(measure, valueA, valueB, config) {
774
+ return measureBase(measure.attribute, measure, NumericOperators.FromNotEqual, valueA, NumericOperators.ToNotEqual, valueB, config);
777
775
  }
778
776
  // RANKING FILTERS
779
777
  /**
@@ -791,11 +789,11 @@ export function measureBetweenNotEqual(measure, valueA, valueB, guid) {
791
789
  * @param attribute - Attribute to filter
792
790
  * @param measure - Measure to filter by
793
791
  * @param count - Number of members to return
794
- * @param guid - Optional GUID for the filter
792
+ * @param config - Optional configuration for the filter
795
793
  * @returns A filter instance
796
794
  */
797
- export function topRanking(attribute, measure, count, guid) {
798
- return new RankingFilter(attribute, measure, RankingOperators.Top, count, guid);
795
+ export function topRanking(attribute, measure, count, config) {
796
+ return new RankingFilter(attribute, measure, RankingOperators.Top, count, config);
799
797
  }
800
798
  /**
801
799
  * Creates a filter to isolate items that rank towards the bottom for a given measure.
@@ -812,11 +810,11 @@ export function topRanking(attribute, measure, count, guid) {
812
810
  * @param attribute - Attribute to filter
813
811
  * @param measure - Measure to filter by
814
812
  * @param count - Number of members to return
815
- * @param guid - Optional GUID for the filter
813
+ * @param config - Optional configuration for the filter
816
814
  * @returns A filter instance
817
815
  */
818
- export function bottomRanking(attribute, measure, count, guid) {
819
- return new RankingFilter(attribute, measure, RankingOperators.Bottom, count, guid);
816
+ export function bottomRanking(attribute, measure, count, config) {
817
+ return new RankingFilter(attribute, measure, RankingOperators.Bottom, count, config);
820
818
  }
821
819
  const relate = (node) => {
822
820
  if (Array.isArray(node)) {
@@ -912,11 +910,12 @@ export var logic;
912
910
  /**
913
911
  * Creates a filter from JAQL
914
912
  *
913
+ * @param attribute - Attribute to filter
915
914
  * @param jaql - Filter Jaql
916
- * @param guid - Optional GUID for the filter
915
+ * @param config - Optional configuration for the filter
917
916
  * @returns A filter instance
918
917
  * @internal
919
918
  */
920
- export function customFilter(attribute, jaql, guid) {
921
- return new CustomFilter(attribute, jaql, guid);
919
+ export function customFilter(attribute, jaql, config) {
920
+ return new CustomFilter(attribute, jaql, config);
922
921
  }
@@ -0,0 +1,25 @@
1
+ import { BaseFilterConfig, CompleteBaseFilterConfig, CompleteMembersFilterConfig, MembersFilterConfig } from '../interfaces.js';
2
+ /**
3
+ * Returns a default configuration for a base filter.
4
+ * @internal
5
+ */
6
+ export declare const getDefaultBaseFilterConfig: () => CompleteBaseFilterConfig;
7
+ /**
8
+ * Returns a default configuration for a members filter.
9
+ * @internal
10
+ */
11
+ export declare const getDefaultMembersFilterConfig: () => CompleteMembersFilterConfig;
12
+ /**
13
+ * Checks whether the given configuration is a members filter configuration.
14
+ * @param config - The filter configuration.
15
+ * @returns Whether the configuration is a members filter configuration.
16
+ * @internal
17
+ */
18
+ export declare function isMembersFilterConfig(config: BaseFilterConfig | MembersFilterConfig): config is MembersFilterConfig;
19
+ /**
20
+ * Simplifies the filter configuration by removing default values.
21
+ * @param config - The filter configuration.
22
+ * @returns The simplified filter configuration.
23
+ * @internal
24
+ */
25
+ export declare const simplifyFilterConfig: (config: BaseFilterConfig | MembersFilterConfig) => BaseFilterConfig | MembersFilterConfig;