@sisense/sdk-data 1.21.0 → 1.23.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 (58) hide show
  1. package/dist/cjs/dimensional-model/attributes.js +5 -5
  2. package/dist/cjs/dimensional-model/base.js +1 -1
  3. package/dist/cjs/dimensional-model/dimensions.d.ts +3 -3
  4. package/dist/cjs/dimensional-model/dimensions.js +29 -25
  5. package/dist/cjs/dimensional-model/filters/factory.d.ts +3 -1
  6. package/dist/cjs/dimensional-model/filters/factory.js +4 -2
  7. package/dist/cjs/dimensional-model/filters/filters.d.ts +3 -1
  8. package/dist/cjs/dimensional-model/filters/filters.js +3 -5
  9. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.d.ts +1 -1
  10. package/dist/cjs/dimensional-model/filters/utils/attribute-measure-util.js +5 -4
  11. package/dist/cjs/dimensional-model/filters/utils/condition-filter-util.js +16 -7
  12. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +1 -1
  13. package/dist/cjs/dimensional-model/filters/utils/filter-from-jaql-util.js +7 -4
  14. package/dist/cjs/dimensional-model/interfaces.d.ts +1 -0
  15. package/dist/cjs/dimensional-model/jaql-element.d.ts +36 -0
  16. package/dist/cjs/dimensional-model/jaql-element.js +73 -0
  17. package/dist/cjs/dimensional-model/measures/factory.js +2 -1
  18. package/dist/cjs/dimensional-model/types.d.ts +148 -0
  19. package/dist/cjs/dimensional-model/types.js +11 -2
  20. package/dist/cjs/index.d.ts +2 -0
  21. package/dist/cjs/index.js +4 -1
  22. package/dist/cjs/translation/resources/en.d.ts +17 -0
  23. package/dist/cjs/translation/resources/en.js +3 -0
  24. package/dist/cjs/translation/resources/index.d.ts +12 -0
  25. package/dist/cjs/translation/resources/index.js +6 -0
  26. package/dist/cjs/translation/resources/uk.js +3 -0
  27. package/dist/cjs/utils.d.ts +11 -1
  28. package/dist/cjs/utils.js +28 -5
  29. package/dist/dimensional-model/attributes.js +5 -5
  30. package/dist/dimensional-model/base.js +1 -1
  31. package/dist/dimensional-model/dimensions.d.ts +3 -3
  32. package/dist/dimensional-model/dimensions.js +29 -25
  33. package/dist/dimensional-model/filters/factory.d.ts +3 -1
  34. package/dist/dimensional-model/filters/factory.js +4 -2
  35. package/dist/dimensional-model/filters/filters.d.ts +3 -1
  36. package/dist/dimensional-model/filters/filters.js +3 -5
  37. package/dist/dimensional-model/filters/utils/attribute-measure-util.d.ts +1 -1
  38. package/dist/dimensional-model/filters/utils/attribute-measure-util.js +5 -4
  39. package/dist/dimensional-model/filters/utils/condition-filter-util.js +16 -7
  40. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.d.ts +1 -1
  41. package/dist/dimensional-model/filters/utils/filter-from-jaql-util.js +7 -4
  42. package/dist/dimensional-model/interfaces.d.ts +1 -0
  43. package/dist/dimensional-model/jaql-element.d.ts +36 -0
  44. package/dist/dimensional-model/jaql-element.js +68 -0
  45. package/dist/dimensional-model/measures/factory.js +2 -1
  46. package/dist/dimensional-model/types.d.ts +148 -0
  47. package/dist/dimensional-model/types.js +10 -1
  48. package/dist/index.d.ts +2 -0
  49. package/dist/index.js +2 -0
  50. package/dist/translation/resources/en.d.ts +17 -0
  51. package/dist/translation/resources/en.js +3 -0
  52. package/dist/translation/resources/index.d.ts +12 -0
  53. package/dist/translation/resources/index.js +6 -0
  54. package/dist/translation/resources/uk.js +3 -0
  55. package/dist/tsconfig.prod.cjs.tsbuildinfo +1 -1
  56. package/dist/utils.d.ts +11 -1
  57. package/dist/utils.js +24 -2
  58. package/package.json +3 -3
