Sign In

@sisense/sdk-data

Package Overview
Dependencies
Maintainers
3
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sisense/sdk-data - npm Package Compare versions

Comparing version
2.33.1
to
2.34.0
+15
-4
dist/cjs/dimensional-model/attributes/attributes.js

@@ -397,2 +397,8 @@ "use strict";

/**
* Decoration appended to the dimension expression of a datetime field
* (`[Table.Column (Calendar)]`). It is added for display and is not part of any data model key, so a
* calendar dimension needs an explicit table/column reference to stay resolvable.
*/
const CALENDAR_DIM_SUFFIX = '(Calendar)';
/**
* Represents a Calculated Attribute (a calculated dimension) in a Dimensional Model.

@@ -493,6 +499,11 @@ *

// (the way the UI does). Non-date attributes carry no granularity keys, so they are untouched.
const hasDateGranularity = entry &&
typeof entry === 'object' &&
('level' in entry || 'dateTimeLevel' in entry || 'bucket' in entry);
if (hasDateGranularity) {
//
// A calendar dimension can also arrive with no granularity at all — that is how a raw date
// operand is rebuilt when a Fusion widget or filter is translated. There is no level to strip
// then, but the reference is still needed, so that the dimension is described the same way
// whichever path built it.
const isObjectEntry = entry && typeof entry === 'object';
const hasDateGranularity = isObjectEntry && ('level' in entry || 'dateTimeLevel' in entry || 'bucket' in entry);
const isCalendarDim = isObjectEntry && typeof entry.dim === 'string' && entry.dim.includes(CALENDAR_DIM_SUFFIX);
if (hasDateGranularity || isCalendarDim) {
// When the entry is the raw context object (no `jaql()` method), clone it before mutating

@@ -499,0 +510,0 @@ // so the consumer-provided input is never modified. Objects returned by `jaql(true)` are

@@ -385,2 +385,8 @@ /* eslint-disable max-params */

/**
* Decoration appended to the dimension expression of a datetime field
* (`[Table.Column (Calendar)]`). It is added for display and is not part of any data model key, so a
* calendar dimension needs an explicit table/column reference to stay resolvable.
*/
const CALENDAR_DIM_SUFFIX = '(Calendar)';
/**
* Represents a Calculated Attribute (a calculated dimension) in a Dimensional Model.

@@ -481,6 +487,11 @@ *

// (the way the UI does). Non-date attributes carry no granularity keys, so they are untouched.
const hasDateGranularity = entry &&
typeof entry === 'object' &&
('level' in entry || 'dateTimeLevel' in entry || 'bucket' in entry);
if (hasDateGranularity) {
//
// A calendar dimension can also arrive with no granularity at all — that is how a raw date
// operand is rebuilt when a Fusion widget or filter is translated. There is no level to strip
// then, but the reference is still needed, so that the dimension is described the same way
// whichever path built it.
const isObjectEntry = entry && typeof entry === 'object';
const hasDateGranularity = isObjectEntry && ('level' in entry || 'dateTimeLevel' in entry || 'bucket' in entry);
const isCalendarDim = isObjectEntry && typeof entry.dim === 'string' && entry.dim.includes(CALENDAR_DIM_SUFFIX);
if (hasDateGranularity || isCalendarDim) {
// When the entry is the raw context object (no `jaql()` method), clone it before mutating

@@ -487,0 +498,0 @@ // so the consumer-provided input is never modified. Objects returned by `jaql(true)` are

@@ -14,3 +14,3 @@ {

],
"version": "2.33.1",
"version": "2.34.0",
"type": "module",

@@ -31,3 +31,3 @@ "main": "./dist/cjs/index.js",

"dependencies": {
"@sisense/sdk-common": "2.33.1",
"@sisense/sdk-common": "2.34.0",
"hash-it": "^6.0.0",

@@ -34,0 +34,0 @@ "lodash-es": "^4.17.21"

Sorry, the diff of this file is not supported yet