@sisense/sdk-data 0.11.3 → 0.12.1

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.
@@ -3,11 +3,16 @@ import { Element } from './interfaces.js';
3
3
  * @internal
4
4
  */
5
5
  export declare abstract class DimensionalElement implements Element {
6
- constructor(name: string, type: string, desc?: string);
6
+ /**
7
+ * @internal
8
+ */
9
+ private _name;
7
10
  /**
8
11
  * Defines the element's name
9
12
  */
10
- name: string;
13
+ get name(): string;
14
+ set name(value: string);
15
+ constructor(name: string, type: string, desc?: string);
11
16
  /**
12
17
  * gets the element's description
13
18
  */
@@ -3,10 +3,19 @@
3
3
  */
4
4
  export class DimensionalElement {
5
5
  constructor(name, type, desc) {
6
- this.name = name;
6
+ this._name = name;
7
7
  this.type = type;
8
8
  this.description = desc || '';
9
9
  }
10
+ /**
11
+ * Defines the element's name
12
+ */
13
+ get name() {
14
+ return this._name;
15
+ }
16
+ set name(value) {
17
+ this._name = value;
18
+ }
10
19
  /**
11
20
  * Gets a serializable representation of the element
12
21
  */
@@ -1,4 +1,4 @@
1
- import { DimensionalElement } from './base.js';
1
+ import { Element } from './interfaces.js';
2
2
  /**
3
3
  * Generate an array of dimension model instances out of the given JSON array
4
4
  *
@@ -6,7 +6,7 @@ import { DimensionalElement } from './base.js';
6
6
  * @returns a dimensional model instances
7
7
  * @internal
8
8
  */
9
- export declare function createAll(items: Array<any>): DimensionalElement[];
9
+ export declare function createAll(items: Array<any>): Element[];
10
10
  /**
11
11
  * Generate a dimension model instance out of the given JSON object
12
12
  *
@@ -14,4 +14,4 @@ export declare function createAll(items: Array<any>): DimensionalElement[];
14
14
  * @returns a dimensional model instance
15
15
  * @internal
16
16
  */
17
- export declare function create(item: any): DimensionalElement | DimensionalElement[];
17
+ export declare function create(item: any): Element | Element[];
@@ -89,6 +89,7 @@ declare abstract class AbstractFilter extends DimensionalElement implements Filt
89
89
  */
90
90
  readonly filterType: string;
91
91
  constructor(att: Attribute, filterType: string);
92
+ get name(): string;
92
93
  /**
93
94
  * Gets JAQL representing this Filter instance
94
95
  */
@@ -1,6 +1,17 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-return */
4
+ /* eslint-disable @typescript-eslint/no-throw-literal */
5
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
6
+ /* eslint-disable max-lines */
7
+ /* eslint-disable max-params */
8
+ /* eslint-disable @typescript-eslint/restrict-template-expressions */
9
+ /* eslint-disable max-lines-per-function */
10
+ /* eslint-disable complexity */
11
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
12
+ import hash from 'object-hash';
1
13
  import { DimensionalElement } from '../base.js';
2
14
  import { DateLevels, MetadataTypes } from '../types.js';
3
- import { Guid } from 'guid-typescript';
4
15
  import { create } from '../factory.js';
5
16
  import { DimensionalBaseMeasure } from '../measures/measures.js';
6
17
  /**
@@ -85,11 +96,14 @@ export const FilterTypes = {
85
96
  */
86
97
  class AbstractFilter extends DimensionalElement {
87
98
  constructor(att, filterType) {
88
- super(Guid.create().toString(), MetadataTypes.Filter);
99
+ super('filter', MetadataTypes.Filter);
89
100
  this.filterType = filterType;
90
101
  AbstractFilter.checkAttributeSupport(att);
91
102
  this.attribute = att;
92
103
  }
104
+ get name() {
105
+ return hash(this.jaql());
106
+ }
93
107
  /**
94
108
  * Gets a serializable representation of the element
95
109
  */
@@ -154,7 +154,7 @@ export interface QueryResultData {
154
154
  * @param arg
155
155
  * @internal
156
156
  */
157
- export declare function isDataSource(arg: DataSource | Data): arg is DataSource;
157
+ export declare function isDataSource(arg: DataSource | Data | undefined): arg is DataSource;
158
158
  /**
159
159
  * Trend formula options.
160
160
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sisense/sdk-data",
3
- "version": "0.11.3",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -12,9 +12,10 @@
12
12
  "author": "Sisense ",
13
13
  "license": "SEE LICENSE IN LICENSE.md",
14
14
  "dependencies": {
15
- "@sisense/sdk-rest-client": "^0.11.3",
15
+ "@sisense/sdk-rest-client": "^0.12.1",
16
16
  "guid-typescript": "^1.0.9",
17
- "numeral": "^2.0.6"
17
+ "numeral": "^2.0.6",
18
+ "object-hash": "^3.0.0"
18
19
  },
19
20
  "scripts": {
20
21
  "type-check": "tsc --noEmit",
@@ -37,6 +38,7 @@
37
38
  "devDependencies": {
38
39
  "@babel/preset-env": "^7.20.2",
39
40
  "@types/numeral": "2.0.2",
41
+ "@types/object-hash": "^3.0.5",
40
42
  "eslint": "^8.40.0",
41
43
  "prettier": "2.8.4",
42
44
  "typescript": "4.8.4"