@@ -223,12 +223,14 @@ export declare type IncludeAllFilter = {
223
223
  /** @internal */
224
224
  export declare type IncludeMembersFilter = {
225
225
  members: string[];
226
+ multiSelection?: boolean;
226
227
  };
227
228
  /** @internal */
228
229
  export declare type ExcludeMembersFilter = {
229
230
  exclude: {
230
231
  members: string[];
231
232
  };
233
+ multiSelection?: boolean;
232
234
  };
233
235
  /** @internal */
234
236
  export declare type TurnOffMembersFilter = ExcludeMembersFilter & {
@@ -266,3 +268,149 @@ export declare type OrFilter<FilterItem> = {
266
268
  * Abstract object with any unknown values
267
269
  */
268
270
  export declare type AnyObject = Record<string, any>;
271
+ /**
272
+ * @internal
273
+ */
274
+ interface DecimalAbbreviations {
275
+ k: boolean;
276
+ m: boolean;
277
+ b: boolean;
278
+ t: boolean;
279
+ }
280
+ /**
281
+ * @internal
282
+ */
283
+ export declare enum CurrencyPosition {
284
+ PRE = "pre",
285
+ POST = "post"
286
+ }
287
+ /**
288
+ * @internal
289
+ */
290
+ export declare type NumericMask = {
291
+ isdefault?: boolean;
292
+ abbreviations?: DecimalAbbreviations;
293
+ decimals?: 'auto' | number | string;
294
+ currency?: {
295
+ symbol: string;
296
+ position: CurrencyPosition;
297
+ };
298
+ percent?: boolean;
299
+ number?: {
300
+ separated: boolean;
301
+ };
302
+ separated?: boolean;
303
+ type?: string;
304
+ };
305
+ /**
306
+ * @internal
307
+ */
308
+ export declare type DatetimeMask = {
309
+ isdefault?: boolean;
310
+ years: string;
311
+ quarters: string;
312
+ months: string;
313
+ weeks: string;
314
+ minutes: string;
315
+ days: string;
316
+ type: string;
317
+ dateAndTime?: string;
318
+ };
319
+ /**
320
+ * @internal
321
+ */
322
+ export declare type MetadataItem = {
323
+ instanceid?: string;
324
+ measure?: MetadataItemJaql;
325
+ jaql: MetadataItemJaql;
326
+ panel?: string;
327
+ isScope?: boolean;
328
+ format?: {
329
+ mask?: Partial<DatetimeMask> | Partial<NumericMask>;
330
+ number?: string;
331
+ subtotal?: boolean;
332
+ width?: number;
333
+ databars?: boolean;
334
+ color?: {
335
+ type: string;
336
+ color?: string;
337
+ conditions?: Array<{
338
+ color: string;
339
+ operator: string;
340
+ expression: string | Record<string, any>;
341
+ }>;
342
+ };
343
+ };
344
+ field?: {
345
+ id?: string;
346
+ index?: number;
347
+ };
348
+ filter?: MetadataItem;
349
+ exclude?: MetadataItem;
350
+ by?: MetadataItemJaql;
351
+ level?: string;
352
+ anchor?: string;
353
+ from?: string;
354
+ to?: string;
355
+ };
356
+ /**
357
+ * @internal
358
+ */
359
+ export declare type MetadataItemJaql = {
360
+ dim?: string;
361
+ agg?: string;
362
+ datatype?: string;
363
+ table?: string;
364
+ column?: string;
365
+ level?: string;
366
+ dateTimeLevel?: string;
367
+ bucket?: string;
368
+ sort?: string;
369
+ in?: {
370
+ selected: {
371
+ jaql: MetadataItemJaql;
372
+ };
373
+ };
374
+ title?: string;
375
+ type?: string;
376
+ formula?: string;
377
+ context?: {
378
+ [itemId: string]: MetadataItemJaql;
379
+ };
380
+ filter?: MetadataItem;
381
+ sortDetails?: {
382
+ dir: string;
383
+ field?: number;
384
+ measurePath?: Record<number, string | number>;
385
+ sortingLastDimension?: boolean;
386
+ initialized?: boolean;
387
+ };
388
+ };
389
+ /**
390
+ * @internal
391
+ */
392
+ export declare type DataSourceField = {
393
+ column: string;
394
+ dimtype: string;
395
+ id: string;
396
+ indexed: boolean;
397
+ merged: boolean;
398
+ table: string;
399
+ title: string;
400
+ type: string;
401
+ };
402
+ /**
403
+ * @internal
404
+ */
405
+ export declare type DataSourceSchema = {
406
+ title: string;
407
+ type: 'extract' | 'live';
408
+ } & AnyObject;
409
+ /**
410
+ * @internal
411
+ */
412
+ export declare type DataSourceMetadata = {
413
+ title: string;
414
+ fullname: string;
415
+ live: boolean;
416
+ };
@@ -6,7 +6,7 @@
6
6
  * Types
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.JaqlSortDirection = exports.DataType = exports.DateLevels = exports.MetadataTypes = exports.Sort = exports.AggregationTypes = void 0;
9
+ exports.CurrencyPosition = exports.JaqlSortDirection = exports.DataType = exports.DateLevels = exports.MetadataTypes = exports.Sort = exports.AggregationTypes = void 0;
10
10
  /**
11
11
  * Different aggregation types
12
12
  */
@@ -107,7 +107,8 @@ exports.MetadataTypes = {
107
107
  const type = o;
108
108
  return type.toLowerCase() === exports.MetadataTypes.BaseMeasure;
109
109
  }
110
- return (o.agg || o.aggregation) && o.attribute && !this.isMeasureTemplate(o);
110
+ // JaqlElement doesn't have property attribute. Check for jaql instead
111
+ return (o.agg || o.aggregation) && (o.attribute || o.jaql) && !this.isMeasureTemplate(o);
111
112
  },
112
113
  /**
113
114
  * Checks whether the given object or type is a measure - of any type
@@ -300,3 +301,11 @@ var JaqlSortDirection;
300
301
  JaqlSortDirection["ASC"] = "asc";
301
302
  JaqlSortDirection["DESC"] = "desc";
302
303
  })(JaqlSortDirection = exports.JaqlSortDirection || (exports.JaqlSortDirection = {}));
304
+ /**
305
+ * @internal
306
+ */
307
+ var CurrencyPosition;
308
+ (function (CurrencyPosition) {
309
+ CurrencyPosition["PRE"] = "pre";
310
+ CurrencyPosition["POST"] = "post";
311
+ })(CurrencyPosition = exports.CurrencyPosition || (exports.CurrencyPosition = {}));
@@ -14,6 +14,7 @@ export * from './dimensional-model/data-model.js';
14
14
  export * from './dimensional-model/attributes.js';
15
15
  export * from './dimensional-model/dimensions.js';
16
16
  export * from './dimensional-model/factory.js';
17
+ export * from './dimensional-model/jaql-element.js';
17
18
  export * from './dimensional-model/filters/filters.js';
18
19
  export { createFilterMatcher } from './dimensional-model/filters/utils/filter-matcher-utils.js';
19
20
  /**
@@ -91,3 +92,4 @@ export * from './dimensional-model/simple-column-types.js';
91
92
  */
92
93
  export * as analyticsFactory from './dimensional-model/analytics/factory.js';
93
94
  export * from './utils.js';
95
+ export { type TranslationDictionary, PACKAGE_NAMESPACE as translationNamespace, } from './translation/resources/index.js';
package/dist/cjs/index.js CHANGED
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.analyticsFactory = exports.measureFactory = exports.filterFactory = exports.createFilterMatcher = void 0;
29
+ exports.translationNamespace = exports.analyticsFactory = exports.measureFactory = exports.filterFactory = exports.createFilterMatcher = void 0;
30
30
  require("./translation/initialize-i18n.js");
31
31
  /**
32
32
  * @packageDocumentation
@@ -43,6 +43,7 @@ __exportStar(require("./dimensional-model/data-model.js"), exports);
43
43
  __exportStar(require("./dimensional-model/attributes.js"), exports);
44
44
  __exportStar(require("./dimensional-model/dimensions.js"), exports);
45
45
  __exportStar(require("./dimensional-model/factory.js"), exports);
46
+ __exportStar(require("./dimensional-model/jaql-element.js"), exports);
46
47
  __exportStar(require("./dimensional-model/filters/filters.js"), exports);
47
48
  var filter_matcher_utils_js_1 = require("./dimensional-model/filters/utils/filter-matcher-utils.js");
48
49
  Object.defineProperty(exports, "createFilterMatcher", { enumerable: true, get: function () { return filter_matcher_utils_js_1.createFilterMatcher; } });
@@ -121,3 +122,5 @@ __exportStar(require("./dimensional-model/simple-column-types.js"), exports);
121
122
  */
122
123
  exports.analyticsFactory = __importStar(require("./dimensional-model/analytics/factory.js"));
123
124
  __exportStar(require("./utils.js"), exports);
125
+ var index_js_1 = require("./translation/resources/index.js");
126
+ Object.defineProperty(exports, "translationNamespace", { enumerable: true, get: function () { return index_js_1.PACKAGE_NAMESPACE; } });
@@ -12,6 +12,7 @@ export declare const translation: {
12
12
  noAttributeDimExpression: string;
13
13
  noAggAggregation: string;
14
14
  };
15
+ notAFormula: string;
15
16
  };
16
17
  dataModelConfig: {
17
18
  noName: string;
@@ -21,8 +22,24 @@ export declare const translation: {
21
22
  unsupportedType: string;
22
23
  unsupportedDatetimeLevel: string;
23
24
  membersFilterNullMember: string;
25
+ unsupportedConditionFilter: string;
26
+ formulaFiltersNotSupported: string;
24
27
  };
25
28
  unsupportedDimensionalElement: string;
26
29
  };
27
30
  };
