@sisense/sdk-data 1.33.0 → 2.0.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 +10 -10
- package/dist/cjs/dimensional-model/analytics/factory.js +15 -16
- package/dist/cjs/dimensional-model/attributes.d.ts +13 -6
- package/dist/cjs/dimensional-model/attributes.js +39 -12
- package/dist/cjs/dimensional-model/base.d.ts +3 -3
- package/dist/cjs/dimensional-model/base.js +7 -4
- package/dist/cjs/dimensional-model/compose-code-utils.d.ts +41 -0
- package/dist/cjs/dimensional-model/compose-code-utils.js +127 -0
- package/dist/cjs/dimensional-model/consts.d.ts +1 -0
- package/dist/cjs/dimensional-model/consts.js +4 -0
- package/dist/cjs/dimensional-model/data-model.d.ts +1 -1
- package/dist/cjs/dimensional-model/data-model.js +1 -1
- package/dist/cjs/dimensional-model/dimensions/dimensions.d.ts +6 -6
- package/dist/cjs/dimensional-model/dimensions/dimensions.js +34 -17
- package/dist/cjs/dimensional-model/dimensions/utils.d.ts +1 -0
- package/dist/cjs/dimensional-model/dimensions/utils.js +2 -1
- package/dist/cjs/dimensional-model/factory.js +5 -5
- package/dist/cjs/dimensional-model/filters/factory.d.ts +42 -42
- package/dist/cjs/dimensional-model/filters/factory.js +53 -168
- package/dist/cjs/dimensional-model/filters/filter-relations.d.ts +11 -2
- package/dist/cjs/dimensional-model/filters/filter-relations.js +14 -7
- package/dist/cjs/dimensional-model/filters/filters.d.ts +40 -24
- package/dist/cjs/dimensional-model/filters/filters.js +106 -56
- package/dist/cjs/dimensional-model/filters/helpers.d.ts +1 -1
- package/dist/cjs/dimensional-model/filters/helpers.js +2 -2
- package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +9 -17
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.d.ts +1 -1
- package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +31 -29
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +1 -1
- package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +13 -19
- package/dist/cjs/dimensional-model/filters/utils/filter-types-util.d.ts +1 -1
- package/dist/cjs/dimensional-model/filters/utils/filter-types-util.js +1 -1
- package/dist/cjs/dimensional-model/filters/utils/types.d.ts +10 -0
- package/dist/cjs/dimensional-model/interfaces.d.ts +17 -7
- package/dist/cjs/dimensional-model/jaql-element.d.ts +13 -1
- package/dist/cjs/dimensional-model/jaql-element.js +54 -2
- package/dist/cjs/dimensional-model/measures/factory.d.ts +46 -53
- package/dist/cjs/dimensional-model/measures/factory.js +57 -186
- package/dist/cjs/dimensional-model/measures/measures.d.ts +10 -10
- package/dist/cjs/dimensional-model/measures/measures.js +35 -33
- package/dist/cjs/dimensional-model/types.d.ts +41 -16
- package/dist/cjs/index.d.ts +7 -7
- package/dist/cjs/index.js +7 -7
- package/dist/cjs/utils.d.ts +45 -22
- package/dist/cjs/utils.js +119 -47
- package/dist/dimensional-model/analytics/factory.d.ts +10 -10
- package/dist/dimensional-model/analytics/factory.js +15 -14
- package/dist/dimensional-model/attributes.d.ts +13 -6
- package/dist/dimensional-model/attributes.js +39 -12
- package/dist/dimensional-model/base.d.ts +3 -3
- package/dist/dimensional-model/base.js +7 -4
- package/dist/dimensional-model/compose-code-utils.d.ts +41 -0
- package/dist/dimensional-model/compose-code-utils.js +119 -0
- package/dist/dimensional-model/consts.d.ts +1 -0
- package/dist/dimensional-model/consts.js +1 -0
- package/dist/dimensional-model/data-model.d.ts +1 -1
- package/dist/dimensional-model/data-model.js +1 -1
- package/dist/dimensional-model/dimensions/dimensions.d.ts +6 -6
- package/dist/dimensional-model/dimensions/dimensions.js +35 -18
- package/dist/dimensional-model/dimensions/utils.d.ts +1 -0
- package/dist/dimensional-model/dimensions/utils.js +3 -2
- package/dist/dimensional-model/factory.js +5 -5
- package/dist/dimensional-model/filters/factory.d.ts +42 -42
- package/dist/dimensional-model/filters/factory.js +52 -126
- package/dist/dimensional-model/filters/filter-relations.d.ts +11 -2
- package/dist/dimensional-model/filters/filter-relations.js +14 -7
- package/dist/dimensional-model/filters/filters.d.ts +40 -24
- package/dist/dimensional-model/filters/filters.js +106 -56
- package/dist/dimensional-model/filters/helpers.d.ts +1 -1
- package/dist/dimensional-model/filters/helpers.js +2 -2
- package/dist/dimensional-model/filters/utils/attribute-measure-util.js +10 -18
- package/dist/dimensional-model/filters/utils/condition-filter-util.d.ts +1 -1
- package/dist/dimensional-model/filters/utils/condition-filter-util.js +31 -29
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +1 -1
- package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +13 -19
- package/dist/dimensional-model/filters/utils/filter-types-util.d.ts +1 -1
- package/dist/dimensional-model/filters/utils/filter-types-util.js +1 -1
- package/dist/dimensional-model/filters/utils/types.d.ts +10 -0
- package/dist/dimensional-model/interfaces.d.ts +17 -7
- package/dist/dimensional-model/jaql-element.d.ts +13 -1
- package/dist/dimensional-model/jaql-element.js +52 -1
- package/dist/dimensional-model/measures/factory.d.ts +46 -53
- package/dist/dimensional-model/measures/factory.js +56 -143
- package/dist/dimensional-model/measures/measures.d.ts +10 -10
- package/dist/dimensional-model/measures/measures.js +35 -33
- package/dist/dimensional-model/types.d.ts +41 -16
- package/dist/index.d.ts +7 -7
- package/dist/index.js +7 -7
- package/dist/translation/initialize-i18n.js +1 -1
- package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -1
- package/dist/utils.d.ts +45 -22
- package/dist/utils.js +94 -49
- package/package.json +5 -4
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.d.ts +0 -17
- package/dist/cjs/dimensional-model/filters/utils/filter-code-util.js +0 -82
- package/dist/dimensional-model/filters/utils/filter-code-util.d.ts +0 -17
- package/dist/dimensional-model/filters/utils/filter-code-util.js +0 -77
|
@@ -31,23 +31,22 @@ exports.createMeasure = exports.DimensionalMeasureTemplate = exports.Dimensional
|
|
|
31
31
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
32
32
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
33
33
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
34
|
-
const
|
|
35
|
-
const types_js_1 = require("../types.js");
|
|
36
|
-
const base_js_1 = require("../base.js");
|
|
34
|
+
const translatable_error_js_1 = require("../../translation/translatable-error.js");
|
|
37
35
|
const attributes_js_1 = require("../attributes.js");
|
|
36
|
+
const base_js_1 = require("../base.js");
|
|
38
37
|
const factory_js_1 = require("../factory.js");
|
|
39
|
-
const
|
|
38
|
+
const types_js_1 = require("../types.js");
|
|
39
|
+
const m = __importStar(require("./factory.js"));
|
|
40
40
|
/**
|
|
41
41
|
* @internal
|
|
42
42
|
*/
|
|
43
43
|
class AbstractMeasure extends base_js_1.DimensionalElement {
|
|
44
|
-
constructor(name, type, format, desc, sort, composeCode) {
|
|
45
|
-
super(name, type, desc);
|
|
44
|
+
constructor(name, type, format, desc, sort, dataSource, composeCode) {
|
|
45
|
+
super(name, type, desc, dataSource, composeCode);
|
|
46
46
|
this._sort = types_js_1.Sort.None;
|
|
47
47
|
this._format = '#,#.00';
|
|
48
48
|
this._format = format;
|
|
49
49
|
this._sort = sort || types_js_1.Sort.None;
|
|
50
|
-
this.composeCode = composeCode;
|
|
51
50
|
}
|
|
52
51
|
/**
|
|
53
52
|
* Gets the sort definition of this instance
|
|
@@ -68,8 +67,8 @@ class AbstractMeasure extends base_js_1.DimensionalElement {
|
|
|
68
67
|
/**
|
|
69
68
|
* Gets a serializable representation of the element
|
|
70
69
|
*/
|
|
71
|
-
|
|
72
|
-
const result = super.
|
|
70
|
+
serialize() {
|
|
71
|
+
const result = super.serialize();
|
|
73
72
|
if (this.getFormat() !== undefined) {
|
|
74
73
|
result.format = this.getFormat();
|
|
75
74
|
}
|
|
@@ -86,8 +85,8 @@ exports.AbstractMeasure = AbstractMeasure;
|
|
|
86
85
|
* @internal
|
|
87
86
|
*/
|
|
88
87
|
class DimensionalBaseMeasure extends AbstractMeasure {
|
|
89
|
-
constructor(name, attribute, agg, format, desc, sort, composeCode) {
|
|
90
|
-
super(name, types_js_1.MetadataTypes.BaseMeasure, format, desc, sort, composeCode);
|
|
88
|
+
constructor(name, attribute, agg, format, desc, sort, dataSource, composeCode) {
|
|
89
|
+
super(name, types_js_1.MetadataTypes.BaseMeasure, format, desc, sort, dataSource, composeCode);
|
|
91
90
|
this.attribute = attribute;
|
|
92
91
|
this.aggregation = agg;
|
|
93
92
|
}
|
|
@@ -144,7 +143,7 @@ class DimensionalBaseMeasure extends AbstractMeasure {
|
|
|
144
143
|
* @returns An instance representing the sorted {@link Measure} of this instance
|
|
145
144
|
*/
|
|
146
145
|
sort(sort) {
|
|
147
|
-
return new DimensionalBaseMeasure(this.name, this.attribute, this.aggregation, this._format, this.description, sort, this.composeCode);
|
|
146
|
+
return new DimensionalBaseMeasure(this.name, this.attribute, this.aggregation, this._format, this.description, sort, this.dataSource, this.composeCode);
|
|
148
147
|
}
|
|
149
148
|
/**
|
|
150
149
|
* Gets a formatted {@link Measure} with the given definition
|
|
@@ -155,7 +154,7 @@ class DimensionalBaseMeasure extends AbstractMeasure {
|
|
|
155
154
|
* @returns An instance representing the formatted {@link Measure} of this instance
|
|
156
155
|
*/
|
|
157
156
|
format(format) {
|
|
158
|
-
return new DimensionalBaseMeasure(this.name, this.attribute, this.aggregation, format, this.description, this._sort, this.composeCode);
|
|
157
|
+
return new DimensionalBaseMeasure(this.name, this.attribute, this.aggregation, format, this.description, this._sort, this.dataSource, this.composeCode);
|
|
159
158
|
}
|
|
160
159
|
/**
|
|
161
160
|
* gets the element's ID
|
|
@@ -166,10 +165,11 @@ class DimensionalBaseMeasure extends AbstractMeasure {
|
|
|
166
165
|
/**
|
|
167
166
|
* Gets a serializable representation of the element
|
|
168
167
|
*/
|
|
169
|
-
|
|
170
|
-
const result = super.
|
|
168
|
+
serialize() {
|
|
169
|
+
const result = super.serialize();
|
|
170
|
+
result.__serializable = 'DimensionalBaseMeasure';
|
|
171
171
|
result.aggregation = this.aggregation;
|
|
172
|
-
result.attribute = this.attribute.
|
|
172
|
+
result.attribute = this.attribute.serialize();
|
|
173
173
|
return result;
|
|
174
174
|
}
|
|
175
175
|
jaql(nested) {
|
|
@@ -194,8 +194,8 @@ exports.DimensionalBaseMeasure = DimensionalBaseMeasure;
|
|
|
194
194
|
* @internal
|
|
195
195
|
*/
|
|
196
196
|
class DimensionalCalculatedMeasure extends AbstractMeasure {
|
|
197
|
-
constructor(name, expression, context, format, desc, sort, composeCode) {
|
|
198
|
-
super(name, types_js_1.MetadataTypes.CalculatedMeasure, format, desc, sort, composeCode);
|
|
197
|
+
constructor(name, expression, context, format, desc, sort, dataSource, composeCode) {
|
|
198
|
+
super(name, types_js_1.MetadataTypes.CalculatedMeasure, format, desc, sort, dataSource, composeCode);
|
|
199
199
|
this.expression = expression;
|
|
200
200
|
this.context = context;
|
|
201
201
|
}
|
|
@@ -206,7 +206,7 @@ class DimensionalCalculatedMeasure extends AbstractMeasure {
|
|
|
206
206
|
* @returns An instance representing the sorted {@link Measure} of this instance
|
|
207
207
|
*/
|
|
208
208
|
sort(sort) {
|
|
209
|
-
return new DimensionalCalculatedMeasure(this.name, this.expression, this.context, this._format, this.description, sort, this.composeCode);
|
|
209
|
+
return new DimensionalCalculatedMeasure(this.name, this.expression, this.context, this._format, this.description, sort, this.dataSource, this.composeCode);
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
212
|
* Gets a formatted {@link Measure} with the given definition
|
|
@@ -217,7 +217,7 @@ class DimensionalCalculatedMeasure extends AbstractMeasure {
|
|
|
217
217
|
* @returns An instance representing the formatted {@link Measure} of this instance
|
|
218
218
|
*/
|
|
219
219
|
format(format) {
|
|
220
|
-
return new DimensionalCalculatedMeasure(this.name, this.expression, this.context, format, this.description, this._sort, this.composeCode);
|
|
220
|
+
return new DimensionalCalculatedMeasure(this.name, this.expression, this.context, format, this.description, this._sort, this.dataSource, this.composeCode);
|
|
221
221
|
}
|
|
222
222
|
/**
|
|
223
223
|
* gets the element's ID
|
|
@@ -228,13 +228,14 @@ class DimensionalCalculatedMeasure extends AbstractMeasure {
|
|
|
228
228
|
/**
|
|
229
229
|
* Gets a serializable representation of the element
|
|
230
230
|
*/
|
|
231
|
-
|
|
232
|
-
const result = super.
|
|
231
|
+
serialize() {
|
|
232
|
+
const result = super.serialize();
|
|
233
|
+
result.__serializable = 'DimensionalCalculatedMeasure';
|
|
233
234
|
result.expression = this.expression;
|
|
234
|
-
result.context =
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
result.context = Object.fromEntries(Object.entries(this.context).map(([key, value]) => [
|
|
236
|
+
key,
|
|
237
|
+
value.serialize ? value.serialize(value) : value,
|
|
238
|
+
]));
|
|
238
239
|
return result;
|
|
239
240
|
}
|
|
240
241
|
jaql(nested) {
|
|
@@ -264,8 +265,8 @@ exports.DimensionalCalculatedMeasure = DimensionalCalculatedMeasure;
|
|
|
264
265
|
* @internal
|
|
265
266
|
*/
|
|
266
267
|
class DimensionalMeasureTemplate extends AbstractMeasure {
|
|
267
|
-
constructor(name, attribute, format, desc, sort) {
|
|
268
|
-
super(name, types_js_1.MetadataTypes.MeasureTemplate, format, desc, sort);
|
|
268
|
+
constructor(name, attribute, format, desc, sort, dataSource, composeCode) {
|
|
269
|
+
super(name, types_js_1.MetadataTypes.MeasureTemplate, format, desc, sort, dataSource, composeCode);
|
|
269
270
|
this.attribute = attribute;
|
|
270
271
|
}
|
|
271
272
|
/**
|
|
@@ -277,9 +278,10 @@ class DimensionalMeasureTemplate extends AbstractMeasure {
|
|
|
277
278
|
/**
|
|
278
279
|
* Gets a serializable representation of the element
|
|
279
280
|
*/
|
|
280
|
-
|
|
281
|
-
const result = super.
|
|
282
|
-
result.
|
|
281
|
+
serialize() {
|
|
282
|
+
const result = super.serialize();
|
|
283
|
+
result.__serializable = 'DimensionalMeasureTemplate';
|
|
284
|
+
result.attribute = this.attribute.serialize();
|
|
283
285
|
return result;
|
|
284
286
|
}
|
|
285
287
|
/**
|
|
@@ -289,7 +291,7 @@ class DimensionalMeasureTemplate extends AbstractMeasure {
|
|
|
289
291
|
* @returns An instance representing the sorted {@link MeasureTemplate} of this instance
|
|
290
292
|
*/
|
|
291
293
|
sort(sort) {
|
|
292
|
-
return new DimensionalMeasureTemplate(this.name, this.attribute, this._format, this.description, sort);
|
|
294
|
+
return new DimensionalMeasureTemplate(this.name, this.attribute, this._format, this.description, sort, this.dataSource, this.composeCode);
|
|
293
295
|
}
|
|
294
296
|
/**
|
|
295
297
|
* Gets a formatted {@link Measure} with the given definition
|
|
@@ -298,7 +300,7 @@ class DimensionalMeasureTemplate extends AbstractMeasure {
|
|
|
298
300
|
* @returns An instance representing the formatted {@link Measure} of this instance
|
|
299
301
|
*/
|
|
300
302
|
format(format) {
|
|
301
|
-
return new DimensionalMeasureTemplate(this.name, this.attribute, format, this.description, this._sort);
|
|
303
|
+
return new DimensionalMeasureTemplate(this.name, this.attribute, format, this.description, this._sort, this.dataSource, this.composeCode);
|
|
302
304
|
}
|
|
303
305
|
/**
|
|
304
306
|
* Gets the JAQL representation of this instance
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { JaqlDataSource,
|
|
1
|
+
import type { ConditionFilterJaql, JaqlDataSource, JaqlDataSourceForDto } from './filters/utils/types.js';
|
|
2
2
|
import { Attribute } from './interfaces.js';
|
|
3
3
|
/**
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
export type { JaqlDataSource };
|
|
6
|
+
export type { JaqlDataSource, JaqlDataSourceForDto };
|
|
7
7
|
/**
|
|
8
8
|
* Different aggregation types
|
|
9
9
|
*/
|
|
@@ -141,24 +141,26 @@ export declare const MetadataTypes: {
|
|
|
141
141
|
* Levels for {@link DateDimension}
|
|
142
142
|
*/
|
|
143
143
|
export declare const DateLevels: {
|
|
144
|
-
Years:
|
|
145
|
-
Quarters:
|
|
146
|
-
Months:
|
|
147
|
-
Weeks:
|
|
148
|
-
Days:
|
|
149
|
-
Hours:
|
|
150
|
-
MinutesRoundTo30:
|
|
151
|
-
MinutesRoundTo15:
|
|
152
|
-
Minutes:
|
|
153
|
-
Seconds:
|
|
154
|
-
AggHours:
|
|
155
|
-
AggMinutesRoundTo30:
|
|
156
|
-
AggMinutesRoundTo15:
|
|
157
|
-
AggMinutesRoundTo1:
|
|
144
|
+
readonly Years: "Years";
|
|
145
|
+
readonly Quarters: "Quarters";
|
|
146
|
+
readonly Months: "Months";
|
|
147
|
+
readonly Weeks: "Weeks";
|
|
148
|
+
readonly Days: "Days";
|
|
149
|
+
readonly Hours: "Hours";
|
|
150
|
+
readonly MinutesRoundTo30: "MinutesRoundTo30";
|
|
151
|
+
readonly MinutesRoundTo15: "MinutesRoundTo15";
|
|
152
|
+
readonly Minutes: "Minutes";
|
|
153
|
+
readonly Seconds: "Seconds";
|
|
154
|
+
readonly AggHours: "AggHours";
|
|
155
|
+
readonly AggMinutesRoundTo30: "AggMinutesRoundTo30";
|
|
156
|
+
readonly AggMinutesRoundTo15: "AggMinutesRoundTo15";
|
|
157
|
+
readonly AggMinutesRoundTo1: "AggMinutesRoundTo1";
|
|
158
158
|
/** @internal */
|
|
159
159
|
readonly all: string[];
|
|
160
160
|
};
|
|
161
161
|
/** @internal */
|
|
162
|
+
export declare type DateLevel = Exclude<(typeof DateLevels)[keyof typeof DateLevels], typeof DateLevels.all>;
|
|
163
|
+
/** @internal */
|
|
162
164
|
export declare enum DataType {
|
|
163
165
|
TEXT = "text",
|
|
164
166
|
NUMERIC = "numeric",
|
|
@@ -210,6 +212,7 @@ export declare type FormulaJaql = {
|
|
|
210
212
|
title: string;
|
|
211
213
|
formula: string;
|
|
212
214
|
context?: Record<FormulaID, FormulaContext>;
|
|
215
|
+
datasource?: JaqlDataSource;
|
|
213
216
|
};
|
|
214
217
|
/** @internal */
|
|
215
218
|
export declare type BaseFilterJaql = IncludeAllFilterJaql | IncludeMembersFilterJaql | ExcludeMembersFilterJaql | NumericFilterJaql | ConditionFilterJaql | AndFilterJaql<NumericFilterJaql | ConditionFilterJaql> | OrFilterJaql<NumericFilterJaql | ConditionFilterJaql>;
|
|
@@ -269,6 +272,27 @@ export declare type OrFilterJaql<FilterItem> = {
|
|
|
269
272
|
* Abstract object with any unknown values
|
|
270
273
|
*/
|
|
271
274
|
export declare type AnyObject = Record<string, any>;
|
|
275
|
+
/**
|
|
276
|
+
* JSON Value
|
|
277
|
+
*
|
|
278
|
+
* @internal
|
|
279
|
+
*/
|
|
280
|
+
export declare type JSONValue = string | number | boolean | undefined | null | JSONArray | JSONObject;
|
|
281
|
+
/**
|
|
282
|
+
* JSON Array
|
|
283
|
+
*
|
|
284
|
+
* @internal
|
|
285
|
+
*/
|
|
286
|
+
export interface JSONArray extends Array<JSONValue> {
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* JSON Object
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
export interface JSONObject {
|
|
294
|
+
[key: string]: JSONValue;
|
|
295
|
+
}
|
|
272
296
|
/**
|
|
273
297
|
* @internal
|
|
274
298
|
*/
|
|
@@ -393,6 +417,7 @@ export declare type MetadataItemJaql = {
|
|
|
393
417
|
sortingLastDimension?: boolean;
|
|
394
418
|
initialized?: boolean;
|
|
395
419
|
};
|
|
420
|
+
datasource?: JaqlDataSource;
|
|
396
421
|
};
|
|
397
422
|
/**
|
|
398
423
|
* @internal
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -6,18 +6,18 @@ import './translation/initialize-i18n.js';
|
|
|
6
6
|
* @group Data Model Utilities
|
|
7
7
|
* Utility functions for creating attributes and dimensions in code.
|
|
8
8
|
*/
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './dimensional-model/types.js';
|
|
11
|
-
export * from './dimensional-model/interfaces.js';
|
|
9
|
+
export * from './dimensional-model/attributes.js';
|
|
12
10
|
export * from './dimensional-model/base.js';
|
|
13
11
|
export * from './dimensional-model/data-model.js';
|
|
14
|
-
export * from './dimensional-model/attributes.js';
|
|
15
12
|
export * from './dimensional-model/dimensions/index.js';
|
|
16
13
|
export * from './dimensional-model/factory.js';
|
|
17
|
-
export * from './dimensional-model/jaql-element.js';
|
|
18
|
-
export * from './dimensional-model/filters/filters.js';
|
|
19
14
|
export * from './dimensional-model/filters/filter-config-utils.js';
|
|
15
|
+
export * from './dimensional-model/filters/filters.js';
|
|
20
16
|
export { createFilterMatcher } from './dimensional-model/filters/utils/filter-matcher-utils.js';
|
|
17
|
+
export * from './dimensional-model/interfaces.js';
|
|
18
|
+
export * from './dimensional-model/jaql-element.js';
|
|
19
|
+
export * from './dimensional-model/types.js';
|
|
20
|
+
export * from './interfaces.js';
|
|
21
21
|
/**
|
|
22
22
|
* Functions to create date, text, or numeric filters on specified data.
|
|
23
23
|
*
|
|
@@ -92,6 +92,6 @@ export * from './dimensional-model/simple-column-types.js';
|
|
|
92
92
|
* @group Factories
|
|
93
93
|
*/
|
|
94
94
|
export * as analyticsFactory from './dimensional-model/analytics/factory.js';
|
|
95
|
-
export * from './utils.js';
|
|
96
95
|
export * from './dimensional-model/filters/index.js';
|
|
97
96
|
export { type TranslationDictionary, PACKAGE_NAMESPACE as translationNamespace, } from './translation/resources/index.js';
|
|
97
|
+
export * from './utils.js';
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,19 +35,19 @@ require("./translation/initialize-i18n.js");
|
|
|
35
35
|
* @group Data Model Utilities
|
|
36
36
|
* Utility functions for creating attributes and dimensions in code.
|
|
37
37
|
*/
|
|
38
|
-
__exportStar(require("./
|
|
39
|
-
__exportStar(require("./dimensional-model/types.js"), exports);
|
|
40
|
-
__exportStar(require("./dimensional-model/interfaces.js"), exports);
|
|
38
|
+
__exportStar(require("./dimensional-model/attributes.js"), exports);
|
|
41
39
|
__exportStar(require("./dimensional-model/base.js"), exports);
|
|
42
40
|
__exportStar(require("./dimensional-model/data-model.js"), exports);
|
|
43
|
-
__exportStar(require("./dimensional-model/attributes.js"), exports);
|
|
44
41
|
__exportStar(require("./dimensional-model/dimensions/index.js"), exports);
|
|
45
42
|
__exportStar(require("./dimensional-model/factory.js"), exports);
|
|
46
|
-
__exportStar(require("./dimensional-model/jaql-element.js"), exports);
|
|
47
|
-
__exportStar(require("./dimensional-model/filters/filters.js"), exports);
|
|
48
43
|
__exportStar(require("./dimensional-model/filters/filter-config-utils.js"), exports);
|
|
44
|
+
__exportStar(require("./dimensional-model/filters/filters.js"), exports);
|
|
49
45
|
var filter_matcher_utils_js_1 = require("./dimensional-model/filters/utils/filter-matcher-utils.js");
|
|
50
46
|
Object.defineProperty(exports, "createFilterMatcher", { enumerable: true, get: function () { return filter_matcher_utils_js_1.createFilterMatcher; } });
|
|
47
|
+
__exportStar(require("./dimensional-model/interfaces.js"), exports);
|
|
48
|
+
__exportStar(require("./dimensional-model/jaql-element.js"), exports);
|
|
49
|
+
__exportStar(require("./dimensional-model/types.js"), exports);
|
|
50
|
+
__exportStar(require("./interfaces.js"), exports);
|
|
51
51
|
/**
|
|
52
52
|
* Functions to create date, text, or numeric filters on specified data.
|
|
53
53
|
*
|
|
@@ -122,7 +122,7 @@ __exportStar(require("./dimensional-model/simple-column-types.js"), exports);
|
|
|
122
122
|
* @group Factories
|
|
123
123
|
*/
|
|
124
124
|
exports.analyticsFactory = __importStar(require("./dimensional-model/analytics/factory.js"));
|
|
125
|
-
__exportStar(require("./utils.js"), exports);
|
|
126
125
|
__exportStar(require("./dimensional-model/filters/index.js"), exports);
|
|
127
126
|
var index_js_1 = require("./translation/resources/index.js");
|
|
128
127
|
Object.defineProperty(exports, "translationNamespace", { enumerable: true, get: function () { return index_js_1.PACKAGE_NAMESPACE; } });
|
|
128
|
+
__exportStar(require("./utils.js"), exports);
|
package/dist/cjs/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { JaqlDataSource } from './dimensional-model/filters/utils/types.js';
|
|
1
|
+
import { FilterJaqlInternal, JaqlDataSource, JaqlDataSourceForDto, RankingFilterJaql } from './dimensional-model/filters/utils/types.js';
|
|
2
2
|
import { Attribute, BaseMeasure, CalculatedMeasure, Filter, FilterRelations, FilterRelationsJaql, LevelAttribute, SortDirection } from './dimensional-model/interfaces.js';
|
|
3
|
+
import { BaseJaql, FilterJaql, FormulaJaql, Jaql, JaqlSortDirection, Sort } from './dimensional-model/types.js';
|
|
3
4
|
import { DataSource, DataSourceInfo } from './interfaces.js';
|
|
4
|
-
import { FilterJaql, FormulaJaql, Jaql, JaqlSortDirection, Sort } from './dimensional-model/types.js';
|
|
5
5
|
/**
|
|
6
6
|
* A more performant, but slightly bulkier, RFC4122v4 implementation. Performance is improved by minimizing calls to random()
|
|
7
7
|
*
|
|
@@ -41,6 +41,12 @@ export declare function convertDataSource(jaqlDataSource: JaqlDataSource): DataS
|
|
|
41
41
|
* @internal
|
|
42
42
|
*/
|
|
43
43
|
export declare function convertJaqlDataSource(dataSource: DataSource): JaqlDataSource;
|
|
44
|
+
/**
|
|
45
|
+
* Converts a DataSource to JaqlDataSourceForDto.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function convertJaqlDataSourceForDto(dataSource: DataSource): JaqlDataSourceForDto;
|
|
44
50
|
/**
|
|
45
51
|
* Converts a string to a Sort enum
|
|
46
52
|
*
|
|
@@ -49,6 +55,14 @@ export declare function convertJaqlDataSource(dataSource: DataSource): JaqlDataS
|
|
|
49
55
|
* @internal
|
|
50
56
|
*/
|
|
51
57
|
export declare function convertSort(sort?: string): Sort;
|
|
58
|
+
/**
|
|
59
|
+
* Converts a SortDirection to a Sort enum
|
|
60
|
+
*
|
|
61
|
+
* @param sortDirection - The SortDirection to convert
|
|
62
|
+
* @returns The converted Sort enum
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export declare function convertSortDirectionToSort(sortDirection: SortDirection): Sort;
|
|
52
66
|
/**
|
|
53
67
|
* Creates a filter from a JAQL object.
|
|
54
68
|
*
|
|
@@ -60,6 +74,15 @@ export declare function convertSort(sort?: string): Sort;
|
|
|
60
74
|
* @internal
|
|
61
75
|
*/
|
|
62
76
|
export declare const createFilterFromJaql: (jaql: FilterJaql, instanceid?: string, disabled?: boolean, locked?: boolean) => Filter;
|
|
77
|
+
/**
|
|
78
|
+
* Extracts the table and column names from the given expression string.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseExpression(expression: string): {
|
|
83
|
+
table: string;
|
|
84
|
+
column: string;
|
|
85
|
+
};
|
|
63
86
|
/**
|
|
64
87
|
* Retrieves the table value from the attribute.
|
|
65
88
|
*
|
|
@@ -86,21 +109,17 @@ export declare function getSortType(jaqlSort: `${JaqlSortDirection}` | undefined
|
|
|
86
109
|
* @returns attribute or level attribute
|
|
87
110
|
* @internal
|
|
88
111
|
*/
|
|
89
|
-
export declare const createAttributeHelper: ({
|
|
112
|
+
export declare const createAttributeHelper: ({ expression, dataType, granularity, format, sort, title, panel, dataSource, }: {
|
|
90
113
|
/** Dimension expression */
|
|
91
|
-
|
|
92
|
-
/** Table name */
|
|
93
|
-
table: string | undefined;
|
|
94
|
-
/** Column name */
|
|
95
|
-
column: string | undefined;
|
|
114
|
+
expression: string;
|
|
96
115
|
/** Data type */
|
|
97
116
|
dataType: string;
|
|
98
|
-
/** Date
|
|
99
|
-
|
|
117
|
+
/** Date granularity */
|
|
118
|
+
granularity?: string | undefined;
|
|
100
119
|
/** Format */
|
|
101
|
-
format
|
|
120
|
+
format?: string | undefined;
|
|
102
121
|
/** Sort */
|
|
103
|
-
sort
|
|
122
|
+
sort?: string | undefined;
|
|
104
123
|
/** Attribute title */
|
|
105
124
|
title?: string | undefined;
|
|
106
125
|
/** Panel */
|
|
@@ -114,23 +133,19 @@ export declare const createAttributeHelper: ({ dim, table, column, dataType, lev
|
|
|
114
133
|
* @returns measure
|
|
115
134
|
* @internal
|
|
116
135
|
*/
|
|
117
|
-
export declare const createMeasureHelper: ({
|
|
136
|
+
export declare const createMeasureHelper: ({ expression, dataType, agg, granularity, format, sort, title, dataSource, }: {
|
|
118
137
|
/** Dimension expression */
|
|
119
|
-
|
|
120
|
-
/** Table name */
|
|
121
|
-
table: string | undefined;
|
|
122
|
-
/** Column name */
|
|
123
|
-
column: string;
|
|
138
|
+
expression: string;
|
|
124
139
|
/** Data type */
|
|
125
140
|
dataType: string;
|
|
126
141
|
/** Aggregation function */
|
|
127
142
|
agg: string;
|
|
128
|
-
/** Date
|
|
129
|
-
|
|
143
|
+
/** Date granularity */
|
|
144
|
+
granularity?: string | undefined;
|
|
130
145
|
/** Format */
|
|
131
|
-
format
|
|
146
|
+
format?: string | undefined;
|
|
132
147
|
/** Sort */
|
|
133
|
-
sort
|
|
148
|
+
sort?: string | undefined;
|
|
134
149
|
/** Measure title */
|
|
135
150
|
title?: string | undefined;
|
|
136
151
|
/** Jaql data source */
|
|
@@ -152,3 +167,11 @@ export declare const createCalculatedMeasureHelper: (jaql: FormulaJaql) => Calcu
|
|
|
152
167
|
* @internal
|
|
153
168
|
*/
|
|
154
169
|
export declare function createDimensionalElementFromJaql(jaql: Jaql, datetimeFormat?: string, panel?: string): Attribute | BaseMeasure | CalculatedMeasure | Filter;
|
|
170
|
+
/**
|
|
171
|
+
* Returns the granularity from the provided JAQL object.
|
|
172
|
+
*
|
|
173
|
+
* @param jaql - The JAQL object.
|
|
174
|
+
* @returns string.
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
export declare function getGranularityFromJaql(jaql: BaseJaql | FilterJaql | FilterJaqlInternal | RankingFilterJaql): string | undefined;
|