@sisense/sdk-data 1.11.0 → 1.13.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 (99) hide show
  1. package/dist/cjs/dimensional-model/analytics/factory.d.ts +47 -0
  2. package/dist/cjs/dimensional-model/analytics/factory.js +153 -0
  3. package/dist/cjs/dimensional-model/analytics/factory.test.d.ts +1 -0
  4. package/dist/cjs/dimensional-model/analytics/factory.test.js +99 -0
  5. package/dist/cjs/dimensional-model/attributes.d.ts +139 -0
  6. package/dist/cjs/dimensional-model/attributes.js +342 -0
  7. package/dist/cjs/dimensional-model/attributes.test.d.ts +1 -0
  8. package/dist/cjs/dimensional-model/attributes.test.js +154 -0
  9. package/dist/cjs/dimensional-model/base.d.ts +43 -0
  10. package/dist/cjs/dimensional-model/base.js +58 -0
  11. package/dist/cjs/dimensional-model/base.test.d.ts +1 -0
  12. package/dist/cjs/dimensional-model/base.test.js +17 -0
  13. package/dist/cjs/dimensional-model/data-model.d.ts +13 -0
  14. package/dist/cjs/dimensional-model/data-model.js +37 -0
  15. package/dist/cjs/dimensional-model/dimensions.d.ts +167 -0
  16. package/dist/cjs/dimensional-model/dimensions.js +307 -0
  17. package/dist/cjs/dimensional-model/dimensions.test.d.ts +1 -0
  18. package/dist/cjs/dimensional-model/dimensions.test.js +54 -0
  19. package/dist/cjs/dimensional-model/factory.d.ts +17 -0
  20. package/dist/cjs/dimensional-model/factory.js +54 -0
  21. package/dist/cjs/dimensional-model/filters/factory.d.ts +797 -0
  22. package/dist/cjs/dimensional-model/filters/factory.js +962 -0
  23. package/dist/cjs/dimensional-model/filters/factory.test.d.ts +1 -0
  24. package/dist/cjs/dimensional-model/filters/factory.test.js +366 -0
  25. package/dist/cjs/dimensional-model/filters/filters.d.ts +344 -0
  26. package/dist/cjs/dimensional-model/filters/filters.js +663 -0
  27. package/dist/cjs/dimensional-model/filters/filters.test.d.ts +1 -0
  28. package/dist/cjs/dimensional-model/filters/filters.test.js +225 -0
  29. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.d.ts +47 -0
  30. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +111 -0
  31. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +21 -0
  32. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +196 -0
  33. package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.d.ts +2 -0
  34. package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.js +12 -0
  35. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +13 -0
  36. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +58 -0
  37. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.d.ts +1 -0
  38. package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.js +32 -0
  39. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +82 -0
  40. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +215 -0
  41. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.d.ts +1 -0
  42. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.js +623 -0
  43. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.d.ts +5 -0
  44. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.js +174 -0
  45. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.d.ts +1 -0
  46. package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.js +236 -0
  47. package/dist/cjs/dimensional-model/filters/utils/filter-types-util.d.ts +17 -0
  48. package/dist/cjs/dimensional-model/filters/utils/filter-types-util.js +79 -0
  49. package/dist/cjs/dimensional-model/filters/utils/types.d.ts +206 -0
  50. package/dist/cjs/dimensional-model/filters/utils/types.js +99 -0
  51. package/dist/cjs/dimensional-model/interfaces.d.ts +512 -0
  52. package/dist/cjs/dimensional-model/interfaces.js +31 -0
  53. package/dist/cjs/dimensional-model/measures/factory.d.ts +920 -0
  54. package/dist/cjs/dimensional-model/measures/factory.js +1188 -0
  55. package/dist/cjs/dimensional-model/measures/factory.test.d.ts +1 -0
  56. package/dist/cjs/dimensional-model/measures/factory.test.js +481 -0
  57. package/dist/cjs/dimensional-model/measures/measures.d.ts +217 -0
  58. package/dist/cjs/dimensional-model/measures/measures.js +416 -0
  59. package/dist/cjs/dimensional-model/measures/measures.test.d.ts +1 -0
  60. package/dist/cjs/dimensional-model/measures/measures.test.js +79 -0
  61. package/dist/cjs/dimensional-model/simple-column-types.d.ts +39 -0
  62. package/dist/cjs/dimensional-model/simple-column-types.js +134 -0
  63. package/dist/cjs/dimensional-model/simple-column-types.test.d.ts +1 -0
  64. package/dist/cjs/dimensional-model/simple-column-types.test.js +85 -0
  65. package/dist/cjs/dimensional-model/types.d.ts +256 -0
  66. package/dist/cjs/dimensional-model/types.js +298 -0
  67. package/dist/cjs/dimensional-model/types.test.d.ts +1 -0
  68. package/dist/cjs/dimensional-model/types.test.js +33 -0
  69. package/dist/cjs/index.d.ts +93 -0
  70. package/dist/cjs/index.js +123 -0
  71. package/dist/cjs/interfaces.d.ts +367 -0
  72. package/dist/cjs/interfaces.js +21 -0
  73. package/dist/cjs/translation/initialize-i18n.d.ts +2 -0
  74. package/dist/cjs/translation/initialize-i18n.js +14 -0
  75. package/dist/cjs/translation/resources/en.d.ts +28 -0
  76. package/dist/cjs/translation/resources/en.js +30 -0
  77. package/dist/cjs/translation/resources/index.d.ts +53 -0
  78. package/dist/cjs/translation/resources/index.js +10 -0
  79. package/dist/cjs/translation/resources/uk.d.ts +5 -0
  80. package/dist/cjs/translation/resources/uk.js +30 -0
  81. package/dist/cjs/translation/translatable-error.d.ts +5 -0
  82. package/dist/cjs/translation/translatable-error.js +15 -0
  83. package/dist/cjs/utils.d.ts +37 -0
  84. package/dist/cjs/utils.js +105 -0
  85. package/dist/cjs/utils.test.d.ts +1 -0
  86. package/dist/cjs/utils.test.js +158 -0
  87. package/dist/dimensional-model/analytics/factory.js +6 -4
  88. package/dist/dimensional-model/filters/factory.d.ts +81 -42
  89. package/dist/dimensional-model/filters/factory.js +125 -87
  90. package/dist/dimensional-model/filters/filters.d.ts +58 -13
  91. package/dist/dimensional-model/filters/filters.js +117 -27
  92. package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -2
  93. package/dist/dimensional-model/filters/utils/condition-filter-util.js +30 -26
  94. package/dist/dimensional-model/filters/utils/filter-code-util.js +5 -1
  95. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +26 -11
  96. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +58 -27
  97. package/dist/dimensional-model/filters/utils/filter-types-util.js +3 -3
  98. package/dist/dimensional-model/filters/utils/types.d.ts +6 -0
  99. package/package.json +18 -9