31
+ /**
32
+ * A reference type containing all currently used translation keys.
33
+ * This type serves as a complete resource for creating custom translations,
34
+ * ensuring that all required keys are present and included.
35
+ * It can also be used as Partial to make sure custom translation does not contain any typos.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * import { TranslationDictionary } from '@sisense/sdk-data';
40
+ *
41
+ * const customTranslationResources: Partial<TranslationDictionary> = {
42
+ * ```
43
+ * @internal
44
+ */
28
45
  export declare type TranslationDictionary = typeof translation;
@@ -15,6 +15,7 @@ exports.translation = {
15
15
  noAttributeDimExpression: "DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",
16
16
  noAggAggregation: "DimensionalBaseMeasure must have 'agg' or 'aggregation' property",
17
17
  },
18
+ notAFormula: 'Jaql is not a formula',
18
19
  },
19
20
  dataModelConfig: {
20
21
  noName: "'name' must be specified in config for DataModel",
@@ -24,6 +25,8 @@ exports.translation = {
24
25
  unsupportedType: 'Unsupported filter type: {{filterType}}',
25
26
  unsupportedDatetimeLevel: 'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',
26
27
  membersFilterNullMember: 'MembersFilter of {{attributeId}} - member cannot be null',
28
+ unsupportedConditionFilter: 'Jaql contains unsupported condition filter: {{filter}}',
29
+ formulaFiltersNotSupported: 'Formula-based filter not supported yet: {{filter}}',
27
30
  },
28
31
  unsupportedDimensionalElement: 'Unsupported dimensional element type',
29
32
  },
