@cube-dev/platform-client 0.10.0 → 0.11.0

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/CHANGELOG.md CHANGED
@@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  <!-- Curate public-facing entries here before the next release. -->
11
11
 
12
+ ## [0.11.0] - 2026-09-15
13
+ ### Added
14
+
15
+ - `FolderDto` gained `user` (CUB-4611) — the folder's owner, resolved the same way workbook owners are; `null` on a folder shared from the main workspace, which stays masked. Fixes the embed workspace's Owner column always rendering a dash, including for a folder the caller just created.
16
+ - `GenerateSession` gained `branchName` (CUB-4151) — the deployment branch an embed session queries. Omit it (or pass the deployment's production branch) for the production environment, which stays the default; any other branch of the deployment — one with a staging environment enabled, a shared branch, or a personal dev branch — points every Cube query the embedded dashboards, Creator Mode workspace and chat make at that branch's runtime (`<deploymentUrl>/dev-mode/{branchName}/cubejs-api/v1`) instead. The branch must be served when the session is generated: a name that is not a branch of the deployment returns `404`, and a branch nothing is running returns `400` — a branch without a staging environment is only running while someone has it open in Cube, so enable its staging environment for a branch an embedded app should reach at any time. Content is not branch-scoped: the same dashboards and workbooks are rendered against the chosen branch's data model. The embedded chat and AI widgets follow the session onto the branch as well, so an agent answers from the same data model the dashboards show.
17
+ - New public REST endpoint `POST /api/v1/embed/session/revoke` (`EmbedPublicController.revokeSession`) (CUB-4508) ends a signed embed session from the server side — call it from your application's logout handler with the `sessionId` that `POST /api/v1/embed/generate-session` returned. Works on either state a session can be in: an unexchanged id can no longer be redeemed via `POST /api/v1/embed/session/token`, and a token an already-exchanged id produced is rejected with `401` from that point on. Idempotent — revoking an unknown, expired, or already-revoked id also responds `204`, so the response alone never tells you whether a token was still revocable. That depends on Cube, not on the client library you call from: only tokens Cube issued after this endpoint shipped carry the revocation claim, and an older token keeps working until it expires on its own, within 24 hours. Requires admin access and that embedding be enabled for the account. New schema: `RevokeEmbedSessionInput`.
18
+
12
19
  ## [0.10.0] - 2026-09-14
13
20
  ### Added
14
21
 
package/dist/schema.d.ts CHANGED
@@ -1877,6 +1877,34 @@ export interface paths {
1877
1877
  patch?: never;
1878
1878
  trace?: never;
1879
1879
  };
1880
+ "/api/v1/embed/session/revoke": {
1881
+ parameters: {
1882
+ query?: never;
1883
+ header?: never;
1884
+ path?: never;
1885
+ cookie?: never;
1886
+ };
1887
+ get?: never;
1888
+ put?: never;
1889
+ /**
1890
+ * Revoke an embed session
1891
+ * @description **🔒 Admin only.** Requires administrator privileges — the authenticated principal (API key, embed JWT, or any bearer token) must belong to a user with the admin role.
1892
+ *
1893
+ * Ends an embed session from the server side — call it from your application's logout handler. Pass the `sessionId` that `POST /api/v1/embed/generate-session` returned.
1894
+ *
1895
+ * Works in either state the session can be in: an id that has not been exchanged yet can no longer be redeemed via `POST /api/v1/embed/session/token`, and the token an already-exchanged id produced is rejected with `401` from this moment on. The embedded iframe does not tear itself down — remove it on logout as before.
1896
+ *
1897
+ * Idempotent: revoking an unknown, expired or already-revoked id also responds `204` — so the response alone never tells you whether a token was still revocable. That depends on Cube, not on the client library you call from: only tokens Cube issued after this endpoint shipped carry the claim revocation is checked against, and an older token keeps working until it expires on its own, within 24 hours. A Cube API token the embed obtained from `POST /api/v1/deployments/{deploymentId}/token` is a separate credential and is not affected.
1898
+ *
1899
+ * Embedding must be enabled for the account, otherwise `403` is returned.
1900
+ */
1901
+ post: operations["EmbedPublicController.revokeSession"];
1902
+ delete?: never;
1903
+ options?: never;
1904
+ head?: never;
1905
+ patch?: never;
1906
+ trace?: never;
1907
+ };
1880
1908
  "/api/v1/embed/session/token": {
1881
1909
  parameters: {
1882
1910
  query?: never;
@@ -4428,6 +4456,7 @@ export interface components {
4428
4456
  type: components["schemas"]["FolderDtoType"];
4429
4457
  updatedAt: string;
4430
4458
  updatedBy?: number | null;
4459
+ user?: components["schemas"]["ResourceOwner"] | null;
4431
4460
  };
4432
4461
  /** @enum {string} */
4433
4462
  FolderDtoType: "FOLDER" | "WORKBOOK" | "REPORT";
@@ -4445,6 +4474,7 @@ export interface components {
4445
4474
  token: string;
4446
4475
  };
4447
4476
  GenerateSession: {
4477
+ branchName?: string | null;
4448
4478
  creatorMode?: boolean | null;
4449
4479
  deploymentId: number;
4450
4480
  email?: string | null;
@@ -5097,6 +5127,10 @@ export interface components {
5097
5127
  };
5098
5128
  /** @enum {string} */
5099
5129
  ResourceUserPolicyDtoAction: "All" | "DeploymentsManage" | "DeploymentCreate" | "DeploymentRead" | "DeploymentUpdate" | "DeploymentDelete" | "SecretsManage" | "DownloadData" | "PlaygroundRead" | "SchemaRead" | "SchemaUpdate" | "SchemaUpdateDevBranches" | "APMRead" | "ChatHistoryRead" | "PreAggregationBuild" | "AlertsCreate" | "AlertsRead" | "AlertsUpdate" | "AlertsDelete" | "AuditLogManage" | "BillingRead" | "SqlRunnerRead" | "DataAssetsRead" | "DataAssetsManage" | "CubeNetworkConnect" | "ReportRead" | "ReportEdit" | "ReportManage" | "WorkbookManage" | "WorkbookRead" | "WorkbookEdit" | "ChatThreadRead" | "AgentManage" | "AgentRead" | "AgentSpaceManage" | "AgentAdmin" | "DeploymentAgentRead" | "OAuthIntegrationsManage" | "OAuthIntegrationsIssueTokens" | "McpToolsManage" | "AIBIDevelop" | "AIBIExplore" | "AIBIView" | "ChartPalettesManage" | "DashboardThemesManage" | "AIBIDeveloper" | "AIBIUser" | "AIBIViewer" | "EmbedDeploymentRead" | "EmbedDashboardRead" | "FolderRead" | "FolderEdit" | "FolderManage";
5130
+ RevokeEmbedSessionInput: {
5131
+ /** @description The session id returned by `POST /api/v1/embed/generate-session`. Works whether or not the session has already been exchanged for a token. */
5132
+ sessionId: string;
5133
+ };
5100
5134
  RoleWithAccess: {
5101
5135
  actions: ("All" | "DeploymentsManage" | "DeploymentCreate" | "DeploymentRead" | "DeploymentUpdate" | "DeploymentDelete" | "SecretsManage" | "DownloadData" | "PlaygroundRead" | "SchemaRead" | "SchemaUpdate" | "SchemaUpdateDevBranches" | "APMRead" | "ChatHistoryRead" | "PreAggregationBuild" | "AlertsCreate" | "AlertsRead" | "AlertsUpdate" | "AlertsDelete" | "AuditLogManage" | "BillingRead" | "SqlRunnerRead" | "DataAssetsRead" | "DataAssetsManage" | "CubeNetworkConnect" | "ReportRead" | "ReportEdit" | "ReportManage" | "WorkbookManage" | "WorkbookRead" | "WorkbookEdit" | "ChatThreadRead" | "AgentManage" | "AgentRead" | "AgentSpaceManage" | "AgentAdmin" | "DeploymentAgentRead" | "OAuthIntegrationsManage" | "OAuthIntegrationsIssueTokens" | "McpToolsManage" | "AIBIDevelop" | "AIBIExplore" | "AIBIView" | "ChartPalettesManage" | "DashboardThemesManage" | "AIBIDeveloper" | "AIBIUser" | "AIBIViewer" | "EmbedDeploymentRead" | "EmbedDashboardRead" | "FolderRead" | "FolderEdit" | "FolderManage")[];
5102
5136
  id: number;
@@ -8703,6 +8737,38 @@ export interface operations {
8703
8737
  };
8704
8738
  };
8705
8739
  };
8740
+ "EmbedPublicController.revokeSession": {
8741
+ parameters: {
8742
+ query?: never;
8743
+ header?: never;
8744
+ path?: never;
8745
+ cookie?: never;
8746
+ };
8747
+ /** @description RevokeEmbedSessionInput */
8748
+ requestBody?: {
8749
+ content: {
8750
+ "application/json": components["schemas"]["RevokeEmbedSessionInput"];
8751
+ };
8752
+ };
8753
+ responses: {
8754
+ /** @description Successful response */
8755
+ 200: {
8756
+ headers: {
8757
+ [name: string]: any;
8758
+ };
8759
+ content: {
8760
+ "application/json": any;
8761
+ };
8762
+ };
8763
+ /** @description Session revoked, or did not exist. */
8764
+ 204: {
8765
+ headers: {
8766
+ [name: string]: any;
8767
+ };
8768
+ content?: never;
8769
+ };
8770
+ };
8771
+ };
8706
8772
  "EmbedPublicController.postTokenBySessionId": {
8707
8773
  parameters: {
8708
8774
  query?: never;