@gooddata/sdk-ui-pluggable-application 11.64.0-alpha.0 → 11.64.0-alpha.2

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.
package/esm/backend.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type CacheControl } from "@gooddata/sdk-backend-base";
1
2
  import { type IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
2
3
  import { type IAuthCredentials } from "@gooddata/sdk-pluggable-application-model";
3
4
  /**
@@ -14,6 +15,11 @@ export interface ICreateBackendForModuleOptions {
14
15
  * Package version reported to the backend for telemetry.
15
16
  */
16
17
  packageVersion?: string;
18
+ /**
19
+ * Receives the cache control of the created backend, so the module can reset its caches, for
20
+ * example when an embedded editor changes a metric.
21
+ */
22
+ onCacheReady?: (cacheControl: CacheControl) => void;
17
23
  }
18
24
  /**
19
25
  * Creates an analytical backend instance from the platform context auth credentials.
@@ -1 +1 @@
1
- {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMpE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,8BAA8B,GACxC,kBAAkB,CAuBpB"}
1
+ {"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../src/backend.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAgD,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMpE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC3C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,IAAI,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,sBAAsB,CAClC,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,8BAA8B,GACxC,kBAAkB,CAkBpB"}
package/esm/backend.js CHANGED
@@ -30,12 +30,13 @@ export function createBackendForModule(auth, options) {
30
30
  packageName: options.packageName,
31
31
  packageVersion: options.packageVersion ?? "unknown",
32
32
  });
33
+ const caching = { ...RecommendedCachingConfiguration, onCacheReady: options.onCacheReady };
33
34
  switch (auth.type) {
34
35
  case "apiToken":
35
36
  case "jwt":
36
- return withCaching(base.withAuthentication(new TigerTokenAuthProvider(auth.token)), RecommendedCachingConfiguration);
37
+ return withCaching(base.withAuthentication(new TigerTokenAuthProvider(auth.token)), caching);
37
38
  case "contextDeferred":
38
- return withCaching(base.withAuthentication(new ContextDeferredAuthProvider()), RecommendedCachingConfiguration);
39
+ return withCaching(base.withAuthentication(new ContextDeferredAuthProvider()), caching);
39
40
  default: {
40
41
  throw new Error(`[sdk-ui-pluggable-application/backend] Unsupported auth type "${String(auth.type)}".`);
41
42
  }
@@ -4,6 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
 
7
+ import { CacheControl } from '@gooddata/sdk-backend-base';
7
8
  import { IAnalyticalBackend } from '@gooddata/sdk-backend-spi';
8
9
  import { IAuthCredentials } from '@gooddata/sdk-pluggable-application-model';
9
10
  import { IHostNavigationRequest } from '@gooddata/sdk-pluggable-application-model';
@@ -177,6 +178,11 @@ export declare interface ICreateBackendForModuleOptions {
177
178
  * Package version reported to the backend for telemetry.
178
179
  */
179
180
  packageVersion?: string;
181
+ /**
182
+ * Receives the cache control of the created backend, so the module can reset its caches, for
183
+ * example when an embedded editor changes a metric.
184
+ */
185
+ onCacheReady?: (cacheControl: CacheControl) => void;
180
186
  }
181
187
 
182
188
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddata/sdk-ui-pluggable-application",
3
- "version": "11.64.0-alpha.0",
3
+ "version": "11.64.0-alpha.2",
4
4
  "description": "GoodData SDK React helpers for pluggable applications",
5
5
  "license": "MIT",
6
6
  "author": "GoodData Corporation",
@@ -24,12 +24,12 @@
24
24
  "react-intl": "10.1.25",
25
25
  "ts-invariant": "0.10.3",
26
26
  "tslib": "2.8.1",
27
- "@gooddata/sdk-backend-base": "11.64.0-alpha.0",
28
- "@gooddata/sdk-backend-spi": "11.64.0-alpha.0",
29
- "@gooddata/sdk-model": "11.64.0-alpha.0",
30
- "@gooddata/sdk-backend-tiger": "11.64.0-alpha.0",
31
- "@gooddata/sdk-ui": "11.64.0-alpha.0",
32
- "@gooddata/sdk-pluggable-application-model": "11.64.0-alpha.0"
27
+ "@gooddata/sdk-backend-base": "11.64.0-alpha.2",
28
+ "@gooddata/sdk-backend-tiger": "11.64.0-alpha.2",
29
+ "@gooddata/sdk-model": "11.64.0-alpha.2",
30
+ "@gooddata/sdk-pluggable-application-model": "11.64.0-alpha.2",
31
+ "@gooddata/sdk-backend-spi": "11.64.0-alpha.2",
32
+ "@gooddata/sdk-ui": "11.64.0-alpha.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@microsoft/api-documenter": "7.30.16",
@@ -58,8 +58,8 @@
58
58
  "react-dom": "19.1.1",
59
59
  "typescript": "7.0.2",
60
60
  "vitest": "5.0.4",
61
- "@gooddata/eslint-config": "11.64.0-alpha.0",
62
- "@gooddata/oxlint-config": "11.64.0-alpha.0"
61
+ "@gooddata/eslint-config": "11.64.0-alpha.2",
62
+ "@gooddata/oxlint-config": "11.64.0-alpha.2"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "react": "^18.0.0 || ^19.0.0",