@@ -1,5 +1,11 @@
1
1
  import { TranslationDictionary } from './en.js';
2
2
  export type { TranslationDictionary };
3
+ /**
4
+ * A reference to the namespace of the translation resources.
5
+ * This namespace is used to access the translation resources in the i18next instance.
6
+ *
7
+ * @internal
8
+ */
3
9
  export declare const PACKAGE_NAMESPACE: "sdkData";
4
10
  export declare const resources: {
5
11
  en: {
@@ -13,6 +19,7 @@ export declare const resources: {
13
19
  noAttributeDimExpression: string;
14
20
  noAggAggregation: string;
15
21
  };
22
+ notAFormula: string;
16
23
  };
17
24
  dataModelConfig: {
18
25
  noName: string;
@@ -22,6 +29,8 @@ export declare const resources: {
22
29
  unsupportedType: string;
23
30
  unsupportedDatetimeLevel: string;
24
31
  membersFilterNullMember: string;
32
+ unsupportedConditionFilter: string;
33
+ formulaFiltersNotSupported: string;
25
34
  };
26
35
  unsupportedDimensionalElement: string;
27
36
  };
@@ -37,6 +46,7 @@ export declare const resources: {
37
46
  noAttributeDimExpression: string;
38
47
  noAggAggregation: string;
39
48
  };
49
+ notAFormula: string;
40
50
  };
41
51
  dataModelConfig: {
42
52
  noName: string;
@@ -46,6 +56,8 @@ export declare const resources: {
46
56
  unsupportedType: string;
47
57
  unsupportedDatetimeLevel: string;
48
58
  membersFilterNullMember: string;
59
+ unsupportedConditionFilter: string;
60
+ formulaFiltersNotSupported: string;
49
61
  };
50
62
  unsupportedDimensionalElement: string;
51
63
  };
@@ -3,6 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resources = exports.PACKAGE_NAMESPACE = void 0;
4
4
  const en_js_1 = require("./en.js");
5
5
  const uk_js_1 = require("./uk.js");
6
+ /**
7
+ * A reference to the namespace of the translation resources.
8
+ * This namespace is used to access the translation resources in the i18next instance.
9
+ *
10
+ * @internal
11
+ */
6
12
  exports.PACKAGE_NAMESPACE = 'sdkData';
7
13
  exports.resources = {
8
14
  en: en_js_1.translation,
@@ -15,6 +15,7 @@ exports.translation = {
15
15
  noAttributeDimExpression: "DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",
16
16
  noAggAggregation: "DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'",
17
17
  },
18
+ notAFormula: 'Jaql не формула',
18
19
  },
19
20
  dataModelConfig: {
20
21
  noName: "'name' має бути вказано в конфігурації для DataModel",
@@ -24,6 +25,8 @@ exports.translation = {
24
25
  unsupportedType: 'Непідтримуваний тип фільтра: {{filterType}}',
25
26
  unsupportedDatetimeLevel: 'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',
26
27
  membersFilterNullMember: 'MembersFilter у {{attributeId}} - member не може бути нульовим',
28
+ unsupportedConditionFilter: 'Jaql містить непідтримуваний condition фільтр: {{filter}}',
29
+ formulaFiltersNotSupported: 'Фільтри, що містять формули наразі не підтримуються: {{filter}}',
27
30
  },
28
31
  unsupportedDimensionalElement: 'Непідтримуваний тип елемента',
29
32
  },
@@ -1,5 +1,7 @@
1
- import { Filter, FilterRelations, FilterRelationsJaql, DataSource, DataSourceInfo, FilterJaql, Sort, Attribute } from './index.js';
2
1
  import { JaqlDataSource } from './dimensional-model/filters/utils/types.js';
