@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
@@ -1,5 +1,5 @@
1
1
  import { DataSource } from '../interfaces.js';
2
- import { JaqlDataSource, Sort } from './types.js';
2
+ import { FilterJaql, JaqlDataSource, Sort } from './types.js';
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -339,15 +339,106 @@ export interface LevelAttribute extends Attribute {
339
339
  };
340
340
  }
341
341
  /**
342
- * Base interface for filter. See {@link filterFactory} for how to create filters.
342
+ * Base filter configuration
343
343
  */
344
- export interface Filter extends Element {
344
+ export interface BaseFilterConfig {
345
+ /**
346
+ * Optional filter identifier
347
+ *
348
+ * If not provided, a unique identifier will be generated.
349
+ *
350
+ * @category Base Configurations
351
+ */
352
+ readonly guid?: string;
353
+ /**
354
+ * Original filter JAQL
355
+ *
356
+ * @category Base Configurations
357
+ * @internal
358
+ */
359
+ originalFilterJaql?: FilterJaql;
360
+ /**
361
+ * Boolean flag whether the filter is disabled
362
+ *
363
+ * If not specified, the default value is `false`.
364
+ *
365
+ * @category Base Configurations
366
+ */
367
+ disabled?: boolean;
368
+ /**
369
+ * Boolean flag whether the filter is locked
370
+ *
371
+ * If not specified, the default value is `false`.
372
+ *
373
+ * @category Base Configurations
374
+ */
375
+ locked?: boolean;
376
+ }
377
+ /**
378
+ * Complete configuration for base filter
379
+ *
380
+ * All properties are required except for originalFilterJaql
381
+ *
382
+ * @internal
383
+ */
384
+ export declare type CompleteBaseFilterConfig = Required<Omit<BaseFilterConfig, 'originalFilterJaql'>> & {
385
+ originalFilterJaql?: FilterJaql;
386
+ };
387
+ /**
388
+ * Configurations for members filter
389
+ */
390
+ export interface MembersFilterConfig extends BaseFilterConfig {
391
+ /**
392
+ * Boolean flag whether selected members are excluded or included in the filter
393
+ *
394
+ * If not specified, the default value is false.
395
+ *
396
+ * @category Extended Configurations
397
+ */
398
+ excludeMembers?: boolean;
399
+ /**
400
+ * Boolean flag whether selection of multiple members is enabled
401
+ *
402
+ * If not specified, the default value is `true`.
403
+ *
404
+ * @category Extended Configurations
405
+ */
406
+ enableMultiSelection?: boolean;
345
407
  /**
346
- * Global filter identifier
408
+ * Optional list of members to be shown as deactivated in the `MemberFilterTile` component.
409
+ *
410
+ * This list should not contain members that are already included in the filter.
411
+ *
412
+ * @category Extended Configurations
347
413
  */
348
- readonly guid: string;
414
+ deactivatedMembers?: string[];
415
+ /**
416
+ * Optional filter to be applied in the background
417
+ */
418
+ backgroundFilter?: Filter;
419
+ }
420
+ /**
421
+ * Complete configuration for members filter
422
+ *
423
+ * All properties are required except for originalFilterJaql and backgroundFilter
424
+ *
425
+ * @internal
426
+ */
427
+ export declare type CompleteMembersFilterConfig = Required<Omit<MembersFilterConfig, 'originalFilterJaql' | 'backgroundFilter'>> & {
428
+ originalFilterJaql?: FilterJaql;
429
+ backgroundFilter?: Filter;
430
+ };
431
+ /**
432
+ * @internal
433
+ */
434
+ export declare type FilterConfig = CompleteBaseFilterConfig | CompleteMembersFilterConfig;
435
+ /**
436
+ * Base interface for filter. See {@link filterFactory} for how to create filters.
437
+ */
438
+ export interface Filter extends Element {
349
439
  /**
350
440
  * Attribute this filter instance is filtering
441
+ * @internal
351
442
  */
352
443
  readonly attribute: Attribute;
353
444
  /**
@@ -356,20 +447,15 @@ export interface Filter extends Element {
356
447
  readonly filterType: string;
357
448
  /**
358
449
  * Boolean flag whether the filter is a scope filter
359
- */
360
- isScope: boolean;
361
- /**
362
- * Boolean flag whether the filter is disabled
363
- *
364
450
  * @internal
365
451
  */
366
- disabled: boolean;
452
+ isScope: boolean;
367
453
  /**
368
- * Boolean flag whether the filter is locked
454
+ * Filter config
369
455
  *
370
456
  * @internal
371
457
  */
372
- locked: boolean;
458
+ config: FilterConfig;
373
459
  /**
374
460
  * Gets JAQL representing this Filter instance
375
461
  *
@@ -436,7 +522,7 @@ export declare type FilterRelationsNode = Filter | Filter[] | FilterRelations;
436
522
  *
437
523
  * @internal
438
524
  */
439
- export declare type FilterRelationsModelNode = FilterRelationsModelIdNode | FilterRelationsModelBracketNode | FilterRelationsModel;
525
+ export declare type FilterRelationsModelNode = FilterRelationsModelIdNode | FilterRelationsModelCascadeNode | FilterRelationsModelBracketNode | FilterRelationsModel;
440
526
  /**
441
527
  * A node or a subtree of a {@link FilterRelationsJaql} tree
442
528
  *
@@ -456,11 +542,12 @@ export interface FilterRelations {
456
542
  operator: 'AND' | 'OR';
457
543
  }
458
544
  /**
459
- * Incoming filter logical relations (AND/OR) when fetched from the instance
545
+ * Model of filter logical relations (AND/OR) from Fusion dashboard
460
546
  *
461
547
  * @internal
462
548
  */
463
549
  export interface FilterRelationsModel {
550
+ type: 'LogicalExpression';
464
551
  left: FilterRelationsModelNode;
465
552
  right: FilterRelationsModelNode;
466
553
  operator: 'AND' | 'OR';
@@ -489,6 +576,7 @@ export declare type FilterRelationsJaqlIdNode = {
489
576
  * @internal
490
577
  */
491
578
  export declare type FilterRelationsModelIdNode = {
579
+ type: 'Identifier';
492
580
  instanceId: string;
493
581
  };
494
582
  /**
@@ -497,8 +585,18 @@ export declare type FilterRelationsModelIdNode = {
497
585
  * @internal
498
586
  */
499
587
  export declare type FilterRelationsModelBracketNode = {
588
+ type: 'ParenthesizedLogicalExpression';
500
589
  value: FilterRelationsModelNode;
501
590
  };
591
+ /**
592
+ * A node of a {@link FilterRelationsModel} tree that represents a cascading filter
593
+ *
594
+ * @internal
595
+ */
596
+ export declare type FilterRelationsModelCascadeNode = {
597
+ type: 'CascadingIdentifier';
598
+ levels: FilterRelationsModelIdNode[];
599
+ };
502
600
  /** Sorting direction, either in Ascending order, Descending order, or None */
503
601
  export declare type SortDirection = 'sortAsc' | 'sortDesc' | 'sortNone';
504
602
  /**
@@ -211,40 +211,40 @@ export declare type FormulaJaql = {
211
211
  context?: Record<FormulaID, FormulaContext>;
212
212
  };
213
213
  /** @internal */
214
- export declare type BaseFilter = IncludeAllFilter | IncludeMembersFilter | ExcludeMembersFilter | JaqlNumericFilter | ConditionFilterJaql | AndFilter<JaqlNumericFilter | ConditionFilterJaql> | OrFilter<JaqlNumericFilter | ConditionFilterJaql>;
214
+ export declare type BaseFilterJaql = IncludeAllFilterJaql | IncludeMembersFilterJaql | ExcludeMembersFilterJaql | NumericFilterJaql | ConditionFilterJaql | AndFilterJaql<NumericFilterJaql | ConditionFilterJaql> | OrFilterJaql<NumericFilterJaql | ConditionFilterJaql>;
215
215
  /** @internal */
216
- export declare type BackgroundFilter = BaseFilter & {
216
+ export declare type BackgroundFilterJaql = BaseFilterJaql & {
217
217
  level?: 'string';
218
218
  };
219
219
  /** @internal */
220
- export declare type IncludeAllFilter = {
220
+ export declare type IncludeAllFilterJaql = {
221
221
  all: true;
222
222
  };
223
223
  /** @internal */
224
- export declare type IncludeMembersFilter = {
224
+ export declare type IncludeMembersFilterJaql = {
225
225
  members: string[];
226
226
  multiSelection?: boolean;
227
227
  };
228
228
  /** @internal */
229
- export declare type ExcludeMembersFilter = {
229
+ export declare type ExcludeMembersFilterJaql = {
230
230
  exclude: {
231
231
  members: string[];
232
232
  };
233
233
  multiSelection?: boolean;
234
234
  };
235
235
  /** @internal */
236
- export declare type TurnOffMembersFilter = ExcludeMembersFilter & {
236
+ export declare type TurnOffMembersFilterJaql = ExcludeMembersFilterJaql & {
237
237
  turnedOff: boolean;
238
238
  };
239
239
  /** @internal */
240
240
  export declare type FilterJaql = BaseJaql & {
241
- filter: BaseFilter & {
242
- filter?: BackgroundFilter | TurnOffMembersFilter;
241
+ filter: BaseFilterJaql & {
242
+ filter?: BackgroundFilterJaql | TurnOffMembersFilterJaql;
243
243
  };
244
244
  };
245
245
  declare type NumericFilterValue = number | FormulaJaql;
246
246
  /** @internal */
247
- export declare type JaqlNumericFilter = {
247
+ export declare type NumericFilterJaql = {
248
248
  equals?: NumericFilterValue;
249
249
  doesntEqual?: NumericFilterValue;
250
250
  toNotEqual?: NumericFilterValue;
@@ -257,11 +257,11 @@ export declare type JaqlNumericFilter = {
257
257
  '>='?: NumericFilterValue;
258
258
  '<='?: NumericFilterValue;
259
259
  };
260
- declare type AndFilter<FilterItem> = {
260
+ declare type AndFilterJaql<FilterItem> = {
261
261
  and: FilterItem[];
262
262
  };
263
263
  /** @internal */
264
- export declare type OrFilter<FilterItem> = {
264
+ export declare type OrFilterJaql<FilterItem> = {
265
265
  or: FilterItem[];
266
266
  };
267
267
  /**
@@ -325,6 +325,7 @@ export declare type MetadataItem = {
325
325
  jaql: MetadataItemJaql;
326
326
  panel?: string;
327
327
  isScope?: boolean;
328
+ members?: string[];
328
329
  format?: {
329
330
  mask?: Partial<DatetimeMask> | Partial<NumericMask>;
330
331
  number?: string;
@@ -353,6 +354,12 @@ export declare type MetadataItem = {
353
354
  from?: string;
354
355
  to?: string;
355
356
  };
357
+ /**
358
+ * @internal
359
+ */
360
+ export declare type VagueMetadataItem = Omit<MetadataItem, 'json'> & {
361
+ json?: MetadataItem;
362
+ };
356
363
  /**
357
364
  * @internal
358
365
  */
@@ -16,6 +16,7 @@ export * from './dimensional-model/dimensions.js';
16
16
  export * from './dimensional-model/factory.js';
17
17
  export * from './dimensional-model/jaql-element.js';
18
18
  export * from './dimensional-model/filters/filters.js';
19
+ export * from './dimensional-model/filters/filter-config-utils.js';
19
20
  export { createFilterMatcher } from './dimensional-model/filters/utils/filter-matcher-utils.js';
20
21
  /**
21
22
  * Functions to create date, text, or numeric filters on specified data.
@@ -85,6 +86,7 @@ export * from './dimensional-model/measures/measures.js';
85
86
  */
86
87
  export * as measureFactory from './dimensional-model/measures/factory.js';
87
88
  export * from './dimensional-model/simple-column-types.js';
89
+ export * from './dimensional-model/filter-relations.js';
88
90
  /**
89
91
  * Functions to create elements for advanced analytics – for example, attributes and measures for constructing a custom Boxplot chart
90
92
  *
package/dist/cjs/index.js CHANGED
@@ -45,6 +45,7 @@ __exportStar(require("./dimensional-model/dimensions.js"), exports);
45
45
  __exportStar(require("./dimensional-model/factory.js"), exports);
46
46
  __exportStar(require("./dimensional-model/jaql-element.js"), exports);
47
47
  __exportStar(require("./dimensional-model/filters/filters.js"), exports);
48
+ __exportStar(require("./dimensional-model/filters/filter-config-utils.js"), exports);
48
49
  var filter_matcher_utils_js_1 = require("./dimensional-model/filters/utils/filter-matcher-utils.js");
49
50
  Object.defineProperty(exports, "createFilterMatcher", { enumerable: true, get: function () { return filter_matcher_utils_js_1.createFilterMatcher; } });
50
51
  /**
@@ -115,6 +116,7 @@ __exportStar(require("./dimensional-model/measures/measures.js"), exports);
115
116
  */
116
117
  exports.measureFactory = __importStar(require("./dimensional-model/measures/factory.js"));
117
118
  __exportStar(require("./dimensional-model/simple-column-types.js"), exports);
119
+ __exportStar(require("./dimensional-model/filter-relations.js"), exports);
118
120
  /**
119
121
  * Functions to create elements for advanced analytics – for example, attributes and measures for constructing a custom Boxplot chart
120
122
  *
@@ -132,6 +132,14 @@ export interface CalculatedMeasureColumn {
132
132
  * Info of data source
133
133
  */
134
134
  export declare type DataSourceInfo = {
135
+ /**
136
+ * @internal
137
+ **/
138
+ id?: string;
139
+ /**
140
+ * @internal
141
+ **/
142
+ address?: string;
135
143
  title: string;
136
144
  type: 'live' | 'elasticube';
137
145
  };
@@ -13,7 +13,7 @@ export declare const guidFast: (len?: number) => string;
13
13
  *
14
14
  * @internal
15
15
  */
16
- export declare const getFilterListAndRelations: (filterRelations: FilterRelations | Filter[] | undefined) => {
16
+ export declare const getFilterListAndRelationsJaql: (filterRelations: FilterRelations | Filter[] | undefined) => {
17
17
  filters: Filter[] | undefined;
18
18
  relations: FilterRelationsJaql | undefined;
19
19
  };
@@ -53,11 +53,13 @@ export declare function convertSort(sort?: string): Sort;
53
53
  * Creates a filter from a JAQL object.
54
54
  *
55
55
  * @param jaql - The filter JAQL object.
56
- * @param instanceid - The instance ID.
56
+ * @param instanceid - Optional instance ID.
57
+ * @param disabled - Optional disabled flag.
58
+ * @param locked - Optional locked flag.
57
59
  * @returns - The created Filter object.
58
60
  * @internal
59
61
  */
60
- export declare const createFilterFromJaql: (jaql: FilterJaql, instanceid?: string) => Filter;
62
+ export declare const createFilterFromJaql: (jaql: FilterJaql, instanceid?: string, disabled?: boolean, locked?: boolean) => Filter;
61
63
  /**
62
64
  * Retrieves the table value from the attribute.
63
65
  *
package/dist/cjs/utils.js CHANGED
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getSortType = exports.getColumnNameFromAttribute = exports.getTableNameFromAttribute = exports.createFilterFromJaql = exports.convertSort = exports.convertJaqlDataSource = exports.convertDataSource = exports.isDataSourceInfo = exports.getDataSourceName = exports.getFilterListAndRelations = exports.guidFast = void 0;
6
+ exports.getSortType = exports.getColumnNameFromAttribute = exports.getTableNameFromAttribute = exports.createFilterFromJaql = exports.convertSort = exports.convertJaqlDataSource = exports.convertDataSource = exports.isDataSourceInfo = exports.getDataSourceName = exports.getFilterListAndRelationsJaql = exports.guidFast = void 0;
7
7
  const cloneDeep_js_1 = __importDefault(require("lodash-es/cloneDeep.js"));
8
+ const index_js_1 = require("./index.js");
8
9
  const filter_from_jaql_util_js_1 = require("./dimensional-model/filters/utils/filter-from-jaql-util.js");
9
10
  const types_js_1 = require("./dimensional-model/types.js");
10
11
  /**
@@ -40,7 +41,7 @@ exports.guidFast = guidFast;
40
41
  *
41
42
  * @internal
42
43
  */
43
- const getFilterListAndRelations = (filterRelations) => {
44
+ const getFilterListAndRelationsJaql = (filterRelations) => {
44
45
  if (!filterRelations) {
45
46
  return { filters: undefined, relations: undefined };
46
47
  }
@@ -48,12 +49,25 @@ const getFilterListAndRelations = (filterRelations) => {
48
49
  return { filters: filterRelations, relations: undefined };
49
50
  }
50
51
  const filters = new Set();
52
+ function traverseCascade(cascade) {
53
+ const [firstFilter, ...restFilters] = cascade;
54
+ filters.add(firstFilter);
55
+ if (!restFilters.length) {
56
+ return traverse({ instanceid: firstFilter.config.guid });
57
+ }
58
+ const left = traverse(firstFilter);
59
+ const right = traverseCascade(restFilters);
60
+ return { left, right, operator: 'AND' };
61
+ }
51
62
  function traverse(node) {
52
63
  if (!node)
53
64
  return node;
54
- if ('guid' in node) {
65
+ if (isFilter(node)) {
66
+ if ((0, index_js_1.isCascadingFilter)(node)) {
67
+ return traverseCascade(node.filters);
68
+ }
55
69
  filters.add(node);
56
- return { instanceid: node.guid };
70
+ return { instanceid: node.config.guid };
57
71
  }
58
72
  else {
59
73
  if ('left' in node) {
@@ -70,7 +84,10 @@ const getFilterListAndRelations = (filterRelations) => {
70
84
  const relations = traverse(copiedFilterRelations);
71
85
  return { filters: Array.from(filters), relations };
72
86
  };
73
- exports.getFilterListAndRelations = getFilterListAndRelations;
87
+ exports.getFilterListAndRelationsJaql = getFilterListAndRelationsJaql;
88
+ function isFilter(node) {
89
+ return 'config' in node && 'guid' in node.config;
90
+ }
74
91
  /**
75
92
  * Gets the name of the data source
76
93
  *
@@ -96,6 +113,8 @@ exports.isDataSourceInfo = isDataSourceInfo;
96
113
  */
97
114
  function convertDataSource(jaqlDataSource) {
98
115
  return {
116
+ id: jaqlDataSource.id,
117
+ address: jaqlDataSource.address,
99
118
  title: jaqlDataSource.title,
100
119
  type: jaqlDataSource.live ? 'live' : 'elasticube',
101
120
  };
@@ -138,18 +157,25 @@ exports.convertSort = convertSort;
138
157
  * Creates a filter from a JAQL object.
139
158
  *
140
159
  * @param jaql - The filter JAQL object.
141
- * @param instanceid - The instance ID.
160
+ * @param instanceid - Optional instance ID.
161
+ * @param disabled - Optional disabled flag.
162
+ * @param locked - Optional locked flag.
142
163
  * @returns - The created Filter object.
143
164
  * @internal
144
165
  */
145
- const createFilterFromJaql = (jaql, instanceid) => {
166
+ const createFilterFromJaql = (jaql, instanceid, disabled = false, locked = false) => {
146
167
  // translation logic is based on FilterJaqlInternal type (from internal modern-analytics-filters)
147
168
  // TODO reconcile FilterJaql and FilterJaqlInternal
148
169
  const hasBackgroundFilter = jaql.filter.filter && !('turnedOff' in jaql.filter.filter);
149
- const filter = (0, filter_from_jaql_util_js_1.createFilterFromJaqlInternal)(jaql, instanceid);
170
+ const guid = instanceid || (0, exports.guidFast)();
171
+ const filter = (0, filter_from_jaql_util_js_1.createFilterFromJaqlInternal)(jaql, guid);
150
172
  if (hasBackgroundFilter) {
151
- filter.backgroundFilter = (0, filter_from_jaql_util_js_1.createFilterFromJaqlInternal)(Object.assign(Object.assign({}, jaql), { filter: jaql.filter.filter }), `${instanceid}-bg`);
173
+ const backgroundFilter = (0, filter_from_jaql_util_js_1.createFilterFromJaqlInternal)(Object.assign(Object.assign({}, jaql), { filter: jaql.filter.filter }), `${instanceid}-bg`);
174
+ const config = filter.config;
175
+ filter.config = Object.assign(Object.assign({}, config), { backgroundFilter });
176
+ return filter;
152
177
  }
178
+ filter.config = Object.assign(Object.assign({}, filter.config), { originalFilterJaql: jaql, disabled, locked });
153
179
  return filter;
154
180
  };
155
181
  exports.createFilterFromJaql = createFilterFromJaql;
@@ -0,0 +1,9 @@
1
+ import { Filter, FilterRelations } from './interfaces.js';
2
+ /**
3
+ * Type guard for checking if the provided filters are FilterRelations.
4
+ *
5
+ * @param filters - The filters to check.
6
+ * @returns `true` if the filters are FilterRelations, `false` otherwise.
7
+ * @group Filter Utilities
8
+ */
9
+ export declare function isFilterRelations(filters: Filter[] | FilterRelations | undefined): filters is FilterRelations;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Type guard for checking if the provided filters are FilterRelations.
3
+ *
4
+ * @param filters - The filters to check.
5
+ * @returns `true` if the filters are FilterRelations, `false` otherwise.
6
+ * @group Filter Utilities
7
+ */
8
+ export function isFilterRelations(filters) {
9
+ return (!!filters &&
10
+ 'operator' in filters &&
11
+ (filters.operator === 'AND' || filters.operator === 'OR') &&
12
+ !!filters.right &&
13
+ !!filters.left);
14
+ }