@gooddata/sdk-backend-tiger 11.35.0-alpha.5 → 11.35.0-alpha.6

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.
@@ -1,3 +1,3 @@
1
- export declare const LIB_VERSION = "11.35.0-alpha.5";
1
+ export declare const LIB_VERSION = "11.35.0-alpha.6";
2
2
  export declare const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
3
3
  export declare const LIB_NAME = "@gooddata/sdk-backend-tiger";
package/esm/__version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // (C) 2021 GoodData Corporation
2
2
  // DO NOT CHANGE THIS FILE, IT IS RE-GENERATED ON EVERY BUILD
3
- export const LIB_VERSION = "11.35.0-alpha.5";
3
+ export const LIB_VERSION = "11.35.0-alpha.6";
4
4
  export const LIB_DESCRIPTION = "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN";
5
5
  export const LIB_NAME = "@gooddata/sdk-backend-tiger";
@@ -1,6 +1,7 @@
1
1
  import { type IDashboardExportImageOptions, type IDashboardExportPdfOptions, type IDashboardExportPresentationOptions, type IDashboardExportRawOptions, type IDashboardExportTabularOptions, type IDashboardReferences, type IDashboardSummaryWorkflowStartResult, type IDashboardSummaryWorkflowStatusResult, type IDashboardWithReferences, type IDashboardsQuery, type IExportResult, type IGetDashboardOptions, type IGetDashboardPluginOptions, type IRawExportCustomOverrides, type IWorkspaceDashboardsService, type SupportedDashboardReferenceTypes } from "@gooddata/sdk-backend-spi";
2
- import { type FilterContextItem, type IDashboard, type IDashboardAttributeFilterConfig, type IDashboardBase, type IDashboardDefinition, type IDashboardFilterView, type IDashboardFilterViewSaveRequest, type IDashboardObjectIdentity, type IDashboardPermissions, type IDashboardPlugin, type IDashboardPluginDefinition, type IDashboardWidget, type IDateFilter, type IExecutionDefinition, type IFilter, type IFilterContext, type IListedDashboard, type IObjectCertificationWrite, type IWidget, type ObjRef } from "@gooddata/sdk-model";
2
+ import { type FilterContextItem, type IDashboard, type IDashboardAttributeFilterConfig, type IDashboardBase, type IDashboardDefinition, type IDashboardFilterView, type IDashboardFilterViewSaveRequest, type IDashboardObjectIdentity, type IDashboardPermissions, type IDashboardPlugin, type IDashboardPluginDefinition, type IDashboardTab, type IDashboardWidget, type IDateFilter, type IExecutionDefinition, type IFilter, type IFilterContext, type IListedDashboard, type IObjectCertificationWrite, type IWidget, type ObjRef } from "@gooddata/sdk-model";
3
3
  import { type FiltersByTab, type TigerAuthenticatedCallGuard } from "../../../types/index.js";
4
+ export declare function getDeletedDashboardTabs(originalTabs: IDashboardTab[], updatedTabs: IDashboardTab[]): IDashboardTab<IDashboardWidget>[];
4
5
  export declare class TigerWorkspaceDashboards implements IWorkspaceDashboardsService {
5
6
  private readonly authCall;
6
7
  readonly workspace: string;
@@ -80,6 +81,7 @@ export declare class TigerWorkspaceDashboards implements IWorkspaceDashboardsSer
80
81
  private processDashboardTabsFilterContexts;
81
82
  private processFilterContextUpdate;
82
83
  private updateFilterContext;
84
+ private deleteFilterContext;
83
85
  private getFilterContext;
84
86
  private prepareMetadata;
85
87
  }
@@ -1,10 +1,10 @@
1
1
  // (C) 2020-2026 GoodData Corporation
2
- import { isEmpty, isEqual } from "lodash-es";
2
+ import { differenceBy, isEmpty, isEqual } from "lodash-es";
3
3
  import { invariant } from "ts-invariant";
4
4
  import { v4 as uuid } from "uuid";
5
5
  import { AnalyticalDashboardModelV2, MetadataUtilities, ValidateRelationsHeader, isDashboardPluginsItem, isDataSetItem, isVisualizationObjectsItem, } from "@gooddata/api-client-tiger";
6
6
  import { ActionsApi_GetDependentEntitiesGraph, ActionsApi_SetCertification, } from "@gooddata/api-client-tiger/endpoints/actions";