2
+ import { Attribute, Filter, FilterRelations, FilterRelationsJaql, SortDirection } from './dimensional-model/interfaces.js';
3
+ import { DataSource, DataSourceInfo } from './interfaces.js';
4
+ import { FilterJaql, JaqlSortDirection, Sort } from './dimensional-model/types.js';
3
5
  /**
4
6
  * A more performant, but slightly bulkier, RFC4122v4 implementation. Performance is improved by minimizing calls to random()
5
7
  *
@@ -68,3 +70,11 @@ export declare function getTableNameFromAttribute(attribute: Attribute): string;
68
70
  * @internal
69
71
  */
70
72
  export declare function getColumnNameFromAttribute(attribute: Attribute): string;
73
+ /**
74
+ * Gets the sort type based on the jaql sort direction.
75
+ *
76
+ * @param jaqlSort - The jaql sort direction.
77
+ * @returns The sort direction.
78
+ * @internal
79
+ */
80
+ export declare function getSortType(jaqlSort: `${JaqlSortDirection}` | undefined): SortDirection;
package/dist/cjs/utils.js CHANGED
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getColumnNameFromAttribute = exports.getTableNameFromAttribute = exports.createFilterFromJaql = exports.convertSort = exports.convertJaqlDataSource = exports.convertDataSource = exports.isDataSourceInfo = exports.getDataSourceName = exports.getFilterListAndRelations = exports.guidFast = void 0;
6
+ exports.getSortType = exports.getColumnNameFromAttribute = exports.getTableNameFromAttribute = exports.createFilterFromJaql = exports.convertSort = exports.convertJaqlDataSource = exports.convertDataSource = exports.isDataSourceInfo = exports.getDataSourceName = exports.getFilterListAndRelations = exports.guidFast = void 0;
7
7
  const cloneDeep_js_1 = __importDefault(require("lodash-es/cloneDeep.js"));
8
- const index_js_1 = require("./index.js");
9
8
  const filter_from_jaql_util_js_1 = require("./dimensional-model/filters/utils/filter-from-jaql-util.js");
9
+ const types_js_1 = require("./dimensional-model/types.js");
10
10
  /**
11
11
  * A more performant, but slightly bulkier, RFC4122v4 implementation. Performance is improved by minimizing calls to random()
12
12
  *
@@ -127,10 +127,10 @@ exports.convertJaqlDataSource = convertJaqlDataSource;
127
127
  */
128
128
  function convertSort(sort) {
129
129
  if (sort) {
130
- return sort === 'asc' ? index_js_1.Sort.Ascending : index_js_1.Sort.Descending;
130
+ return sort === 'asc' ? types_js_1.Sort.Ascending : types_js_1.Sort.Descending;
131
131
  }
132
132
  else {
133
- return index_js_1.Sort.None;
133
+ return types_js_1.Sort.None;
134
134
  }
135
135
  }
136
136
  exports.convertSort = convertSort;
@@ -162,7 +162,12 @@ function parseExpression(expression) {
162
162
  const [table, column] = expression.slice(1, -1).split('.');
163
163
  return {
164
164
  table,
165
- column,
165
+ column: column
166
+ ? column
167
+ // in case of Date we have to remove the (Calendar) part
168
+ .replace('(Calendar)', '')
169
+ .trim()
170
+ : '',
166
171
  };
167
172
  }