@@ -0,0 +1,797 @@
1
+ import { DateDimension, LevelAttribute, Attribute, Measure, Filter, BaseMeasure, FilterRelationsNode, FilterRelations } from '../interfaces.js';
2
+ /**
3
+ * Creates a filter representing the union of multiple filters on the same attribute. The resulting
4
+ * union filter filters on items that match any of the given filters.
5
+ *
6
+ * To create 'or' filters using different attributes, use the {@link logic.and | `or()`} function.
7
+ *
8
+ * @example
9
+ * Filter for countries that start with the letter 'A' **or** end with the letter 'A'
10
+ * in the Sample ECommerce data model.
11
+ * ```ts
12
+ * filterFactory.union([
13
+ * filterFactory.startsWith(DM.Country.Country, 'A'),
14
+ * filterFactory.endsWith(DM.Country.Country, 'A'),
15
+ * ])
16
+ * ```
17
+ * @param filters - Filters to union. The filters must all be on the same attribute.
18
+ * @param guid - Optional GUID for the filter
19
+ * @returns A filter instance
20
+ */
21
+ export declare function union(filters: Filter[], guid?: string): Filter;
22
+ /**
23
+ * Creates a filter representing the intersection of multiple filters on the same attribute. The resulting
24
+ * intersection filter filters on items that match all of the given filters.
25
+ *
26
+ * To create 'and' filters using different attributes, use the {@link logic.and | `and()`} function.
27
+ *
28
+ * @example
29
+ * Filter for countries that start with the letter 'A' **and** end with the letter 'A'
30
+ * in the Sample ECommerce data model.
31
+ * ```ts
32
+ * filterFactory.intersection([
33
+ * filterFactory.startsWith(DM.Country.Country, 'A'),
34
+ * filterFactory.endsWith(DM.Country.Country, 'A'),
35
+ * ])
36
+ * ```
37
+ * @param filters - Filters to intersect. The filters must all be on the same attribute.
38
+ * @param guid - Optional GUID for the filter
39
+ * @returns A filter instance
40
+ */
41
+ export declare function intersection(filters: Filter[], guid?: string): Filter;
42
+ /**
43
+ * Creates a filter that excludes items matching the given filter
44
+ * from all items or from items matching the optional input filter.
45
+ *
46
+ * @example
47
+ * Filter for items where the country name does not contain the letter 'A'
48
+ * from the Sample ECommerce data model.
49
+ * ```ts
50
+ * filterFactory.exclude(filterFactory.contains(DM.Country.Country, 'A'))
51
+ * ```
52
+ *
53
+ * Filter for items where the country name starts with the letter 'B' but does not contain the letter 'A'
54
+ * from the Sample ECommerce data model. This filter will match countries like 'Belgium', but will not
55
+ * match countries like 'Bermuda'.
56
+ * ```ts
57
+ * filterFactory.exclude(
58
+ * filterFactory.contains(DM.Country.Country, 'A'),
59
+ * filterFactory.startsWith(DM.Country.Country, 'B')
60
+ * )
61
+ * ```
62
+ * @param filter - Filter to exclude
63
+ * @param input - Input filter to exclude from, on the same attribute. If not provided, the filter excludes from all items.
64
+ * @param guid - Optional GUID for the filter
65
+ * @returns A filter representing an exclusion of the given filter
66
+ * from all attribute members or from the optional input filter
67
+ */
68
+ export declare function exclude(filter: Filter, input?: Filter, guid?: string): Filter;
69
+ /**
70
+ * Creates a filter to isolate attribute values that do not contain a specified string.
71
+ *
72
+ * Matching is case insensitive.
73
+ *
74
+ * You can optionally use wildcard characters for pattern matching, as described in the
75
+ * {@link like | `like()`} function.
76
+ *
77
+ * @example
78
+ * Filter for categories in the Sample ECommerce data model where the category name doesn't contain
79
+ * 'digital'. This filter matches categories not like 'Digital Cameras' and 'MP3 & Digital Media Players'.
80
+ * ```ts
81
+ * filterFactory.contains(DM.Category.Category, 'digital')
82
+ * ```
83
+ * @param attribute - Text attribute to filter on
84
+ * @param value - Value to filter by
85
+ * @param guid - Optional GUID for the filter
86
+ * @returns A filter instance
87
+ */
88
+ export declare function doesntContain(attribute: Attribute, value: string, guid?: string): Filter;
89
+ /**
90
+ * Creates a filter to isolate attribute values that do not end with a specified string.
91
+ *
92
+ * Matching is case insensitive.
93
+ *
94
+ * You can optionally use wildcard characters for pattern matching, as described in the
95
+ * {@link like | `like()`} function.
96
+ *
97
+ * @example
98
+ * Filter for countries in the Sample ECommerce data model where the country name doesn't end with
99
+ * 'land'. This filter matches countries not like 'Iceland' and 'Ireland'.
100
+ * ```ts
101
+ * filterFactory.doesntEndWith(DM.Country.Country, 'land')
102
+ * ```
103
+ * @param attribute - Text attribute to filter on
104
+ * @param value - Value to filter by
105
+ * @param guid - Optional GUID for the filter
106
+ * @returns A filter instance
107
+ */
108
+ export declare function doesntEndWith(attribute: Attribute, value: string, guid?: string): Filter;
109
+ /**
110
+ * Creates a filter to isolate attribute values that do not start with a specified string.
111
+ *
112
+ * Matching is case insensitive.
113
+ *
114
+ * You can optionally use wildcard characters for pattern matching, as described in the
115
+ * {@link like | `like()`} function.
116
+ *
117
+ * @example
118
+ * Filter for countries in the Sample ECommerce data model where the country name doesn't start with
119
+ * 'United'. This filter matches countries not like 'United States' and 'United Kingdom'.
120
+ * ```ts
121
+ * filterFactory.doesntStartWith(DM.Country.Country, 'United')
122
+ * ```
123
+ * @param attribute - Text attribute to filter on
124
+ * @param value - Value to filter by
125
+ * @param guid - Optional GUID for the filter
126
+ * @returns A filter instance
127
+ */
128
+ export declare function doesntStartWith(attribute: Attribute, value: string, guid?: string): Filter;
129
+ /**
130
+ * Creates a filter to isolate attribute values that contain a specified string.
131
+ *
132
+ * Matching is case insensitive.
133
+ *
134
+ * You can optionally use wildcard characters for pattern matching, as described in the
135
+ * {@link like | `like()`} function.
136
+ *
137
+ * @example
138
+ * Filter for categories in the Sample ECommerce data model where the category name contains
139
+ * 'digital'. This filter matches categories like 'Digital Cameras' and 'MP3 & Digital Media Players'.
140
+ * ```ts
141
+ * filterFactory.contains(DM.Category.Category, 'digital')
142
+ * ```
143
+ * @param attribute - Text attribute to filter on
144
+ * @param value - Value to filter by
145
+ * @param guid - Optional GUID for the filter
146
+ * @returns A filter instance
147
+ */
148
+ export declare function contains(attribute: Attribute, value: string, guid?: string): Filter;
149
+ /**
150
+ * Creates a filter to isolate attribute values that end with a specified string.
151
+ *
152
+ * Matching is case insensitive.
153
+ *
154
+ * You can optionally use wildcard characters for pattern matching, as described in the
155
+ * {@link like | `like()`} function.
156
+ *
157
+ * @example
158
+ * Filter for countries in the Sample ECommerce data model where the country name ends with
159
+ * 'land'. This filter matches countries like 'Ireland' and 'Iceland'.
160
+ * ```ts
161
+ * filterFactory.endsWith(DM.Country.Country, 'land')
162
+ * ```
163
+ * @param attribute - Text attribute to filter on
164
+ * @param value - Value to filter by
165
+ * @param guid - Optional GUID for the filter
166
+ * @returns A filter instance
167
+ */
168
+ export declare function endsWith(attribute: Attribute, value: string, guid?: string): Filter;
169
+ /**
170
+ * Creates a filter to isolate attribute values that start with a specified string.
171
+ *
172
+ * Matching is case insensitive.
173
+ *
174
+ * You can optionally use wildcard characters for pattern matching, as described in the
175
+ * {@link like | `like()`} function.
176
+ *
177
+ * @example
178
+ * Filter for countries in the Sample ECommerce data model where the country name starts with
179
+ * 'United'. This filter matches countries like 'United States' and 'United Kingdom'.
180
+ * ```ts
181
+ * filterFactory.startsWith(DM.Country.Country, 'United')
182
+ * ```
183
+ * @param attribute - Text attribute to filter on
184
+ * @param value - Value to filter by
185
+ * @param guid - Optional GUID for the filter
186
+ * @returns A filter instance
187
+ */
188
+ export declare function startsWith(attribute: Attribute, value: string, guid?: string): Filter;
189
+ /**
190
+ * Creates a filter to isolate attribute values that match a specified string pattern.
191
+ *
192
+ * The pattern can include the following wildcard characters:
193
+ *
194
+ * + `_`: Matches a single character
195
+ * + `%`: Matches multiple characters
196
+ *
197
+ * To search for a literal underscore (`_`) or percent symbol (`%`), use the backslash (`\`) escape
198
+ * character.
199
+ *
200
+ * Matching is case insensitive.
201
+ *
202
+ * @example
203
+ * Filter for countries from the Sample ECommerce data model where the country name starts with an
204
+ * 'A' and ends with an 'a'. This filter matches countries like 'Argentina' and 'Australia'.
205
+ * ```ts
206
+ * filterFactory.like(DM.Country.Country, 'A%a')
207
+ * ```
208
+ * @param attribute - Text attribute to filter on
209
+ * @param value - Value to filter by
210
+ * @param guid - Optional GUID for the filter
211
+ * @returns A filter instance
212
+ */
213
+ export declare function like(attribute: Attribute, value: string, guid?: string): Filter;
214
+ /**
215
+ * Creates a filter to isolate attribute values that do not equal a specified string or number.
216
+ *
217
+ * When filtering against a string:
218
+ *
219
+ * + Matching is case insensitive.
220
+ * + You can optionally use wildcard characters for pattern matching, as described in the
221
+ * {@link like | `like()`} function.
222
+ *
223
+ * @example
224
+ * Filter for items not in new condition from the Sample ECommerce data model.
225
+ * ```ts
226
+ * filterFactory.doesntEqual(DM.Commerce.Condition, 'New')
227
+ * ```
228
+ * @param attribute - Text or numeric attribute to filter on
229
+ * @param value - Value to filter by
230
+ * @returns A filter instance
231
+ */
232
+ export declare function doesntEqual(attribute: Attribute, value: string | number, guid?: string): Filter;
233
+ /**
234
+ * Creates a filter to isolate attribute values that equal a specified string or number.
235
+ *
236
+ * When filtering against a string:
237
+ *
238
+ * + Matching is case insensitive.
239
+ * + You can optionally use wildcard characters for pattern matching, as described in the
240
+ * {@link like | `like()`} function.
241
+ *
242
+ * @example
243
+ * Filter for items in new condition from the Sample ECommerce data model.
244
+ * ```ts
245
+ * filterFactory.equals(DM.Commerce.Condition, 'New')
246
+ * ```
247
+ * @param attribute - Text or numeric attribute to filter on
248
+ * @param value - Value to filter by
249
+ * @param guid - Optional GUID for the filter
250
+ * @returns A filter instance
251
+ */
252
+ export declare function equals(attribute: Attribute, value: string | number, guid?: string): Filter;
253
+ /**
254
+ * Creates a filter to isolate attribute values strictly greater than a specified number.
255
+ *
256
+ * @example
257
+ * Filter for items where the cost is greater than 100 from the Sample ECommerce data model.
258
+ * ```ts
259
+ * filterFactory.greaterThan(DM.Commerce.Cost, 100)
260
+ * ```
261
+ * @param attribute - Numeric attribute to filter on
262
+ * @param value - Value to filter by
263
+ * @param guid - Optional GUID for the filter
264
+ * @returns A filter instance
265
+ */
266
+ export declare function greaterThan(attribute: Attribute, value: number, guid?: string): Filter;
267
+ /**
268
+ * Creates a filter to isolate attribute values greater than or equal to a specified number.
269
+ *
270
+ * @example
271
+ * Filter for items where the cost is greater than or equal to 100 from the Sample ECommerce data model.
272
+ * ```ts
273
+ * filterFactory.greaterThanOrEqual(DM.Commerce.Cost, 100)
274
+ * ```
275
+ * @param attribute - Numeric attribute to filter on
276
+ * @param value - Value to filter by
277
+ * @param guid - Optional GUID for the filter
278
+ * @returns A filter instance
279
+ */
280
+ export declare function greaterThanOrEqual(attribute: Attribute, value: number, guid?: string): Filter;
281
+ /**
282
+ * Creates a filter to isolate attribute values strictly less than a specified number.
283
+ *
284
+ * @example
285
+ * Filter for items where the cost is less than 100 from the Sample ECommerce data model.
286
+ * ```ts
287
+ * filterFactory.lessThan(DM.Commerce.Cost, 100)
288
+ * ```
289
+ * @param attribute - Numeric attribute to filter on
290
+ * @param value - Value to filter by
291
+ * @param guid - Optional GUID for the filter
292
+ * @returns A filter instance
293
+ */
294
+ export declare function lessThan(attribute: Attribute, value: number, guid?: string): Filter;
295
+ /**
296
+ * Creates a filter to isolate attribute values less than or equal to a specified number.
297
+ *
298
+ * @example
299
+ * Filter for items where the cost is less than or equal to 100 from the Sample ECommerce data model.
300
+ * ```ts
301
+ * filterFactory.lessThanOrEqual(DM.Commerce.Cost, 100)
302
+ * ```
303
+ * @param attribute - Numeric attribute to filter on
304
+ * @param value - Value to filter by
305
+ * @param guid - Optional GUID for the filter
306
+ * @returns A filter instance
307
+ */
308
+ export declare function lessThanOrEqual(attribute: Attribute, value: number, guid?: string): Filter;
309
+ /**
310
+ * Creates a filter to isolate attribute values within or exactly matching two specified numerical boundaries.
311
+ *
312
+ * @example
313
+ * Filter for items from the Sample ECommerce data model where the cost is greater than or equal to 100 and less than or equal to 200.
314
+ * ```ts
315
+ * filterFactory.between(DM.Commerce.Cost, 100, 200)
316
+ * ```
317
+ * @param attribute - Numeric attribute to filter on
318
+ * @param valueA - Value to filter from
319
+ * @param valueB - Value to filter to
320
+ * @param guid - Optional GUID for the filter
321
+ * @returns A filter instance
322
+ */
323
+ export declare function between(attribute: Attribute, valueA: number, valueB: number, guid?: string): Filter;
324
+ /**
325
+ * Creates a filter that isolates attribute values strictly within two specified numerical boundaries.
326
+ *
327
+ * @example
328
+ * Filter for items from the Sample ECommerce data model where the cost is greater than 100 and less than 200.
329
+ * ```ts
330
+ * filterFactory.betweenNotEqual(DM.Commerce.Cost, 100, 200)
331
+ * ```
332
+ * @param attribute - Numeric attribute to filter on
333
+ * @param valueA - Value to filter from
334
+ * @param valueB - Value to filter to
335
+ * @param guid - Optional GUID for the filter
336
+ * @returns A filter instance
337
+ */
338
+ export declare function betweenNotEqual(attribute: Attribute, valueA: number, valueB: number, guid?: string): Filter;
339
+ /**
340
+ * Creates a custom numeric filter that filters for given attribute values.
341
+ *
342
+ * @example
343
+ * Filter for items where the cost is greater than 100 and less than 200
344
+ * from the Sample ECommerce data model.
345
+ * ```ts
346
+ * filterFactory.numeric(
347
+ * DM.Commerce.Cost,
348
+ * NumericOperators.From,
349
+ * 100,
350
+ * NumericOperators.To,
351
+ * 200
352
+ * )
353
+ * ```
354
+ * @param attribute - Numeric attribute to filter
355
+ * @param operatorA - First operator
356
+ * @param valueA - First value
357
+ * @param operatorB - Second operator
358
+ * @param valueB - Second value
359
+ * @param guid - Optional GUID for the filter
360
+ * @returns A custom numeric filter of the given attribute
361
+ */
362
+ export declare function numeric(attribute: Attribute, operatorA?: string, valueA?: number, operatorB?: string, valueB?: number, guid?: string): Filter;
363
+ /**
364
+ * Creates a filter to isolate attribute values that match any of the specified strings.
365
+ *
366
+ * Matching is case sensitive.
367
+ *
368
+ * @example
369
+ * Filter for items where the condition is 'Used' or 'Refurbished'
370
+ * from the Sample ECommerce data model.
371
+ * ```ts
372
+ * filterFactory.members(DM.Commerce.Condition, ['Used', 'Refurbished'])
373
+ * ```
374
+ * @param attribute - Attribute to filter on
375
+ * @param members - Array of member values to filter by
376
+ * @param _deactivatedMembers - [internal] Array of deactivated member values
377
+ * @param guid - Optional GUID for the filter
378
+ * @returns A filter instance
379
+ */
380
+ export declare function members(attribute: Attribute, members: string[], _deactivatedMembers?: string[], guid?: string): Filter;
381
+ /**
382
+ * Creates a filter to isolate date values starting from and including the given date and level.
383
+ *
384
+ * @example
385
+ * Filter for items in the Sample ECommerce data model where the date is not before the year 2010.
386
+ * ```ts
387
+ * filterFactory.dateFrom(DM.Commerce.Date.Years, '2010-01')
388
+ * ```
389
+ * @param level - Date {@link LevelAttribute} to filter on
390
+ * @param from - Date or string representing the value to filter from
391
+ * @returns A filter instance
392
+ */
393
+ export declare function dateFrom(level: LevelAttribute, from: Date | string, guid?: string): Filter;
394
+ /**
395
+ * Creates a filter to isolate items up until and including the given date and level.
396
+ *
397
+ * @example
398
+ * Filter for items where the date is from the year 2010 or earlier in the Sample ECommerce data model.
399
+ * ```ts
400
+ * filterFactory.dateTo(DM.Commerce.Date.Years, '2010-01')
401
+ * ```
402
+ * @param level - Date {@link LevelAttribute} to filter on
403
+ * @param to - Date or string representing the last member to filter to
404
+ * @param guid - Optional GUID for the filter
405
+ * @returns A filter instance
406
+ */
407
+ export declare function dateTo(level: LevelAttribute, to: Date | string, guid?: string): Filter;
408
+ /**
409
+ * Creates a filter to isolate items between and including the given dates and level.
410
+ *
411
+ * @example
412
+ * Filter for items in the Sample ECommerce data model where the date is from the years 2009, 2010, or 2011.
413
+ * ```ts
414
+ * filterFactory.dateRange(DM.Commerce.Date.Years, '2009-01', '2011-01')
415
+ * ```
416
+ * @param level - Date {@link LevelAttribute} to filter on
417
+ * @param from - Date or string representing the start member to filter from
418
+ * @param to - Date or string representing the end member to filter to
419
+ * @param guid - Optional GUID for the filter
420
+ * @returns A filter instance
421
+ */
422
+ export declare function dateRange(level: LevelAttribute, from?: Date | string, to?: Date | string, guid?: string): Filter;
423
+ /**
424
+ * Creates a filter to isolate items with a date dimension value within a specified range after a
425
+ * given date and level.
426
+ *
427
+ * Although the `offset` can be used to set a beginning date prior to the `anchor`, the filter range always
428
+ * continues forward after the offset beginning date. So, using an `offset` of `-6` and a `count` of `18` when `level`
429
+ * is a month level creates a range that begins 6 month before the `anchor` date and extends to 12 months after
430
+ * the `anchor` date.
431
+ *
432
+ * @example
433
+ * Filter for items in the Sample ECommerce data model where the date is in 2011 or the first half of 2012.
434
+ * ```ts
435
+ * filterFactory.dateRelative(DM.Commerce.Date.Months, 0, 18, '2011-01'),
436
+ * ```
437
+ *
438
+ * Filter for items in the Sample ECommerce data model where the date is in the second half of 2010 or in 2011.
439
+ * ```ts
440
+ * filterFactory.dateRelative(DM.Commerce.Date.Months, -6, 18, '2011-01'),
441
+ * ```
442
+ *
443
+ * Filter for items in the Sample ECommerce data model where the date is in the past 6 months.
444
+ * ```ts
445
+ * filterFactory.dateRelative(DM.Commerce.Date.Months, -6, 6),
446
+ * ```
447
+ * @param level - Date {@link LevelAttribute} to filter on
448
+ * @param offset - Number of levels to skip from the given `anchor` or the default of the current day.
449
+ * Positive numbers skip forwards and negative numbers skip backwards (e.g. `-6` is 6 months backwards when `level` is a months level attribute)
450
+ * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
451
+ * @param anchor - Date to filter from, defaults to the current day
452
+ * @param guid - Optional GUID for the filter
453
+ * @returns A filter instance
454
+ */
455
+ export declare function dateRelative(level: LevelAttribute, offset: number, count: number, anchor?: Date | string, guid?: string): Filter;
456
+ /**
457
+ * Creates a filter to isolate items with a date dimension value within a specified range after a
458
+ * given date and level.
459
+ *
460
+ * @example
461
+ * Filter for items in the Sample ECommerce data model where the date is in 2011 or the first half of 2012.
462
+ * ```ts
463
+ * filterFactory.dateRelativeFrom(DM.Commerce.Date.Months, 0, 18, '2011-01'),
464
+ * ```
465
+ * @param level - Date {@link LevelAttribute} to filter on
466
+ * @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)
467
+ * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
468
+ * @param anchor - Date to filter from, defaults to the current day
469
+ * @param guid - Optional GUID for the filter
470
+ * @returns A filter instance
471
+ */
472
+ export declare function dateRelativeFrom(level: LevelAttribute, offset: number, count: number, anchor?: Date | string, guid?: string): Filter;
473
+ /**
474
+ * Creates a filter to isolate items with a date dimension value within a specified range before a
475
+ * given date and level.
476
+ *
477
+ * @example
478
+ * Filter for items in the Sample ECommerce data model where the date is in the first half of 2010 or in 2011.
479
+ * ```ts
480
+ * filterFactory.dateRelativeTo(DM.Commerce.Date.Months, 0, 18, '2011-12'),
481
+ * ```
482
+ * @param level - Date {@link LevelAttribute} to filter on
483
+ * @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)
484
+ * @param count - Number of levels to include in the filter (e.g. `6` is 6 months when `level` is a months level attribute)
485
+ * @param anchor - Date to filter to, defaults to the current day
486
+ * @param guid - Optional GUID for the filter
487
+ * @returns A filter instance
488
+ */
489
+ export declare function dateRelativeTo(level: LevelAttribute, offset: number, count: number, anchor?: Date | string, guid?: string): Filter;
490
+ /**
491
+ * Creates a filter to isolate items with a date dimension value in the current calendar year.
492
+ *
493
+ * @example
494
+ * Filter for items where the date is in the current calendar year in the Sample ECommerce data model.
495
+ * ```ts
496
+ * filterFactory.thisYear(DM.Commerce.Date)
497
+ * ```
498
+ * @param dimension - Date dimension to filter
499
+ * @param guid - Optional GUID for the filter
500
+ * @returns A filter instance
501
+ */
502
+ export declare function thisYear(dimension: DateDimension, guid?: string): Filter;
503
+ /**
504
+ * Creates a filter to isolate items with a date dimension value in the current calendar month.
505
+ *
506
+ * @example
507
+ * Filter for items where the date is in the current calendar month in the Sample ECommerce data model.
508
+ * ```ts
509
+ * filterFactory.thisMonth(DM.Commerce.Date)
510
+ * ```
511
+ * @param dimension - Date dimension to filter
512
+ * @param guid - Optional GUID for the filter
513
+ * @returns A filter instance
514
+ */
515
+ export declare function thisMonth(dimension: DateDimension, guid?: string): Filter;
516
+ /**
517
+ * Creates a filter to isolate items with a date dimension value in the current quarter.
518
+ *
519
+ * @example
520
+ * Filter for items where the date is in the current quarter in the Sample ECommerce data model.
521
+ * ```ts
522
+ * filterFactory.thisQuarter(DM.Commerce.Date)
523
+ * ```
524
+ * @param dimension - Date dimension to filter
525
+ * @param guid - Optional GUID for the filter
526
+ * @returns A filter instance
527
+ */
528
+ export declare function thisQuarter(dimension: DateDimension, guid?: string): Filter;
529
+ /**
530
+ * Creates a filter to isolate items with a date dimension value of the current date.
531
+ *
532
+ * @example
533
+ * Filter for items where the date is today in the Sample ECommerce data model.
534
+ * ```ts
535
+ * filterFactory.today(DM.Commerce.Date)
536
+ * ```
537
+ * @param dimension - date dimension to filter
538
+ * @param guid - Optional GUID for the filter
539
+ * @returns A filter instance
540
+ */
541
+ export declare function today(dimension: DateDimension, guid?: string): Filter;
542
+ /**
543
+ * Creates a filter on all measure values matching the provided criteria.
544
+ *
545
+ * @param attribute - Attribute to filter
546
+ * @param measure - Measure to filter by
547
+ * @param operatorA - Operator to apply on `valueA` ({@link NumericOperators})
548
+ * @param valueA - First value
549
+ * @param operatorB - Operator to apply on `valueB` ({@link NumericOperators})
550
+ * @param valueB - Second value
551
+ * @param guid - Optional GUID for the filter
552
+ * @returns A filter representing the provided logic
553
+ * @internal
554
+ */
555
+ export declare function measureBase(attribute: Attribute, measure: Measure, operatorA?: string, valueA?: number, operatorB?: string, valueB?: number, guid?: string): Filter;
556
+ /**
557
+ * Creates a filter to isolate a measure value equal to a given number.
558
+ *
559
+ * @example
560
+ * Filter for categories that have an average revenue equal 50 in the Sample ECommerce data model.
561
+ * ```ts
562
+ * filterFactory.measureEquals(
563
+ * measures.average(DM.Commerce.Revenue),
564
+ * 50
565
+ * )
566
+ * ```
567
+ * @param measure - Measure to filter by
568
+ * @param value - Value
569
+ * @param guid - Optional GUID for the filter
570
+ * @returns A filter instance
571
+ */
572
+ export declare function measureEquals(measure: BaseMeasure, value: number, guid?: string): Filter;
573
+ /**
574
+ * Creates a filter to isolate a measure value greater than to a given number.
575
+ *
576
+ * @example
577
+ * Filter for categories that have an average revenue greater than
578
+ * to 50 in the Sample ECommerce data model.
579
+ * ```ts
580
+ * filterFactory.measureGreaterThan(
581
+ * measures.average(DM.Commerce.Revenue),
582
+ * 50
583
+ * )
584
+ * ```
585
+ * @param measure - Measure to filter by
586
+ * @param value - Min value
587
+ * @param guid - Optional GUID for the filter
588
+ * @returns A filter instance
589
+ */
590
+ export declare function measureGreaterThan(measure: BaseMeasure, value: number, guid?: string): Filter;
591
+ /**
592
+ * Creates a filter to isolate a measure value greater than or equal to a given number.
593
+ *
594
+ * @example
595
+ * Filter for categories that have an average revenue greater than
596
+ * or equal to 50 in the Sample ECommerce data model.
597
+ * ```ts
598
+ * filterFactory.measureGreaterThanOrEqual(
599
+ * measures.average(DM.Commerce.Revenue),
600
+ * 50
601
+ * )
602
+ * ```
603
+ * @param measure - Measure to filter by
604
+ * @param value - Min value
605
+ * @param guid - Optional GUID for the filter
606
+ * @returns A filter instance
607
+ */
608
+ export declare function measureGreaterThanOrEqual(measure: BaseMeasure, value: number, guid?: string): Filter;
609
+ /**
610
+ * Creates a filter to isolate a measure value less than or equal to a given number.
611
+ *
612
+ * @example
613
+ * Filter for categories that have an average revenue less than
614
+ * or equal to 100 in the Sample ECommerce data model.
615
+ * ```ts
616
+ * filterFactory.measureLessThanOrEqual(
617
+ * measures.average(DM.Commerce.Revenue),
618
+ * 100
619
+ * )
620
+ * ```
621
+ * @param measure - Measure to filter by
622
+ * @param value - Max value
623
+ * @param guid - Optional GUID for the filter
624
+ * @returns A filter instance
625
+ */
626
+ export declare function measureLessThanOrEqual(measure: BaseMeasure, value: number, guid?: string): Filter;
627
+ /**
628
+ * Creates a filter to isolate a measure value less than a given number.
629
+ *
630
+ * @example
631
+ * Filter for categories that have an average revenue less than 100 in the Sample ECommerce data model.
632
+ * ```ts
633
+ * filterFactory.measureLessThan(
634
+ * measures.average(DM.Commerce.Revenue),
635
+ * 100
636
+ * )
637
+ * ```
638
+ * @param measure - Measure to filter by
639
+ * @param value - Value
640
+ * @param guid - Optional GUID for the filter
641
+ * @returns A filter instance
642
+ */
643
+ export declare function measureLessThan(measure: BaseMeasure, value: number, guid?: string): Filter;
644
+ /**
645
+ * Creates a filter to isolate a measure value between or equal to two given numbers.
646
+ *
647
+ * @example
648
+ * Filter for categories that have an average revenue greater than or equal to 50 and less than
649
+ * or equal to 100 in the Sample ECommerce data model.
650
+ * ```ts
651
+ * filterFactory.measureBetween(
652
+ * measures.average(DM.Commerce.Revenue),
653
+ * 50,
654
+ * 100
655
+ * )
656
+ * ```
657
+ * @param measure - Measure to filter by
658
+ * @param valueA - Min value
659
+ * @param valueB - Max value
660
+ * @param guid - Optional GUID for the filter
661
+ * @returns A filter instance
662
+ */
663
+ export declare function measureBetween(measure: BaseMeasure, valueA: number, valueB: number, guid?: string): Filter;
664
+ /**
665
+ * Creates a filter to isolate a measure value between but not equal to two given numbers.
666
+ *
667
+ * @example
668
+ * Filter for categories that have an average revenue greater than 50 and less than
669
+ * 100 in the Sample ECommerce data model.
670
+ * ```ts
671
+ * filterFactory.measureBetweenNotEqual(
672
+ * measures.average(DM.Commerce.Revenue),
673
+ * 50,
674
+ * 100
675
+ * )
676
+ * ```
677
+ * @param measure - Measure to filter by
678
+ * @param valueA - Min value
679
+ * @param valueB - Max value
680
+ * @param guid - Optional GUID for the filter
681
+ * @returns A filter instance
682
+ */
683
+ export declare function measureBetweenNotEqual(measure: BaseMeasure, valueA: number, valueB: number, guid?: string): Filter;
684
+ /**
685
+ * Creates a filter to isolate items that rank towards the top for a given measure.
686
+ *
687
+ * @example
688
+ * Filter for age ranges with the top 3 highest total revenue in the Sample ECommerce data model.
689
+ * ```ts
690
+ * filterFactory.topRanking(
691
+ * DM.Commerce.AgeRange,
692
+ * measures.sum(DM.Commerce.Revenue),
693
+ * 3
694
+ * )
695
+ * ```
696
+ * @param attribute - Attribute to filter
697
+ * @param measure - Measure to filter by
698
+ * @param count - Number of members to return
699
+ * @param guid - Optional GUID for the filter
700
+ * @returns A filter instance
701
+ */
702
+ export declare function topRanking(attribute: Attribute, measure: Measure, count: number, guid?: string): Filter;
703
+ /**
704
+ * Creates a filter to isolate items that rank towards the bottom for a given measure.
705
+ *
706
+ * @example
707
+ * Filter for age ranges with the bottom 3 lowest total revenue in the Sample ECommerce data model.
708
+ * ```ts
709
+ * filterFactory.bottomRanking(
710
+ * DM.Commerce.AgeRange,
711
+ * measures.sum(DM.Commerce.Revenue),
712
+ * 3
713
+ * )
714
+ * ```
715
+ * @param attribute - Attribute to filter
716
+ * @param measure - Measure to filter by
717
+ * @param count - Number of members to return
718
+ * @param guid - Optional GUID for the filter
719
+ * @returns A filter instance
720
+ */
721
+ export declare function bottomRanking(attribute: Attribute, measure: Measure, count: number, guid?: string): Filter;
722
+ /**
723
+ * Set of logic operators for filter relations construction
724
+ *
725
+ * These operators are still in beta.
726
+ *
727
+ * @example
728
+ * ```ts
729
+ * import { filters } from '@sisense/sdk-data';
730
+ *
731
+ * // define filters
732
+ * const revenueFilter = filterFactory.greaterThan(DM.Commerce.Revenue, 1000);
733
+ * const countryFilter = filterFactory.members(DM.Commerce.Country, ['USA', 'Canada']);
734
+ * const genderFilter = filterFactory.doesntContain(DM.Commerce.Gender, 'Unspecified');
735
+ * const costFilter = filterFactory.between(DM.Commerce.Cost, 1000, 2000);
736
+ *
737
+ * // create filter relations of two filters
738
+ * const orFilerRelations = filterFactory.logic.or(revenueFilter, countryFilter);
739
+ * // revenueFilter OR countryFilter
740
+ *
741
+ * // filter relations can have nested filter relations
742
+ * const mixedFilterRelations = filterFactory.logic.and(genderFilter, orFilerRelations);
743
+ * // genderFilter AND (revenueFilter OR countryFilter)
744
+ *
745
+ * // array, specified in filter relations, will be converted to an intersection of filters automatically
746
+ * const arrayFilterRelations = filterFactory.logic.or([genderFilter, costFilter], mixedFilterRelations);
747
+ * // (genderFilter AND costFilter) OR (genderFilter AND (revenueFilter OR countryFilter))
748
+ * ```
749
+ * @beta
750
+ */
751
+ export declare namespace logic {
752
+ /**
753
+ * Creates an 'AND' filter relations
754
+ *
755
+ * @example
756
+ * Create filter relations for items that have a revenue greater than 100 and are in new condition
757
+ * in the Sample ECommerce data model.
758
+ * ```ts
759
+ * const revenueFilter = filterFactory.greaterThan(DM.Commerce.Revenue, 100);
760
+ * const conditionFilter = filterFactory.equals(DM.Commerce.Condition, 'New');
761
+ *
762
+ * const andFilerRelation = filterFactory.logic.and(revenueFilter, conditionFilter);
763
+ * ```
764
+ * @param left First filter or filter relations
765
+ * @param right Second filter or filter relations
766
+ * @returns Filter relations
767
+ * @beta
768
+ */
769
+ const and: (left: FilterRelationsNode, right: FilterRelationsNode) => FilterRelations;
770
+ /**
771
+ * Creates an 'OR' filter relations
772
+ *
773
+ * @example
774
+ * Create filter relations for items that have a revenue greater than 100 or are in new condition
775
+ * in the Sample ECommerce data model.
776
+ * ```ts
777
+ * const revenueFilter = filterFactory.greaterThan(DM.Commerce.Revenue, 100);
778
+ * const conditionFilter = filterFactory.equals(DM.Commerce.Condition, 'New');
779
+ *
780
+ * const orFilerRelation = filterFactory.logic.or(revenueFilter, conditionFilter);
781
+ * ```
782
+ * @param left First filter or filter relations
783
+ * @param right Second filter or filter relations
784
+ * @returns Filter relations
785
+ * @beta
786
+ */
787
+ const or: (left: FilterRelationsNode, right: FilterRelationsNode) => FilterRelations;
788
+ }
789
+ /**
790
+ * Creates a filter from JAQL
791
+ *
792
+ * @param jaql - Filter Jaql
793
+ * @param guid - Optional GUID for the filter
794
+ * @returns A filter instance
795
+ * @internal
796
+ */
797
+ export declare function customFilter(attribute: Attribute, jaql: any, guid?: string): Filter;