@gooddata/sdk-backend-tiger 11.57.0-alpha.2 → 11.57.0-alpha.3

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,4 +1,4 @@
1
- export declare const LIB_VERSION = "11.57.0-alpha.2";
1
+ export declare const LIB_VERSION = "11.57.0-alpha.3";
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";
4
4
  //# sourceMappingURL=__version.d.ts.map
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.57.0-alpha.2";
3
+ export const LIB_VERSION = "11.57.0-alpha.3";
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,4 +1,5 @@
1
1
  // (C) 2019-2026 GoodData Corporation
2
+ import axios from "axios";
2
3
  import { inRange, isEmpty, isError, omit } from "lodash-es";
3
4
  import { invariant } from "ts-invariant";
4
5
  import { newAxios, tigerClientBaseFactory } from "@gooddata/api-client-tiger";
@@ -287,6 +288,11 @@ function createAxios(config, implConfig, telemetry) {
287
288
  function interceptBackendErrorsToConsole(client) {
288
289
  client.interceptors.response.use((v) => v, (error) => {
289
290
  const response = error.response;
291
+ // Cancellations are expected whenever a component aborts its in-flight requests
292
+ // on unmount; logging them as backend errors only floods the console.
293
+ if (axios.isCancel(error)) {
294
+ return Promise.reject(error);
295
+ }
290
296
  // If there is no response object (for example for blocked requests), print the whole error.
291
297
  if (!response) {
292
298
  console.error("Tiger backend threw an error:", error);
@@ -1,5 +1,5 @@
1
1
  import { type IGetInsightOptions, type IInsightReferences, type IInsightReferencing, type IInsightsQuery, type IInsightsQueryOptions, type IInsightsQueryResult, type IWorkspaceInsightsService, type SupportedInsightReferenceTypes } from "@gooddata/sdk-backend-spi";
2
- import { type ICatalogAttribute, type ICatalogFact, type ICatalogMeasure, type IFilter, type IInsight, type IInsightDefinition, type IMetadataObjectBase, type IMetadataObjectIdentity, type IObjectCertificationWrite, type IVisualizationClass, type ObjRef } from "@gooddata/sdk-model";
2
+ import { type ICatalogAttribute, type ICatalogFact, type ICatalogMeasure, type IFilter, type IInsight, type IInsightDefinition, type IInsightDefinitionWithOptionalIdentity, type IMetadataObjectBase, type IMetadataObjectIdentity, type IObjectCertificationWrite, type IVisualizationClass, type ObjRef } from "@gooddata/sdk-model";
3
3
  import { type TigerAuthenticatedCallGuard } from "../../../types/index.js";
4
4
  export declare class TigerWorkspaceInsights implements IWorkspaceInsightsService {
5
5
  private readonly authCall;
@@ -21,7 +21,7 @@ export declare class TigerWorkspaceInsights implements IWorkspaceInsightsService
21
21
  }>;
22
22
  private getInsightWithReferences;
23
23
  getInsight: (ref: ObjRef, options?: IGetInsightOptions) => Promise<IInsight>;
24
- createInsight: (insight: IInsightDefinition) => Promise<IInsight>;
24
+ createInsight: (insight: IInsightDefinitionWithOptionalIdentity, generateId?: boolean) => Promise<IInsight>;
25
25
  updateInsight: (insight: IInsight) => Promise<IInsight>;
26
26
  updateInsightMeta: (insightMeta: Partial<IMetadataObjectBase> & IMetadataObjectIdentity) => Promise<IInsight>;
27
27
  setCertification: (ref: ObjRef, certification?: IObjectCertificationWrite) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/backend/workspace/insights/index.ts"],"names":[],"mappings":"AA+BA,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EAEtC,MAAM,2BAA2B,C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O,CAAC,CAAC,CAAC,CASX;CACL"}
@@ -151,12 +151,15 @@ export class TigerWorkspaceInsights {
151
151
  const { insight } = await this.getInsightWithReferences(ref, references);
152
152
  return insight;
153
153
  };
154
- createInsight = async (insight) => {
154
+ createInsight = async (insight, generateId = true) => {
155
155
  const createResponse = await this.authCall((client) => {
156
156
  return EntitiesApi_CreateEntityVisualizationObjects(client.axios, client.basePath, {
157
157
  workspaceId: this.workspace,
158
158
  jsonApiVisualizationObjectPostOptionalIdDocument: {
159
159
  data: {
160
+ ...(generateId || !insight.insight.identifier
161
+ ? {}
162
+ : { id: insight.insight.identifier }),
160
163
  type: "visualizationObject",
161
164
  attributes: {
162
165
  description: insightSummary(insight),
@@ -609,15 +609,19 @@ function buildDashboardReferences(aacDashboard, references, savedDashboardId) {
609
609
  const filters = data?.filterContext
610
610
  ? convertFilterContextFromBackend(buildFilterContextWrapper(data.filterContext))
611
611
  : undefined;
612
- const vis = [...(references?.visualizations ?? []), ...(references?.new_visualizations ?? [])];
613
- const insights = vis.map((vis) => {
612
+ const existingInsights = (references?.visualizations ?? []).map((vis) => {
614
613
  return visualizationObjectsItemToInsight(yamlVisualisationToMetadataObject(entities, vis));
615
614
  }) ?? [];
615
+ const newInsights = (references?.new_visualizations ?? []).map((vis) => {
616
+ const insight = visualizationObjectsItemToInsight(yamlVisualisationToMetadataObject(entities, vis));
617
+ insight.insight.isDraft = true;
618
+ return insight;
619
+ }) ?? [];
616
620
  const dashboard = data
617
621
  ? convertDashboard(buildDashboardWrapper(data.dashboard, data.tabFilterContexts, savedDashboardId), filters)
618
622
  : null;
619
623
  return {
620
624
  dashboard,
621
- insights,
625
+ insights: [...existingInsights, ...newInsights],
622
626
  };
623
627
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-backend-tiger",
3
- "version": "11.57.0-alpha.2",
3
+ "version": "11.57.0-alpha.3",
4
4
  "description": "GoodData Backend SPI implementation for GoodData Cloud and GoodData.CN",
5
5
  "license": "MIT",
6
6
  "author": "GoodData",
@@ -34,12 +34,12 @@
34
34
  "ts-invariant": "0.10.3",
35
35
  "tslib": "2.8.1",
36
36
  "uuid": "11.1.1",
37
- "@gooddata/sdk-backend-spi": "11.57.0-alpha.2",
38
- "@gooddata/api-client-tiger": "11.57.0-alpha.2",
39
- "@gooddata/sdk-code-convertors": "11.57.0-alpha.2",
40
- "@gooddata/util": "11.57.0-alpha.2",
41
- "@gooddata/sdk-backend-base": "11.57.0-alpha.2",
42
- "@gooddata/sdk-model": "11.57.0-alpha.2"
37
+ "@gooddata/api-client-tiger": "11.57.0-alpha.3",
38
+ "@gooddata/sdk-backend-spi": "11.57.0-alpha.3",
39
+ "@gooddata/sdk-backend-base": "11.57.0-alpha.3",
40
+ "@gooddata/sdk-model": "11.57.0-alpha.3",
41
+ "@gooddata/sdk-code-convertors": "11.57.0-alpha.3",
42
+ "@gooddata/util": "11.57.0-alpha.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@gooddata/fixtures": "3.7.0",
@@ -59,15 +59,15 @@
59
59
  "eslint-plugin-sonarjs": "3.0.6",
60
60
  "npm-run-all": "4.1.5",
61
61
  "oxfmt": "0.66.0",
62
- "oxlint": "1.66.0",
62
+ "oxlint": "1.67.0",
63
63
  "oxlint-plugin-eslint": "1.82.0",
64
- "oxlint-tsgolint": "0.18.1",
64
+ "oxlint-tsgolint": "0.22.1",
65
65
  "typescript": "7.0.2",
66
66
  "vitest": "4.1.8",
67
- "@gooddata/catalog-export": "11.57.0-alpha.2",
68
- "@gooddata/oxlint-config": "11.57.0-alpha.2",
69
- "@gooddata/eslint-config": "11.57.0-alpha.2",
70
- "@gooddata/reference-workspace": "11.57.0-alpha.2"
67
+ "@gooddata/eslint-config": "11.57.0-alpha.3",
68
+ "@gooddata/catalog-export": "11.57.0-alpha.3",
69
+ "@gooddata/oxlint-config": "11.57.0-alpha.3",
70
+ "@gooddata/reference-workspace": "11.57.0-alpha.3"
71
71
  },
72
72
  "scripts": {
73
73
  "_phase:build": "npm run build",