168
173
  /**
@@ -183,3 +188,21 @@ function getColumnNameFromAttribute(attribute) {
183
188
  return parseExpression(attribute.expression).column;
184
189
  }
185
190
  exports.getColumnNameFromAttribute = getColumnNameFromAttribute;
191
+ /**
192
+ * Gets the sort type based on the jaql sort direction.
193
+ *
194
+ * @param jaqlSort - The jaql sort direction.
195
+ * @returns The sort direction.
196
+ * @internal
197
+ */
198
+ function getSortType(jaqlSort) {
199
+ switch (jaqlSort) {
200
+ case types_js_1.JaqlSortDirection.ASC:
201
+ return 'sortAsc';
202
+ case types_js_1.JaqlSortDirection.DESC:
203
+ return 'sortDesc';
204
+ default:
205
+ return 'sortNone';
206
+ }
207
+ }
208
+ exports.getSortType = getSortType;
@@ -36,7 +36,7 @@ export class DimensionalAttribute extends DimensionalElement {
36
36
  * @returns An instance representing the sorted {@link Attribute} of this instance
37
37
  */
38
38
  sort(sort) {
39
- return new DimensionalAttribute(this.name, this.expression, this.type, this.description, sort);
39
+ return new DimensionalAttribute(this.name, this.expression, this.type, this.description, sort, this.dataSource);
40
40
  }
41
41
  /**
42
42
  * Gets the JAQL representation of this instance
@@ -104,7 +104,7 @@ export class DimensionalLevelAttribute extends DimensionalAttribute {
104
104
  * @returns An instance representing the sorted {@link LevelAttribute} of this instance
105
105
  */
106
106
  sort(sort) {
107
- return new DimensionalLevelAttribute(this.name, this.expression, this.granularity, this._format, this.description, sort);
107
+ return new DimensionalLevelAttribute(this.name, this.expression, this.granularity, this._format, this.description, sort, this.dataSource);
108
108
  }
109
109
  /**
110
110
  * The string formatting of this instance
@@ -121,7 +121,7 @@ export class DimensionalLevelAttribute extends DimensionalAttribute {
121
121
  * @returns An instance representing the formatted {@link LevelAttribute} of this instance
122
122
  */
123
123
  format(format) {
124
- return new DimensionalLevelAttribute(this.name, this.expression, this.granularity, format, this.description, this._sort);
124
+ return new DimensionalLevelAttribute(this.name, this.expression, this.granularity, format, this.description, this._sort, this.dataSource);
125
125
  }
126
126
  /**
127
127
  * Gets a serializable representation of the element
@@ -320,7 +320,7 @@ export function createAttribute(json) {
320
320
  if (json.granularity) {
321
321
  return createLevel(json);
322
322
  }
323
- return new DimensionalAttribute(json.name || json.title, json.attribute || json.expression || json.dim, json.type, json.desc || json.description);
323
+ return new DimensionalAttribute(json.name || json.title, json.attribute || json.expression || json.dim, json.type, json.desc || json.description, json.sort, json.dataSource);
324
324
  }
325
325
  /**
326
326
  * Creates a LevelAttribute instance from the given JSON object.
@@ -329,7 +329,7 @@ export function createAttribute(json) {
329
329
  * @internal
330
330
  */
331
331
  export function createLevel(json) {
332
- return new DimensionalLevelAttribute(json.name || json.title, json.attribute || json.expression || json.dim, json.granularity, json.format, json.desc || json.description);
332
+ return new DimensionalLevelAttribute(json.name || json.title, json.attribute || json.expression || json.dim, json.granularity, json.format, json.desc || json.description, json.sort, json.dataSource);
333
333
  }
334
334
  /**
335
335
  * Normalize attribute name
@@ -53,7 +53,7 @@ export class DimensionalElement {
53
53
  */
54
54
  export function normalizeName(name) {
55
55
  // Remove all invalid characters
56
- let normalizedName = name.replace(/[^a-zA-Z0-9_]/g, '');
56
+ let normalizedName = name.replace(/[^a-zA-Z0-9_.]/g, '').replace('.', '_');
57
57
  // Prefix with '_' if it starts with a number
58
58
  const firstChar = normalizedName.charAt(0);
59
59
  if (firstChar.match(/[0-9]/)) {
@@ -1,5 +1,5 @@
1
1
  import { Attribute, LevelAttribute, Dimension, DateDimension } from './interfaces.js';
2
- import { Sort } from './types.js';
2
+ import { Sort, JaqlDataSource } from './types.js';
3
3
  import { DimensionalElement } from './base.js';
4
4
  /**
5
5
  * Represents a Dimension in a Dimensional Model
@@ -14,7 +14,7 @@ export declare class DimensionalDimension extends DimensionalElement implements
14
14
  protected _attributes: Attribute[];
15
15
  private _expression;
16
16
  protected _sort: Sort;
17
- constructor(name: string, expression: string, attributes: Attribute[], dimensions?: Dimension[], type?: string, desc?: string, sort?: Sort);
17
+ constructor(name: string, expression: string, attributes: Attribute[], dimensions?: Dimension[], type?: string, desc?: string, sort?: Sort, dataSource?: JaqlDataSource);
18
18
  private getAttachedName;
19
19
  protected setDimensions(dimensions: Dimension[]): void;
20
20
  protected setAttributes(attributes: Attribute[]): void;
@@ -61,7 +61,7 @@ export declare class DimensionalDimension extends DimensionalElement implements
61
61
  * @internal
62
62
  */
63
63
  export declare class DimensionalDateDimension extends DimensionalDimension implements DateDimension {
64
- constructor(name: string, expression: string, desc?: string, sort?: Sort);
64
+ constructor(name: string, expression: string, desc?: string, sort?: Sort, dataSource?: JaqlDataSource);
65
65
  /**
66
66
  * Years level
67
67
  */
@@ -7,8 +7,8 @@ import { DimensionalElement, normalizeName } from './base.js';
7
7
  * @internal
8
8
  */
9
9
  export class DimensionalDimension extends DimensionalElement {
10
- constructor(name, expression, attributes, dimensions, type, desc, sort) {
11
- super(name, type || MetadataTypes.Dimension, desc);
10
+ constructor(name, expression, attributes, dimensions, type, desc, sort, dataSource) {
11
+ super(name, type || MetadataTypes.Dimension, desc, dataSource);
12
12
  this._dimensions = [];
13
13
  this._attributes = [];
14
14
  this._sort = Sort.None;
@@ -101,7 +101,7 @@ export class DimensionalDimension extends DimensionalElement {
101
101
  * @returns An instance representing the sorted {@link Dimension} of this instance
102
102
  */
103
103
  sort(sort) {
104
- return new DimensionalDimension(this.name, this.expression, this.attributes, this.dimensions, this.type, this.description, sort);
104
+ return new DimensionalDimension(this.name, this.expression, this.attributes, this.dimensions, this.type, this.description, sort, this.dataSource);
105
105
  }
106
106
  /**
107
107
  * Gets a serializable representation of the element
@@ -150,23 +150,23 @@ export class DimensionalDimension extends DimensionalElement {
150
150
  * @internal
151
151
  */
152
152
  export class DimensionalDateDimension extends DimensionalDimension {
153
- constructor(name, expression, desc, sort) {
154
- super(name, expression, [], [], MetadataTypes.DateDimension, desc, sort);
153
+ constructor(name, expression, desc, sort, dataSource) {
154
+ super(name, expression, [], [], MetadataTypes.DateDimension, desc, sort, dataSource);
155
155
  this.defaultLevel = DateLevels.Years;
156
- this.Years = new DimensionalLevelAttribute(DateLevels.Years, expression, DateLevels.Years, 'yyyy');
157
- this.Quarters = new DimensionalLevelAttribute(DateLevels.Quarters, expression, DateLevels.Quarters, 'Q yyyy');
158
- this.Months = new DimensionalLevelAttribute(DateLevels.Months, expression, DateLevels.Months, 'yyyy-MM');
159
- this.Weeks = new DimensionalLevelAttribute(DateLevels.Weeks, expression, DateLevels.Weeks, 'ww yyyy');
160
- this.Days = new DimensionalLevelAttribute(DateLevels.Days, expression, DateLevels.Days, 'yyyy-MM-dd');
161
- this.Hours = new DimensionalLevelAttribute(DateLevels.Hours, expression, DateLevels.Hours, 'yyyy-MM-dd HH:mm');
162
- this.MinutesRoundTo30 = new DimensionalLevelAttribute(DateLevels.MinutesRoundTo30, expression, DateLevels.MinutesRoundTo30, 'yyyy-MM-dd HH:mm');
163
- this.MinutesRoundTo15 = new DimensionalLevelAttribute(DateLevels.MinutesRoundTo15, expression, DateLevels.MinutesRoundTo15, 'yyyy-MM-dd HH:mm');
164
- this.Minutes = new DimensionalLevelAttribute(DateLevels.Minutes, expression, DateLevels.Minutes, 'yyyy-MM-dd HH:mm');
165
- this.Seconds = new DimensionalLevelAttribute(DateLevels.Seconds, expression, DateLevels.Seconds, 'yyyy-MM-dd HH:mm:ss');
166
- this.AggHours = new DimensionalLevelAttribute(DateLevels.AggHours, expression, DateLevels.AggHours, 'HH:mm');
167
- this.AggMinutesRoundTo30 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo30, expression, DateLevels.AggMinutesRoundTo30, 'HH:mm');
168
- this.AggMinutesRoundTo15 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo15, expression, DateLevels.AggMinutesRoundTo15, 'HH:mm');
169
- this.AggMinutesRoundTo1 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo1, expression, DateLevels.AggMinutesRoundTo1, 'HH:mm');
156
+ this.Years = new DimensionalLevelAttribute(DateLevels.Years, expression, DateLevels.Years, 'yyyy', desc, sort, dataSource);
157
+ this.Quarters = new DimensionalLevelAttribute(DateLevels.Quarters, expression, DateLevels.Quarters, 'Q yyyy', desc, sort, dataSource);
158
+ this.Months = new DimensionalLevelAttribute(DateLevels.Months, expression, DateLevels.Months, 'yyyy-MM', desc, sort, dataSource);
159
+ this.Weeks = new DimensionalLevelAttribute(DateLevels.Weeks, expression, DateLevels.Weeks, 'ww yyyy', desc, sort, dataSource);
160
+ this.Days = new DimensionalLevelAttribute(DateLevels.Days, expression, DateLevels.Days, 'yyyy-MM-dd', desc, sort, dataSource);
161
+ this.Hours = new DimensionalLevelAttribute(DateLevels.Hours, expression, DateLevels.Hours, 'yyyy-MM-dd HH:mm', desc, sort, dataSource);
162
+ this.MinutesRoundTo30 = new DimensionalLevelAttribute(DateLevels.MinutesRoundTo30, expression, DateLevels.MinutesRoundTo30, 'yyyy-MM-dd HH:mm', desc, sort, dataSource);
163
+ this.MinutesRoundTo15 = new DimensionalLevelAttribute(DateLevels.MinutesRoundTo15, expression, DateLevels.MinutesRoundTo15, 'yyyy-MM-dd HH:mm', desc, sort, dataSource);
164
+ this.Minutes = new DimensionalLevelAttribute(DateLevels.Minutes, expression, DateLevels.Minutes, 'yyyy-MM-dd HH:mm', desc, sort, dataSource);
165
+ this.Seconds = new DimensionalLevelAttribute(DateLevels.Seconds, expression, DateLevels.Seconds, 'yyyy-MM-dd HH:mm:ss', desc, sort, dataSource);
166
+ this.AggHours = new DimensionalLevelAttribute(DateLevels.AggHours, expression, DateLevels.AggHours, 'HH:mm', desc, sort, dataSource);
167
+ this.AggMinutesRoundTo30 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo30, expression, DateLevels.AggMinutesRoundTo30, 'HH:mm', desc, sort, dataSource);
168
+ this.AggMinutesRoundTo15 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo15, expression, DateLevels.AggMinutesRoundTo15, 'HH:mm', desc, sort, dataSource);
169
+ this.AggMinutesRoundTo1 = new DimensionalLevelAttribute(DateLevels.AggMinutesRoundTo1, expression, DateLevels.AggMinutesRoundTo1, 'HH:mm', desc, sort, dataSource);
170
170
  this.setAttributes([
171
171
  this.Years,
172
172
  this.Quarters,
@@ -211,7 +211,7 @@ export class DimensionalDateDimension extends DimensionalDimension {
211
211
  * @returns An instance representing the sorted {@link Dimension} of this instance
212
212
  */
213
213
  sort(sort) {
214
- return new DimensionalDateDimension(this.name, this.expression, this.description, sort);
214
+ return new DimensionalDateDimension(this.name, this.expression, this.description, sort, this.dataSource);
215
215
  }
216
216
  /**
217
217
  * Gets a serializable representation of the element
@@ -250,9 +250,11 @@ export function createDimension(json) {
250
250
  const description = json.desc || json.description;
251
251
  const expression = json.expression || json.dim;
252
252
  const type = DimensionalDimension.parseType(json.dimtype || json.type);
253
+ const sort = json.sort;
254
+ const dataSource = json.dataSource;
253
255
  // date dimension
254
256
  if (type == MetadataTypes.DateDimension) {
255
- return new DimensionalDateDimension(name, expression, description);
257
+ return new DimensionalDateDimension(name, expression, description, sort, dataSource);
256
258
  }
257
259
  // attributes
258
260
  const atts = Object.getOwnPropertyNames(json)
@@ -263,12 +265,12 @@ export function createDimension(json) {
263
265
  let att;
264
266
  for (let i = 0; i < json.attributes.length; i++) {
265
267
  att = json.attributes[i];
266
- atts.push(new DimensionalAttribute(att.name, att.expression, att.type, att.description));
268
+ atts.push(new DimensionalAttribute(att.name, att.expression, att.type, att.description, att.sort, att.dataSource));
267
269
  }
268
270
  }
269
271
  // default attribute
270
272
  else if (expression) {
271
- atts.push(new DimensionalAttribute(name, expression, type, description));
273
+ atts.push(new DimensionalAttribute(name, expression, type, description, sort, dataSource));
272
274
  }
273
275
  }
274
276
  // nested dimensions
@@ -280,7 +282,7 @@ export function createDimension(json) {
280
282
  dims.push(createDimension(json.dimensions[i]));
281
283
  }
282
284
  }
283
- const d = new DimensionalDimension(name, expression, atts, dims, type, description);
285
+ const d = new DimensionalDimension(name, expression, atts, dims, type, description, sort, dataSource);
284
286
  if (json.defaultAttribute) {
285
287
  d.defaultAttribute = atts.find((a) => a.name === json.defaultAttribute);
286
288
  }
@@ -301,5 +303,7 @@ export function createDateDimension(json) {
301
303
  const name = json.name || json.title;
302
304
  const expression = json.expression || json.dim;
303
305
  const description = json.desc || json.description;
304
- return new DimensionalDateDimension(name, expression, description);
306
+ const sort = json.sort;
307
+ const dataSource = json.dataSource;
308
+ return new DimensionalDateDimension(name, expression, description, sort, dataSource);
305
309
  }
@@ -377,9 +377,11 @@ export declare function numeric(attribute: Attribute, operatorA?: string, valueA
377
377
  * @param guid - Optional GUID for the filter
378
378
  * @param deactivatedMembers - Array of deactivated member values
379
379
  * @param backgroundFilter - Optional background filter
380
+ * @param multiSelection - Optional flag to disable multi-selection
380
381
  * @returns A filter instance
382
+ * @shortDescription Creates filter on attribute to match certain string values
381
383
  */
382
- export declare function members(attribute: Attribute, members: string[], excludeMembers?: boolean, guid?: string, deactivatedMembers?: string[], backgroundFilter?: Filter): Filter;
384
+ export declare function members(attribute: Attribute, members: string[], excludeMembers?: boolean, guid?: string, deactivatedMembers?: string[], backgroundFilter?: Filter, multiSelection?: boolean): Filter;
383
385
  /**
384
386
  * Creates a filter to isolate date values starting from and including the given date and level.
385
387
  *