@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.
- package/dist/cjs/dimensional-model/analytics/factory.d.ts +47 -0
- package/dist/cjs/dimensional-model/analytics/factory.js +153 -0
- package/dist/cjs/dimensional-model/analytics/factory.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/analytics/factory.test.js +99 -0
- package/dist/cjs/dimensional-model/attributes.d.ts +139 -0
- package/dist/cjs/dimensional-model/attributes.js +342 -0
- package/dist/cjs/dimensional-model/attributes.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/attributes.test.js +154 -0
- package/dist/cjs/dimensional-model/base.d.ts +43 -0
- package/dist/cjs/dimensional-model/base.js +58 -0
- package/dist/cjs/dimensional-model/base.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/base.test.js +17 -0
- package/dist/cjs/dimensional-model/data-model.d.ts +13 -0
- package/dist/cjs/dimensional-model/data-model.js +37 -0
- package/dist/cjs/dimensional-model/dimensions.d.ts +167 -0
- package/dist/cjs/dimensional-model/dimensions.js +307 -0
- package/dist/cjs/dimensional-model/dimensions.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/dimensions.test.js +54 -0
- package/dist/cjs/dimensional-model/factory.d.ts +17 -0
- package/dist/cjs/dimensional-model/factory.js +54 -0
- package/dist/cjs/dimensional-model/filters/factory.d.ts +797 -0
- package/dist/cjs/dimensional-model/filters/factory.js +962 -0
- package/dist/cjs/dimensional-model/filters/factory.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/filters/factory.test.js +366 -0
- package/dist/cjs/dimensional-model/filters/filters.d.ts +344 -0
- package/dist/cjs/dimensional-model/filters/filters.js +663 -0
- package/dist/cjs/dimensional-model/filters/filters.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/filters/filters.test.js +225 -0
- package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.d.ts +47 -0
- package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +111 -0
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +21 -0
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +196 -0
- package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.d.ts +2 -0
- package/dist/cjs/dimensional-model/filters/utils/date-time-filter-util.js +12 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +13 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +58 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.test.js +32 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +82 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +215 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.test.js +623 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.d.ts +5 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.js +174 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-matcher-utils.test.js +236 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-types-util.d.ts +17 -0
- package/dist/cjs/dimensional-model/filters/utils/filter-types-util.js +79 -0
- package/dist/cjs/dimensional-model/filters/utils/types.d.ts +206 -0
- package/dist/cjs/dimensional-model/filters/utils/types.js +99 -0
- package/dist/cjs/dimensional-model/interfaces.d.ts +512 -0
- package/dist/cjs/dimensional-model/interfaces.js +31 -0
- package/dist/cjs/dimensional-model/measures/factory.d.ts +920 -0
- package/dist/cjs/dimensional-model/measures/factory.js +1188 -0
- package/dist/cjs/dimensional-model/measures/factory.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/measures/factory.test.js +481 -0
- package/dist/cjs/dimensional-model/measures/measures.d.ts +217 -0
- package/dist/cjs/dimensional-model/measures/measures.js +416 -0
- package/dist/cjs/dimensional-model/measures/measures.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/measures/measures.test.js +79 -0
- package/dist/cjs/dimensional-model/simple-column-types.d.ts +39 -0
- package/dist/cjs/dimensional-model/simple-column-types.js +134 -0
- package/dist/cjs/dimensional-model/simple-column-types.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/simple-column-types.test.js +85 -0
- package/dist/cjs/dimensional-model/types.d.ts +256 -0
- package/dist/cjs/dimensional-model/types.js +298 -0
- package/dist/cjs/dimensional-model/types.test.d.ts +1 -0
- package/dist/cjs/dimensional-model/types.test.js +33 -0
- package/dist/cjs/index.d.ts +93 -0
- package/dist/cjs/index.js +123 -0
- package/dist/cjs/interfaces.d.ts +367 -0
- package/dist/cjs/interfaces.js +21 -0
- package/dist/cjs/translation/initialize-i18n.d.ts +2 -0
- package/dist/cjs/translation/initialize-i18n.js +14 -0
- package/dist/cjs/translation/resources/en.d.ts +28 -0
- package/dist/cjs/translation/resources/en.js +30 -0
- package/dist/cjs/translation/resources/index.d.ts +53 -0
- package/dist/cjs/translation/resources/index.js +10 -0
- package/dist/cjs/translation/resources/uk.d.ts +5 -0
- package/dist/cjs/translation/resources/uk.js +30 -0
- package/dist/cjs/translation/translatable-error.d.ts +5 -0
- package/dist/cjs/translation/translatable-error.js +15 -0
- package/dist/cjs/utils.d.ts +37 -0
- package/dist/cjs/utils.js +105 -0
- package/dist/cjs/utils.test.d.ts +1 -0
- package/dist/cjs/utils.test.js +158 -0
- package/dist/dimensional-model/analytics/factory.js +6 -4
- package/dist/dimensional-model/filters/factory.d.ts +81 -42
- package/dist/dimensional-model/filters/factory.js +125 -87
- package/dist/dimensional-model/filters/filters.d.ts +58 -13
- package/dist/dimensional-model/filters/filters.js +117 -27
- package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +4 -2
- package/dist/dimensional-model/filters/utils/condition-filter-util.js +30 -26
- package/dist/dimensional-model/filters/utils/filter-code-util.js +5 -1
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +26 -11
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +58 -27
- package/dist/dimensional-model/filters/utils/filter-types-util.js +3 -3
- package/dist/dimensional-model/filters/utils/types.d.ts +6 -0
- package/package.json +18 -9
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import type { MeasureContext } from './dimensional-model/interfaces.js';
|
|
2
|
+
/**
|
|
3
|
+
* Data cell, which is a storage unit in a {@link Data | user-provided data set}
|
|
4
|
+
* or {@link QueryResultData | query result data set}.
|
|
5
|
+
*/
|
|
6
|
+
export interface Cell {
|
|
7
|
+
/** Cell data value */
|
|
8
|
+
data: any;
|
|
9
|
+
/** Display text */
|
|
10
|
+
text?: string;
|
|
11
|
+
/** Boolean flag whether the data value should be blurred when visualized in a chart */
|
|
12
|
+
blur?: boolean;
|
|
13
|
+
/** Color associated with the data value when visualized in a chart */
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents a data-cell in a query result
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export interface DataCell {
|
|
22
|
+
/**
|
|
23
|
+
* Gets the cell's data in its native type {@link (number|string|Date|boolean)}
|
|
24
|
+
*/
|
|
25
|
+
data: any;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the string representation of the cell
|
|
28
|
+
*/
|
|
29
|
+
text: string;
|
|
30
|
+
/**
|
|
31
|
+
* Used to differentiate cell data that is highlighted/blurred by a filter.
|
|
32
|
+
*
|
|
33
|
+
* Means different things depending on if it is specified in the returned dataset.
|
|
34
|
+
*
|
|
35
|
+
* The absence of `selected` across all cells means that all data is highlighted.
|
|
36
|
+
* The presence of `selected` in at least one cell means that some cells are highlighted
|
|
37
|
+
* and some are blurred.
|
|
38
|
+
*/
|
|
39
|
+
selected?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Column (or field) in a data set.
|
|
43
|
+
* When associated with a dimensional model, a column is equivalent to an {@link Attribute}.
|
|
44
|
+
*/
|
|
45
|
+
export interface Column {
|
|
46
|
+
/**
|
|
47
|
+
* Identifier. Required when associated with a model
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
id?: string;
|
|
52
|
+
/** Column name */
|
|
53
|
+
name: string;
|
|
54
|
+
/** Column type */
|
|
55
|
+
type: string;
|
|
56
|
+
/**
|
|
57
|
+
* Column description
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
description?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Aggregate function applied to a {@link Column}.
|
|
65
|
+
* When associated with a dimensional model, a Measure Column is equivalent to a {@link Measure}.
|
|
66
|
+
*/
|
|
67
|
+
export interface MeasureColumn {
|
|
68
|
+
/**
|
|
69
|
+
* Identifier. Required when associated with a model.
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
id?: string;
|
|
74
|
+
/** Column name */
|
|
75
|
+
name: string;
|
|
76
|
+
/**
|
|
77
|
+
* Aggregate function -- for example, `sum`, `count`.
|
|
78
|
+
* If not specified, default value, `sum`, will be used.
|
|
79
|
+
*/
|
|
80
|
+
aggregation?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional title for the column after aggregation.
|
|
83
|
+
* If not specified, the column `name` will be used.
|
|
84
|
+
*/
|
|
85
|
+
title?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Aggregate function description
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
description?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Calculated Aggregate function applied to a {@link Column}(s).
|
|
95
|
+
* When associated with a dimensional model, a Calculated Measure Column is
|
|
96
|
+
* equivalent to a {@link CalculatedMeasure}.
|
|
97
|
+
*/
|
|
98
|
+
export interface CalculatedMeasureColumn {
|
|
99
|
+
/**
|
|
100
|
+
* Identifier. Required when associated with a model.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
id?: string;
|
|
105
|
+
/** Column name */
|
|
106
|
+
name: string;
|
|
107
|
+
/** Measure type */
|
|
108
|
+
type: string;
|
|
109
|
+
/** Measure context */
|
|
110
|
+
context: MeasureContext;
|
|
111
|
+
/** Expression representing the element in a {@link https://sisense.dev/guides/querying/useJaql/ | JAQL query}. */
|
|
112
|
+
expression: string;
|
|
113
|
+
/**
|
|
114
|
+
* Aggregate function description
|
|
115
|
+
*
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
description?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Optional title for the column after aggregation.
|
|
121
|
+
* If not specified, the column `name` will be used.
|
|
122
|
+
*/
|
|
123
|
+
title?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Info of data source
|
|
127
|
+
*/
|
|
128
|
+
export declare type DataSourceInfo = {
|
|
129
|
+
title: string;
|
|
130
|
+
type: 'live' | 'elasticube';
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Data source for queries to run against
|
|
134
|
+
*/
|
|
135
|
+
export declare type DataSource = string | DataSourceInfo;
|
|
136
|
+
/**
|
|
137
|
+
* Data set, which is made up of an array of {@link Column | columns}
|
|
138
|
+
* and a two-dimensional array of data {@link Cell | cells}.
|
|
139
|
+
*
|
|
140
|
+
* This structure can be used for user-provided data in {@link @sisense/sdk-ui!ChartProps | Chart components}.
|
|
141
|
+
*/
|
|
142
|
+
export interface Data {
|
|
143
|
+
/** Array of {@link Column | columns} */
|
|
144
|
+
columns: Column[];
|
|
145
|
+
/** Two-dimensional array of data cells, each of which is either a string, number, or type {@link Cell} */
|
|
146
|
+
rows: (string | number | Cell)[][];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Query result data set, which is made of an array of {@link Column | columns}
|
|
150
|
+
* and a two-dimensional array of data {@link Cell | cells}.
|
|
151
|
+
*/
|
|
152
|
+
export interface QueryResultData {
|
|
153
|
+
/** Array of {@link Column | columns} */
|
|
154
|
+
columns: Column[];
|
|
155
|
+
/** Two-dimensional array of data {@link Cell | cells} */
|
|
156
|
+
rows: Cell[][];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Tree node representing data in a pivot table
|
|
160
|
+
*/
|
|
161
|
+
export declare type TreeNode = {
|
|
162
|
+
/**
|
|
163
|
+
* Raw data
|
|
164
|
+
*/
|
|
165
|
+
value?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Raw data
|
|
168
|
+
*
|
|
169
|
+
* @internal
|
|
170
|
+
*/
|
|
171
|
+
content?: string;
|
|
172
|
+
/**
|
|
173
|
+
* Matched index for condition formatting
|
|
174
|
+
*
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
cf?: number;
|
|
178
|
+
/**
|
|
179
|
+
* List of children of this node
|
|
180
|
+
*/
|
|
181
|
+
children?: Array<TreeNode>;
|
|
182
|
+
/**
|
|
183
|
+
* Data list for rows nodes
|
|
184
|
+
*/
|
|
185
|
+
data?: Array<any>;
|
|
186
|
+
/**
|
|
187
|
+
* Index in data list for columns nodes
|
|
188
|
+
*/
|
|
189
|
+
index?: number;
|
|
190
|
+
/**
|
|
191
|
+
* Current node's index divergence
|
|
192
|
+
*
|
|
193
|
+
* @internal
|
|
194
|
+
*/
|
|
195
|
+
indexDivergence?: number;
|
|
196
|
+
/**
|
|
197
|
+
* Initial child count in raw data from server
|
|
198
|
+
*
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
size?: number;
|
|
202
|
+
/**
|
|
203
|
+
* Boolean flag if node is some part of real node
|
|
204
|
+
*
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
isPart?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Max number of children (measures) nodes to insert
|
|
210
|
+
*
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
213
|
+
maxChilds?: number;
|
|
214
|
+
/**
|
|
215
|
+
* Node deep level
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
level?: number;
|
|
220
|
+
/**
|
|
221
|
+
* Node min deep level, for columns nodes with values at the and
|
|
222
|
+
*
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
minLevel?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Internal cache, to make sure that node was already mapped
|
|
228
|
+
*
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
isMapped?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Internal cache, for child count
|
|
234
|
+
*
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
childCount?: number;
|
|
238
|
+
/**
|
|
239
|
+
* Internal cache, for child deep
|
|
240
|
+
*
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
childDeep?: number;
|
|
244
|
+
/**
|
|
245
|
+
* Internal data store
|
|
246
|
+
*
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
249
|
+
store?: {
|
|
250
|
+
[key: string]: any;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
/**
|
|
254
|
+
* Grid of tree nodes
|
|
255
|
+
*/
|
|
256
|
+
export declare type PivotGrid = Array<Array<TreeNode | string>>;
|
|
257
|
+
/**
|
|
258
|
+
* Pivot query result data set, which includes both a flat table of {@link QueryResultData} and grids of tree structures.
|
|
259
|
+
*/
|
|
260
|
+
export interface PivotQueryResultData {
|
|
261
|
+
/**
|
|
262
|
+
* Flat table structure
|
|
263
|
+
*
|
|
264
|
+
* @category Table
|
|
265
|
+
*/
|
|
266
|
+
table: QueryResultData;
|
|
267
|
+
/**
|
|
268
|
+
* Grids of tree structures
|
|
269
|
+
*
|
|
270
|
+
* @category Tree Structures
|
|
271
|
+
*/
|
|
272
|
+
grids?: {
|
|
273
|
+
corner: PivotGrid;
|
|
274
|
+
rows: PivotGrid;
|
|
275
|
+
columns: PivotGrid;
|
|
276
|
+
values: PivotGrid;
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Empty pivot query result data set
|
|
281
|
+
*
|
|
282
|
+
* @internal
|
|
283
|
+
*/
|
|
284
|
+
export declare const EMPTY_PIVOT_QUERY_RESULT_DATA: PivotQueryResultData;
|
|
285
|
+
/**
|
|
286
|
+
* Runs type guard check for DataSource.
|
|
287
|
+
*
|
|
288
|
+
* @param arg
|
|
289
|
+
* @internal
|
|
290
|
+
*/
|
|
291
|
+
export declare function isDataSource(arg: DataSource | Data | undefined): arg is DataSource;
|
|
292
|
+
/**
|
|
293
|
+
* Trend formula options.
|
|
294
|
+
*/
|
|
295
|
+
export declare type TrendFormulaOptions = {
|
|
296
|
+
/**
|
|
297
|
+
* Trend analysis model type to be used for the operation.
|
|
298
|
+
*
|
|
299
|
+
* @defaultValue "linear"
|
|
300
|
+
*/
|
|
301
|
+
modelType?: 'linear' | 'logarithmic' | 'advancedSmoothing' | 'localEstimates';
|
|
302
|
+
/**
|
|
303
|
+
* Boolean flag that enables the function to automatically identify and ignore
|
|
304
|
+
* anomalous values in the series. This can be particularly useful when you want
|
|
305
|
+
* to maintain the integrity of your analysis by avoiding potential outliers.
|
|
306
|
+
*
|
|
307
|
+
* @defaultValue false
|
|
308
|
+
*/
|
|
309
|
+
ignoreAnomalies?: boolean;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Forecast formula options.
|
|
313
|
+
*/
|
|
314
|
+
export declare type ForecastFormulaOptions = {
|
|
315
|
+
/**
|
|
316
|
+
* Number of data points to be predicted.
|
|
317
|
+
* The accepted value range is between 1-1,000
|
|
318
|
+
*
|
|
319
|
+
* @defaultValue 3
|
|
320
|
+
*/
|
|
321
|
+
forecastHorizon?: number;
|
|
322
|
+
/**
|
|
323
|
+
* Forecasting model type. The 'auto' option automatically
|
|
324
|
+
* fits the best combination of models.
|
|
325
|
+
*
|
|
326
|
+
* @defaultValue "auto"
|
|
327
|
+
*/
|
|
328
|
+
modelType?: 'auto' | 'autoArima' | 'holtWinters' | 'prophet';
|
|
329
|
+
/**
|
|
330
|
+
* Start date of the time series data that the forecasting model will
|
|
331
|
+
* be trained on. This parameter can be used to discard the beginning of
|
|
332
|
+
* the series. Specify a ISO 8601 date string or Date object.
|
|
333
|
+
*/
|
|
334
|
+
startDate?: string | Date;
|
|
335
|
+
/**
|
|
336
|
+
* End date of the time series data that the forecasting model will be
|
|
337
|
+
* trained on. This parameter can be used to discard the end of the series.
|
|
338
|
+
* Specify a ISO 8601 date string or Date object.
|
|
339
|
+
*/
|
|
340
|
+
endDate?: string | Date;
|
|
341
|
+
/**
|
|
342
|
+
* Confidence interval showing the probabilistic upper and lower limits of the
|
|
343
|
+
* forecasted series according to the uncertainty level. The valid range is (0.8 <= X < 1).
|
|
344
|
+
*
|
|
345
|
+
* @defaultValue 0.8
|
|
346
|
+
*/
|
|
347
|
+
confidenceInterval?: number;
|
|
348
|
+
/**
|
|
349
|
+
* Expected lower limit to improve the forecast accuracy when reaching
|
|
350
|
+
* the limit. Note that values in the confidence interval can exceed
|
|
351
|
+
* this limit.
|
|
352
|
+
*/
|
|
353
|
+
lowerBound?: number;
|
|
354
|
+
/**
|
|
355
|
+
* Expected upper limit to improve the forecast accuracy when reaching
|
|
356
|
+
* the limit. Note that values in the confidence interval can exceed
|
|
357
|
+
* this limit.
|
|
358
|
+
*/
|
|
359
|
+
upperBound?: number;
|
|
360
|
+
/**
|
|
361
|
+
* Boolean flag to round the predicted result to an integer if set to true.
|
|
362
|
+
* Otherwise, the predicted result is left as a float
|
|
363
|
+
*
|
|
364
|
+
* @defaultValue false
|
|
365
|
+
*/
|
|
366
|
+
roundToInt?: boolean;
|
|
367
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isDataSource = exports.EMPTY_PIVOT_QUERY_RESULT_DATA = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Empty pivot query result data set
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
exports.EMPTY_PIVOT_QUERY_RESULT_DATA = {
|
|
10
|
+
table: { columns: [], rows: [] },
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Runs type guard check for DataSource.
|
|
14
|
+
*
|
|
15
|
+
* @param arg
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
function isDataSource(arg) {
|
|
19
|
+
return arg === undefined || typeof arg === 'string' || ('title' in arg && 'type' in arg);
|
|
20
|
+
}
|
|
21
|
+
exports.isDataSource = isDataSource;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18nextInstance = exports.initializeI18n = void 0;
|
|
4
|
+
const sdk_common_1 = require("@sisense/sdk-common");
|
|
5
|
+
const index_js_1 = require("./resources/index.js");
|
|
6
|
+
function initializeI18n() {
|
|
7
|
+
return (0, sdk_common_1.initI18next)({
|
|
8
|
+
resource: index_js_1.resources,
|
|
9
|
+
language: 'en',
|
|
10
|
+
namespace: index_js_1.PACKAGE_NAMESPACE,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
exports.initializeI18n = initializeI18n;
|
|
14
|
+
exports.i18nextInstance = initializeI18n().i18nextInstance;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translation dictionary for English language.
|
|
3
|
+
*/
|
|
4
|
+
export declare const translation: {
|
|
5
|
+
errors: {
|
|
6
|
+
measure: {
|
|
7
|
+
unsupportedType: string;
|
|
8
|
+
dimensionalCalculatedMeasure: {
|
|
9
|
+
noContext: string;
|
|
10
|
+
};
|
|
11
|
+
dimensionalBaseMeasure: {
|
|
12
|
+
noAttributeDimExpression: string;
|
|
13
|
+
noAggAggregation: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
dataModelConfig: {
|
|
17
|
+
noName: string;
|
|
18
|
+
noMetadata: string;
|
|
19
|
+
};
|
|
20
|
+
filter: {
|
|
21
|
+
unsupportedType: string;
|
|
22
|
+
unsupportedDatetimeLevel: string;
|
|
23
|
+
membersFilterNullMember: string;
|
|
24
|
+
};
|
|
25
|
+
unsupportedDimensionalElement: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare type TranslationDictionary = typeof translation;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translation = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Translation dictionary for English language.
|
|
6
|
+
*/
|
|
7
|
+
exports.translation = {
|
|
8
|
+
errors: {
|
|
9
|
+
measure: {
|
|
10
|
+
unsupportedType: 'Unsupported measure type',
|
|
11
|
+
dimensionalCalculatedMeasure: {
|
|
12
|
+
noContext: "DimensionalCalculatedMeasure must have 'context' property",
|
|
13
|
+
},
|
|
14
|
+
dimensionalBaseMeasure: {
|
|
15
|
+
noAttributeDimExpression: "DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",
|
|
16
|
+
noAggAggregation: "DimensionalBaseMeasure must have 'agg' or 'aggregation' property",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
dataModelConfig: {
|
|
20
|
+
noName: "'name' must be specified in config for DataModel",
|
|
21
|
+
noMetadata: "'metadata' must be specified in config for DataModel",
|
|
22
|
+
},
|
|
23
|
+
filter: {
|
|
24
|
+
unsupportedType: 'Unsupported filter type: {{filterType}}',
|
|
25
|
+
unsupportedDatetimeLevel: 'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15',
|
|
26
|
+
membersFilterNullMember: 'MembersFilter of {{attributeId}} - member cannot be null',
|
|
27
|
+
},
|
|
28
|
+
unsupportedDimensionalElement: 'Unsupported dimensional element type',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TranslationDictionary } from './en.js';
|
|
2
|
+
export type { TranslationDictionary };
|
|
3
|
+
export declare const PACKAGE_NAMESPACE: "sdkData";
|
|
4
|
+
export declare const resources: {
|
|
5
|
+
en: {
|
|
6
|
+
errors: {
|
|
7
|
+
measure: {
|
|
8
|
+
unsupportedType: string;
|
|
9
|
+
dimensionalCalculatedMeasure: {
|
|
10
|
+
noContext: string;
|
|
11
|
+
};
|
|
12
|
+
dimensionalBaseMeasure: {
|
|
13
|
+
noAttributeDimExpression: string;
|
|
14
|
+
noAggAggregation: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
dataModelConfig: {
|
|
18
|
+
noName: string;
|
|
19
|
+
noMetadata: string;
|
|
20
|
+
};
|
|
21
|
+
filter: {
|
|
22
|
+
unsupportedType: string;
|
|
23
|
+
unsupportedDatetimeLevel: string;
|
|
24
|
+
membersFilterNullMember: string;
|
|
25
|
+
};
|
|
26
|
+
unsupportedDimensionalElement: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
uk: {
|
|
30
|
+
errors: {
|
|
31
|
+
measure: {
|
|
32
|
+
unsupportedType: string;
|
|
33
|
+
dimensionalCalculatedMeasure: {
|
|
34
|
+
noContext: string;
|
|
35
|
+
};
|
|
36
|
+
dimensionalBaseMeasure: {
|
|
37
|
+
noAttributeDimExpression: string;
|
|
38
|
+
noAggAggregation: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
dataModelConfig: {
|
|
42
|
+
noName: string;
|
|
43
|
+
noMetadata: string;
|
|
44
|
+
};
|
|
45
|
+
filter: {
|
|
46
|
+
unsupportedType: string;
|
|
47
|
+
unsupportedDatetimeLevel: string;
|
|
48
|
+
membersFilterNullMember: string;
|
|
49
|
+
};
|
|
50
|
+
unsupportedDimensionalElement: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resources = exports.PACKAGE_NAMESPACE = void 0;
|
|
4
|
+
const en_js_1 = require("./en.js");
|
|
5
|
+
const uk_js_1 = require("./uk.js");
|
|
6
|
+
exports.PACKAGE_NAMESPACE = 'sdkData';
|
|
7
|
+
exports.resources = {
|
|
8
|
+
en: en_js_1.translation,
|
|
9
|
+
uk: uk_js_1.translation,
|
|
10
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.translation = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Translation dictionary for Ukrainian language.
|
|
6
|
+
*/
|
|
7
|
+
exports.translation = {
|
|
8
|
+
errors: {
|
|
9
|
+
measure: {
|
|
10
|
+
unsupportedType: 'Непідтримуваний тип measure',
|
|
11
|
+
dimensionalCalculatedMeasure: {
|
|
12
|
+
noContext: "DimensionalCalculatedMeasure має мати властивість 'context'",
|
|
13
|
+
},
|
|
14
|
+
dimensionalBaseMeasure: {
|
|
15
|
+
noAttributeDimExpression: "DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",
|
|
16
|
+
noAggAggregation: "DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
dataModelConfig: {
|
|
20
|
+
noName: "'name' має бути вказано в конфігурації для DataModel",
|
|
21
|
+
noMetadata: "'metadata' має бути вказано в конфігурації для DataModel",
|
|
22
|
+
},
|
|
23
|
+
filter: {
|
|
24
|
+
unsupportedType: 'Непідтримуваний тип фільтра: {{filterType}}',
|
|
25
|
+
unsupportedDatetimeLevel: 'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15',
|
|
26
|
+
membersFilterNullMember: 'MembersFilter у {{attributeId}} - member не може бути нульовим',
|
|
27
|
+
},
|
|
28
|
+
unsupportedDimensionalElement: 'Непідтримуваний тип елемента',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AbstractTranslatableError } from '@sisense/sdk-common';
|
|
2
|
+
import { PACKAGE_NAMESPACE } from './resources/index.js';
|
|
3
|
+
export declare class TranslatableError extends AbstractTranslatableError<typeof PACKAGE_NAMESPACE> {
|
|
4
|
+
constructor(translationKey: string, interpolationOptions?: Record<string, string>);
|
|
5
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TranslatableError = void 0;
|
|
4
|
+
const sdk_common_1 = require("@sisense/sdk-common");
|
|
5
|
+
const initialize_i18n_js_1 = require("./initialize-i18n.js");
|
|
6
|
+
const index_js_1 = require("./resources/index.js");
|
|
7
|
+
class TranslatableError extends sdk_common_1.AbstractTranslatableError {
|
|
8
|
+
constructor(translationKey, interpolationOptions) {
|
|
9
|
+
super(index_js_1.PACKAGE_NAMESPACE, {
|
|
10
|
+
key: translationKey,
|
|
11
|
+
interpolationOptions: interpolationOptions,
|
|
12
|
+
}, initialize_i18n_js_1.i18nextInstance.t);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.TranslatableError = TranslatableError;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Filter, FilterRelations, FilterRelationsJaql, DataSource, DataSourceInfo, FilterJaql } from './index.js';
|
|
2
|
+
/**
|
|
3
|
+
* A more performant, but slightly bulkier, RFC4122v4 implementation. Performance is improved by minimizing calls to random()
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const guidFast: (len?: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Function to separate list of filters from the provided relation and get logical relations for jaql
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare const getFilterListAndRelations: (filterRelations: FilterRelations | Filter[] | undefined) => {
|
|
14
|
+
filters: Filter[] | undefined;
|
|
15
|
+
relations: FilterRelationsJaql | undefined;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Gets the name of the data source
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
export declare function getDataSourceName(dataSource: DataSource): string;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the provided 'dataSource' is a data source info structure that contains more than just the data source name.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare function isDataSourceInfo(dataSource: DataSource): dataSource is DataSourceInfo;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a filter from a JAQL object.
|
|
31
|
+
*
|
|
32
|
+
* @param jaql - The filter JAQL object.
|
|
33
|
+
* @param instanceid - The instance ID.
|
|
34
|
+
* @returns - The created Filter object.
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
export declare const createFilterFromJaql: (jaql: FilterJaql, instanceid?: string) => Filter;
|