7
- import { DashboardsApi_CreateEntityAnalyticalDashboards, DashboardsApi_DeleteEntityAnalyticalDashboards, DashboardsApi_GetAllEntitiesAnalyticalDashboards, DashboardsApi_GetEntityAnalyticalDashboards, DashboardsApi_PatchEntityAnalyticalDashboards, DashboardsApi_UpdateEntityAnalyticalDashboards, EntitiesApi_CreateEntityDashboardPlugins, EntitiesApi_DeleteEntityDashboardPlugins, EntitiesApi_GetAllEntitiesDashboardPlugins, EntitiesApi_GetAllEntitiesLabels, EntitiesApi_GetEntityDashboardPlugins, EntitiesApi_GetEntityWorkspaces, FilterContextApi_CreateEntityFilterContexts, FilterContextApi_GetEntityFilterContexts, FilterContextApi_UpdateEntityFilterContexts, FilterViewsApi_CreateEntityFilterViews, FilterViewsApi_DeleteEntityFilterViews, FilterViewsApi_GetAllEntitiesFilterViews, FilterViewsApi_GetEntityFilterViews, FilterViewsApi_PatchEntityFilterViews, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
7
+ import { DashboardsApi_CreateEntityAnalyticalDashboards, DashboardsApi_DeleteEntityAnalyticalDashboards, DashboardsApi_GetAllEntitiesAnalyticalDashboards, DashboardsApi_GetEntityAnalyticalDashboards, DashboardsApi_PatchEntityAnalyticalDashboards, DashboardsApi_UpdateEntityAnalyticalDashboards, EntitiesApi_CreateEntityDashboardPlugins, EntitiesApi_DeleteEntityDashboardPlugins, EntitiesApi_GetAllEntitiesDashboardPlugins, EntitiesApi_GetAllEntitiesLabels, EntitiesApi_GetEntityDashboardPlugins, EntitiesApi_GetEntityWorkspaces, FilterContextApi_CreateEntityFilterContexts, FilterContextApi_DeleteEntityFilterContexts, FilterContextApi_GetEntityFilterContexts, FilterContextApi_UpdateEntityFilterContexts, FilterViewsApi_CreateEntityFilterViews, FilterViewsApi_DeleteEntityFilterViews, FilterViewsApi_GetAllEntitiesFilterViews, FilterViewsApi_GetEntityFilterViews, FilterViewsApi_PatchEntityFilterViews, } from "@gooddata/api-client-tiger/endpoints/entitiesObjects";
8
8
  import { ExportApi_CreateDashboardExportRequest, ExportApi_CreateImageExport, ExportApi_CreatePdfExport, ExportApi_CreateRawExport, ExportApi_CreateSlidesExport, ExportApi_GetMetadata, ExportApi_GetSlidesExportMetadata, } from "@gooddata/api-client-tiger/endpoints/export";
9
9
  import { ProfileApi_GetCurrent } from "@gooddata/api-client-tiger/endpoints/profile";
10
10
  import { NotSupported, UnexpectedError, walkLayout, } from "@gooddata/sdk-backend-spi";
@@ -27,6 +27,9 @@ import { getSettingsForCurrentUser } from "../settings/index.js";
27
27
  import { buildDashboardPermissions } from "./dashboardPermissions.js";
28
28
  import { DashboardsQuery } from "./dashboardsQuery.js";
29
29
  import { resolveWidgetFilters, resolveWidgetFiltersWithMultipleDateFilters } from "./widgetFilters.js";
30
+ export function getDeletedDashboardTabs(originalTabs, updatedTabs) {
31
+ return differenceBy(originalTabs, updatedTabs, "localIdentifier");
32
+ }
30
33
  export class TigerWorkspaceDashboards {
31
34
  authCall;
32
35
  workspace;
@@ -284,7 +287,28 @@ export class TigerWorkspaceDashboards {
284
287
  * and return just `convertDashboard(result.data, filterContext);` below
285
288
  */
286
289
  const { id, type } = result.data.data;
287
- return this.getDashboard(idRef(id, type));
290
+ // This should ideally be named `updatedDashboard`, but this name is already taken above.
291
+ const dashboard = await this.getDashboard(idRef(id, type));
292
+ /**
293
+ * Perform a side-effect cleanup that deletes filter contexts of the deleted dashboard tabs. This should ideally be done
294
+ * on the backend, but due to complicated implementation it has been agreed per LX-2173 to be done on the frontend for now.
295
+ * Remove this if the backend handles this cleanup properly in the future.
296
+ *
297
+ * Currently the backend only cleans up filter contexts of tabs when the dashboard is deleted, but not when individual
298
+ * dashboard tabs are deleted, leaving orphaned filter contexts in the DB. Note that such orphans persist even when
299
+ * the whole dashboard is deleted, because on dashboard deletion, the backend cleans only filter contexts of _current_ tabs.
300
+ *
301
+ * The following code prevents the creation of new filter-context orphans.
302
+ */
303
+ getDeletedDashboardTabs(originalDashboard.tabs ?? [], dashboard.tabs ?? [])
304
+ .map(({ filterContext }) => filterContext)
305
+ .filter(isFilterContext)
306
+ .forEach((filterContext) => {
307
+ this.deleteFilterContext(filterContext).catch((error) => {
308
+ console.warn(`Failed to cleanup orphaned filter context`, filterContext.ref, error);
309
+ });
310
+ });
311
+ return dashboard;
288
312
  };
289
313
  /**
290
314
  * Starts AI dashboard summary workflow.
@@ -1020,6 +1044,13 @@ export class TigerWorkspaceDashboards {
1020
1044
  });
1021
1045
  return convertFilterContextFromBackend(result.data);
1022
1046
  };
1047
+ deleteFilterContext = async (filterContext) => {
1048
+ await this.authCall((client) => FilterContextApi_DeleteEntityFilterContexts(client.axios, client.basePath, {
1049
+ workspaceId: this.workspace,
1050
+ // Note that `this.authCall` is not actually used. See `objRefToIdentifier()` implementation for details.
1051
+ objectId: objRefToIdentifier(filterContext.ref, this.authCall),
1052
+ }));
1053
+ };
1023
1054
  getFilterContext = async (filterContextRef) => {
1024
1055
  const filterContextId = objRefToIdentifier(filterContextRef, this.authCall);
1025
1056
  const result = await this.authCall((client) => {
@@ -16,7 +16,7 @@ export declare class ChatConversationsService implements IChatConversations {
16
16
  });
17
17
  getConversationItemsQuery(): IChatConversationItemsQuery;
18
18
  create(): Promise<IChatConversation>;
19
- update(conversationId: string, update: Partial<Pick<IChatConversation, "title">>): Promise<IChatConversation>;
19
+ update(conversationId: string, update: Partial<Pick<IChatConversation, "title" | "pinned">>): Promise<IChatConversation>;
20
20
  delete(conversationId: string): Promise<void>;
21
21
  generateTitle(conversationId: string): Promise<IChatConversation>;
22
22
  getConversation(conversationId: string): Promise<IChatConversation>;
@@ -94,6 +94,7 @@ function convertDashboardTabContent(tab, filterContext) {
94
94
  attributeFilterConfigs: cloneWithSanitizedIdsTyped(tab.attributeFilterConfigs),
95
95
  measureValueFilterConfigs: cloneWithSanitizedIdsTyped(tab.measureValueFilterConfigs),
96
96
  filterGroupsConfig: cloneWithSanitizedIds(tab.filterGroupsConfig),
97
+ parameters: tab.parameters?.map(convertDashboardParameter),
97
98
  };
98
99
  }
99
100
  function convertDashboardTab(tab, filterContextsList, filterContextOverride) {
@@ -13,6 +13,7 @@ export function convertChatConversationFromBackend(conversation) {
13
13
  createdAt: conversation.createdAt,
14
14
  updatedAt: conversation.lastActivityAt,
15
15
  title: conversation.title ?? undefined,
16
+ pinned: conversation.pinned,
16
17
  };
17
18
  }
18
19
  export function convertChatConversationItemFromBackend(item, responses, dateNormalizer, locale, timezone) {
@@ -73,6 +73,7 @@ function convertDashboardTabToBackend(tab, filterContextRef, useWidgetLocalIdent
73
73
  attributeFilterConfigs: cloneWithSanitizedIdsTyped(tab.attributeFilterConfigs),
74
74
  measureValueFilterConfigs: cloneWithSanitizedIdsTyped(tab.measureValueFilterConfigs),
75
75
  filterGroupsConfig: cloneWithSanitizedIds(tab.filterGroupsConfig),
76
+ parameters: tab.parameters?.map(convertDashboardParameterToBackend),
76
77
  };
77
78
  }
78
79
  /**
@@ -92,6 +93,7 @@ export function convertAnalyticalDashboard(dashboard, filterContextRef, useWidge
92
93
  let effectiveDateFilterConfigs = dashboard.dateFilterConfigs;
93
94
  let effectiveAttributeFilterConfigs = dashboard.attributeFilterConfigs;
94
95
  let effectiveMeasureValueFilterConfigs = dashboard.measureValueFilterConfigs;
96
+ let effectiveParameters = dashboard.parameters;
95
97
  if (dashboard.tabs && dashboard.tabs.length > 0) {
96
98
  const effectiveTab = dashboard.tabs[0];
97
99
  // Use tab's properties for root-level (backward compatibility)
@@ -100,6 +102,7 @@ export function convertAnalyticalDashboard(dashboard, filterContextRef, useWidge
100
102
  effectiveDateFilterConfigs = effectiveTab.dateFilterConfigs;
101
103
  effectiveAttributeFilterConfigs = effectiveTab.attributeFilterConfigs;
102
104
  effectiveMeasureValueFilterConfigs = effectiveTab.measureValueFilterConfigs;
105
+ effectiveParameters = effectiveTab.parameters;
103
106
  }
104
107
  const layout = convertLayout(false, removeWidgetIdentifiersInLayout(effectiveLayout, useWidgetLocalIdentifiers));
105
108
  const result = {
@@ -110,7 +113,7 @@ export function convertAnalyticalDashboard(dashboard, filterContextRef, useWidge
110
113
  filterContextRef: cloneWithSanitizedIds(filterContextRef),
111
114
  layout: cloneWithSanitizedIdsTyped(layout),
112
115
  plugins: dashboard.plugins?.map(convertDashboardPluginLinkToBackend),
113
- parameters: dashboard.parameters?.map(convertDashboardParameterToBackend),
116
+ parameters: effectiveParameters?.map(convertDashboardParameterToBackend),
114
117
  disableCrossFiltering: dashboard.disableCrossFiltering,
115
118
  disableUserFilterReset: dashboard.disableUserFilterReset,
116
119
  disableUserFilterSave: dashboard.disableUserFilterSave,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-tiger",
3
- "version": "11.35.0-alpha.5",
3
+ "version": "11.35.0-alpha.6",
4
4
  "description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -33,12 +33,12 @@
33
33
  "ts-invariant": "0.10.3",
34
34
  "tslib": "2.8.1",
35
35
  "uuid": "11.1.0",
36
- "@gooddata/api-client-tiger": "11.35.0-alpha.5",
37
- "@gooddata/sdk-backend-base": "11.35.0-alpha.5",
38
- "@gooddata/sdk-backend-spi": "11.35.0-alpha.5",
39
- "@gooddata/sdk-model": "11.35.0-alpha.5",
40
- "@gooddata/sdk-code-convertors": "11.35.0-alpha.5",
41
- "@gooddata/util": "11.35.0-alpha.5"
36
+ "@gooddata/api-client-tiger": "11.35.0-alpha.6",
37
+ "@gooddata/sdk-backend-base": "11.35.0-alpha.6",
38
+ "@gooddata/sdk-code-convertors": "11.35.0-alpha.6",
39
+ "@gooddata/sdk-model": "11.35.0-alpha.6",
40
+ "@gooddata/sdk-backend-spi": "11.35.0-alpha.6",
41
+ "@gooddata/util": "11.35.0-alpha.6"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@gooddata/fixtures": "3.3.12",
@@ -65,10 +65,10 @@
65
65
  "oxlint-tsgolint": "0.11.4",
66
66
  "typescript": "5.9.3",
67
67
  "vitest": "4.1.0",
68
- "@gooddata/eslint-config": "11.35.0-alpha.5",
69
- "@gooddata/catalog-export": "11.35.0-alpha.5",
70
- "@gooddata/reference-workspace": "11.35.0-alpha.5",
71
- "@gooddata/oxlint-config": "11.35.0-alpha.5"
68
+ "@gooddata/catalog-export": "11.35.0-alpha.6",
69
+ "@gooddata/eslint-config": "11.35.0-alpha.6",
70
+ "@gooddata/reference-workspace": "11.35.0-alpha.6",
71
+ "@gooddata/oxlint-config": "11.35.0-alpha.6"
72
72
  },
73
73
  "scripts": {
74
74
  "_phase:build": "npm run build",
@@ -79,7 +79,7 @@
79
79
  "build-check": "tsgo",
80
80
  "build-dynamic-files": "bash scripts/build.sh --genFilesOnly",
81
81
  "build-ts": "tsgo -p tsconfig.build.json",
82
- "clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage *.log tsconfig.tsbuildinfo",
82
+ "clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage temp *.log tsconfig.tsbuildinfo",
83
83
  "clear-recordings": "./scripts/clear-recordings.sh",
84
84
  "create-ref-workspaces": "node ./tests/reference_workspace/create_test_workspaces.mjs",
85
85
  "delete-ref-workspaces": "node ./tests/reference_workspace/delete_test_workspaces.mjs",