@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.
- package/dist/cjs/dimensional-model/filter-relations.d.ts +9 -0
- package/dist/cjs/dimensional-model/filter-relations.js +18 -0
- package/dist/cjs/dimensional-model/filters/factory.d.ts +84 -85
- package/dist/cjs/dimensional-model/filters/factory.js +126 -127
- package/dist/cjs/dimensional-model/filters/filter-config-utils.d.ts +25 -0
- package/dist/cjs/dimensional-model/filters/filter-config-utils.js +49 -0
- package/dist/cjs/dimensional-model/filters/filters.d.ts +28 -51
- package/dist/cjs/dimensional-model/filters/filters.js +51 -95
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -4
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +35 -28
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +9 -5
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +32 -8
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +17 -27
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +37 -39
- package/dist/cjs/dimensional-model/interfaces.d.ts +113 -15
- package/dist/cjs/dimensional-model/types.d.ts +18 -11
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/interfaces.d.ts +8 -0
- package/dist/cjs/utils.d.ts +5 -3
- package/dist/cjs/utils.js +35 -9
- package/dist/dimensional-model/filter-relations.d.ts +9 -0
- package/dist/dimensional-model/filter-relations.js +14 -0
- package/dist/dimensional-model/filters/factory.d.ts +84 -85
- package/dist/dimensional-model/filters/factory.js +126 -127
- package/dist/dimensional-model/filters/filter-config-utils.d.ts +25 -0
- package/dist/dimensional-model/filters/filter-config-utils.js +39 -0
- package/dist/dimensional-model/filters/filters.d.ts +28 -51
- package/dist/dimensional-model/filters/filters.js +51 -95
- package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -4
- package/dist/dimensional-model/filters/utils/condition-filter-util.js +35 -28
- package/dist/dimensional-model/filters/utils/filter-code-util.d.ts +9 -5
- package/dist/dimensional-model/filters/utils/filter-code-util.js +32 -8
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +17 -27
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +36 -37
- package/dist/dimensional-model/interfaces.d.ts +113 -15
- package/dist/dimensional-model/types.d.ts +18 -11
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/interfaces.d.ts +8 -0
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -1
- package/dist/utils.d.ts +5 -3
- package/dist/utils.js +33 -7
- 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
|
|
342
|
+
* Base filter configuration
|
|
343
343
|
*/
|
|
344
|
-
export interface
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
452
|
+
isScope: boolean;
|
|
367
453
|
/**
|
|
368
|
-
*
|
|
454
|
+
* Filter config
|
|
369
455
|
*
|
|
370
456
|
* @internal
|
|
371
457
|
*/
|
|
372
|
-
|
|
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
|
-
*
|
|
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
|
|
214
|
+
export declare type BaseFilterJaql = IncludeAllFilterJaql | IncludeMembersFilterJaql | ExcludeMembersFilterJaql | NumericFilterJaql | ConditionFilterJaql | AndFilterJaql<NumericFilterJaql | ConditionFilterJaql> | OrFilterJaql<NumericFilterJaql | ConditionFilterJaql>;
|
|
215
215
|
/** @internal */
|
|
216
|
-
export declare type
|
|
216
|
+
export declare type BackgroundFilterJaql = BaseFilterJaql & {
|
|
217
217
|
level?: 'string';
|
|
218
218
|
};
|
|
219
219
|
/** @internal */
|
|
220
|
-
export declare type
|
|
220
|
+
export declare type IncludeAllFilterJaql = {
|
|
221
221
|
all: true;
|
|
222
222
|
};
|
|
223
223
|
/** @internal */
|
|
224
|
-
export declare type
|
|
224
|
+
export declare type IncludeMembersFilterJaql = {
|
|
225
225
|
members: string[];
|
|
226
226
|
multiSelection?: boolean;
|
|
227
227
|
};
|
|
228
228
|
/** @internal */
|
|
229
|
-
export declare type
|
|
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
|
|
236
|
+
export declare type TurnOffMembersFilterJaql = ExcludeMembersFilterJaql & {
|
|
237
237
|
turnedOff: boolean;
|
|
238
238
|
};
|
|
239
239
|
/** @internal */
|
|
240
240
|
export declare type FilterJaql = BaseJaql & {
|
|
241
|
-
filter:
|
|
242
|
-
filter?:
|
|
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
|
|
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
|
|
260
|
+
declare type AndFilterJaql<FilterItem> = {
|
|
261
261
|
and: FilterItem[];
|
|
262
262
|
};
|
|
263
263
|
/** @internal */
|
|
264
|
-
export declare type
|
|
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
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -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/index.js
CHANGED
|
@@ -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/interfaces.d.ts
CHANGED
|
@@ -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
|
};
|