@cube-dev/platform-client 0.5.0 → 0.6.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,26 @@ 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.6.0] - 2026-09-02
13
+ ### Added
14
+
15
+ - `User` (`GET /api/v1/users/me`, `UsersPublicController.getMe`) gained `userPolicies` — the caller's effective resource policies: direct grants, organization-wide grants and grants inherited from their groups. This is the set the console has always read over GraphQL; on REST it lets an embedded Creator Mode session resolve a workbook another embed user shared with it, which previously granted nothing beyond viewing. New schemas: `Policy`, `PolicyResourceType`.
16
+ - Re-added `POST /api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/ai-widget-thread` (`WorkbooksPublicController.updatePublishedDashboardAiWidgetThread`) and its `UpdatePublishedAiWidgetThreadInput` schema (`widgetId`, `threadId`, optional `checksum`) — reverting the `0.4.0` removal. Regenerating an AI-analysis widget on a **published** dashboard persists the new thread id (+ checksum) back to the published config so an immediate reload shows the fresh result instead of the stale one. It stores **only** the thread id and checksum — never summary text (CUB-4031).
17
+ - `PATCH /api/v1/users/me/settings` (`UsersPublicController.updateMySettings`) — merge a partial patch into your own settings; omitted fields are left as they are, and `sheets` merges field-by-field (an explicit `null` clears it). `UserSettingsInput` gained `sheets`. New schema: `SheetsUserSettingsInput` (`autoRunQueryOnChange`, `openExplorationFromSheet`, `revealSheetOnOpen`, `showAppliedFilters`, `suppressDuplicateValues`).
18
+ - `POST /api/v1/deployments/{id}/token` (`DeploymentsPublicController.deploymentToken`) now accepts an optional body to request a shorter token lifetime than the 24-hour default. New schema: `CreateDeploymentTokenInput` (`expiresIn`, 60–86400 seconds) — recommended for tokens held outside a browser session (scripts, BI tools, scheduled jobs).
19
+ - `AppTheme` / `AppThemeResponse` (`GET /api/v1/app-theme`, `GET /api/v1/app-config`) gained `palette` and `logoUrl` — the new theme model: base/accent color seeds, contrast level, a pastel toggle, surface mode, and per-semantic color overrides (danger/warning/success/note/code). New schemas: `AppThemePalette`, `AppThemePaletteSeed`, `AppThemePaletteThemes`, `AppThemeCodePalette`, `AppThemeSurfaceMode`.
20
+ - `DashboardWidgetDtoType` / `DashboardWidgetInputType` gained a new `"FIELD"` enum value, for the Field switcher dashboard control.
21
+ - `ReportPlacement` gained `queryChecksum` and `syncStatus` (new schema `ReportPlacementSyncStatus`: `"UP_TO_DATE"` | `"CHANGED"` | `"UNKNOWN"`), and `Report` gained `currentQueryChecksum` — together they let a client tell whether the cells at a placement still reflect the exploration as it stands now.
22
+
23
+ ### Changed
24
+
25
+ - `POST /api/v1/usage-analytics/token` — corrected docs: tokens expire after 1 hour, not ~24 hours as previously stated. `expiresAt` on the response has always reflected the real value.
26
+
27
+ ### Deprecated
28
+
29
+ - `AppTheme.light` / `AppTheme.dark` — use `palette` and `logoUrl` instead.
30
+ - `UserSettingsInput.lastSeenChangelogId` — ignored; the changelog now arrives in the notification inbox, which carries its own read state. Accepted for backward compatibility but never read or written.
31
+
12
32
  ## [0.5.0] - 2026-08-30
13
33
 
14
34
  ### Added
@@ -75,7 +95,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
75
95
 
76
96
  ### Removed
77
97
 
78
- - **BREAKING:** `POST /api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/ai-widget-thread` (`WorkbooksPublicController.updatePublishedDashboardAiWidgetThread`) and its `UpdatePublishedAiWidgetThreadInput` schema (added in `0.2.0`). It persisted an AI-analysis thread id + checksum into the published dashboard config — the mechanism that caused read-only/anonymous viewers to hit `WorkbookEdit`/403s and let one viewer's filter state clobber the shared config (CUB-3898). AI-analysis results are now cached server-side keyed by dashboard state, so no client-facing endpoint replaces it. This is a deliberate breaking removal; SDK consumers referencing the operation or schema should drop those references.
98
+ - **BREAKING:** `POST /api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/ai-widget-thread` (`WorkbooksPublicController.updatePublishedDashboardAiWidgetThread`) and its `UpdatePublishedAiWidgetThreadInput` schema (added in `0.2.0`). It persisted an AI-analysis thread id + checksum into the published dashboard config — the mechanism that caused read-only/anonymous viewers to hit `WorkbookEdit`/403s and let one viewer's filter state clobber the shared config (CUB-3898). AI-analysis results are recovered by replaying the chat thread whose id the dashboard config stores, so no client-facing endpoint replaces it (CUB-4031). This is a deliberate breaking removal; SDK consumers referencing the operation or schema should drop those references.
79
99
 
80
100
  ## [0.3.0] - 2026-07-30
81
101
 
package/dist/schema.d.ts CHANGED
@@ -1037,6 +1037,23 @@ export interface paths {
1037
1037
  patch?: never;
1038
1038
  trace?: never;
1039
1039
  };
1040
+ "/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/dashboard/ai-widget-thread": {
1041
+ parameters: {
1042
+ query?: never;
1043
+ header?: never;
1044
+ path?: never;
1045
+ cookie?: never;
1046
+ };
1047
+ get?: never;
1048
+ put?: never;
1049
+ /** Update published dashboard ai widget thread */
1050
+ post: operations["WorkbooksPublicController.updatePublishedDashboardAiWidgetThread"];
1051
+ delete?: never;
1052
+ options?: never;
1053
+ head?: never;
1054
+ patch?: never;
1055
+ trace?: never;
1056
+ };
1040
1057
  "/api/v1/deployments/{deploymentId}/workbooks/{workbookId}/duplicate": {
1041
1058
  parameters: {
1042
1059
  query?: never;
@@ -2039,7 +2056,7 @@ export interface paths {
2039
2056
  *
2040
2057
  * The token is scoped to your account: it carries the same server-resolved security context as the embedded Usage Analytics page, so queries only ever see your own data. Send it as `Authorization: Bearer <token>` on requests to the returned `apiUrl` (the deployment's [Cube REST API](https://cube.dev/docs/product/apis-integrations/rest-api)).
2041
2058
  *
2042
- * Tokens expire after ~24 hours (see `expiresAt`). Issue a fresh one per session or scheduled refresh — issuing is idempotent and cheap.
2059
+ * Tokens expire after 1 hour (see `expiresAt`). Issue a fresh one per session or scheduled refresh — issuing is idempotent and cheap.
2043
2060
  *
2044
2061
  * Requires Usage Analytics to be enabled for the account, otherwise `404` is returned.
2045
2062
  */
@@ -2288,6 +2305,26 @@ export interface paths {
2288
2305
  patch?: never;
2289
2306
  trace?: never;
2290
2307
  };
2308
+ "/api/v1/users/me/settings": {
2309
+ parameters: {
2310
+ query?: never;
2311
+ header?: never;
2312
+ path?: never;
2313
+ cookie?: never;
2314
+ };
2315
+ get?: never;
2316
+ put?: never;
2317
+ post?: never;
2318
+ delete?: never;
2319
+ options?: never;
2320
+ head?: never;
2321
+ /**
2322
+ * Update my settings
2323
+ * @description Merge a partial patch into the authenticated user's own settings. Omitted fields are left as they are; `sheets` merges field-by-field, and an explicit `null` clears it.
2324
+ */
2325
+ patch: operations["UsersPublicController.updateMySettings"];
2326
+ trace?: never;
2327
+ };
2291
2328
  "/api/v1/users/{id}": {
2292
2329
  parameters: {
2293
2330
  query?: never;
@@ -2709,18 +2746,61 @@ export interface components {
2709
2746
  timezoneSettings?: components["schemas"]["TimezoneSettings"] | null;
2710
2747
  };
2711
2748
  AppTheme: {
2749
+ /**
2750
+ * @deprecated
2751
+ * @description Deprecated: use palette and logoUrl instead.
2752
+ */
2712
2753
  dark: components["schemas"]["AppThemeScheme"];
2754
+ /**
2755
+ * @deprecated
2756
+ * @description Deprecated: use palette and logoUrl instead.
2757
+ */
2713
2758
  light: components["schemas"]["AppThemeScheme"];
2759
+ logoUrl: string;
2760
+ palette: components["schemas"]["AppThemePalette"];
2714
2761
  typography?: components["schemas"]["AppThemeTypography"] | null;
2715
2762
  };
2763
+ AppThemeCodePalette: {
2764
+ saturation?: number | null;
2765
+ };
2716
2766
  AppThemeFontRef: {
2717
2767
  fontRef: string;
2718
2768
  fontWeight: number;
2719
2769
  };
2770
+ AppThemePalette: {
2771
+ accent?: components["schemas"]["AppThemePaletteSeed"] | null;
2772
+ base?: components["schemas"]["AppThemePaletteSeed"] | null;
2773
+ contrastLevel?: number | null;
2774
+ pastel?: boolean | null;
2775
+ surfaceMode?: components["schemas"]["AppThemeSurfaceMode"] | null;
2776
+ themes?: components["schemas"]["AppThemePaletteThemes"] | null;
2777
+ };
2778
+ AppThemePaletteSeed: {
2779
+ color?: string | null;
2780
+ hue?: number | null;
2781
+ saturation?: number | null;
2782
+ };
2783
+ AppThemePaletteThemes: {
2784
+ code?: components["schemas"]["AppThemeCodePalette"] | null;
2785
+ danger?: components["schemas"]["AppThemePaletteSeed"] | null;
2786
+ note?: components["schemas"]["AppThemePaletteSeed"] | null;
2787
+ success?: components["schemas"]["AppThemePaletteSeed"] | null;
2788
+ warning?: components["schemas"]["AppThemePaletteSeed"] | null;
2789
+ };
2720
2790
  AppThemeResponse: {
2721
2791
  applyThemeGlobally: boolean;
2792
+ /**
2793
+ * @deprecated
2794
+ * @description Deprecated: use palette and logoUrl instead.
2795
+ */
2722
2796
  dark: components["schemas"]["AppThemeScheme"];
2797
+ /**
2798
+ * @deprecated
2799
+ * @description Deprecated: use palette and logoUrl instead.
2800
+ */
2723
2801
  light: components["schemas"]["AppThemeScheme"];
2802
+ logoUrl: string;
2803
+ palette: components["schemas"]["AppThemePalette"];
2724
2804
  typography?: components["schemas"]["AppThemeTypography"];
2725
2805
  };
2726
2806
  AppThemeScheme: {
@@ -2730,6 +2810,8 @@ export interface components {
2730
2810
  foregroundColor: string;
2731
2811
  logoUrl: string;
2732
2812
  };
2813
+ /** @enum {string} */
2814
+ AppThemeSurfaceMode: "neutral" | "tinted";
2733
2815
  AppThemeTypography: {
2734
2816
  body: components["schemas"]["AppThemeFontRef"];
2735
2817
  fonts: components["schemas"]["ThemeFont"][];
@@ -2887,6 +2969,9 @@ export interface components {
2887
2969
  CreateDeploymentInputCreationMethod: "upload" | "cubecloud" | "github" | "ssh";
2888
2970
  /** @enum {string} */
2889
2971
  CreateDeploymentInputDeployMode: "git" | "cli";
2972
+ CreateDeploymentTokenInput: {
2973
+ expiresIn?: number | null;
2974
+ };
2890
2975
  CreateEmbedGroupInput: {
2891
2976
  description?: string | null;
2892
2977
  /** @description Group name, unique within the embed tenant. The `system:` prefix is reserved and rejected. */
@@ -3211,7 +3296,7 @@ export interface components {
3211
3296
  type: components["schemas"]["DashboardWidgetDtoType"];
3212
3297
  };
3213
3298
  /** @enum {string} */
3214
- DashboardWidgetDtoType: "CHART" | "TEXT" | "FILTER" | "AI" | "TIME_GRAIN" | "PARENT" | "SPACER" | "DIVIDER" | "CONTAINER";
3299
+ DashboardWidgetDtoType: "CHART" | "TEXT" | "FILTER" | "AI" | "TIME_GRAIN" | "FIELD" | "PARENT" | "SPACER" | "DIVIDER" | "CONTAINER";
3215
3300
  DashboardWidgetInput: {
3216
3301
  config?: {
3217
3302
  [key: string]: any;
@@ -3225,7 +3310,7 @@ export interface components {
3225
3310
  type: components["schemas"]["DashboardWidgetInputType"];
3226
3311
  };
3227
3312
  /** @enum {string} */
3228
- DashboardWidgetInputType: "CHART" | "TEXT" | "FILTER" | "AI" | "TIME_GRAIN" | "PARENT" | "SPACER" | "DIVIDER" | "CONTAINER";
3313
+ DashboardWidgetInputType: "CHART" | "TEXT" | "FILTER" | "AI" | "TIME_GRAIN" | "FIELD" | "PARENT" | "SPACER" | "DIVIDER" | "CONTAINER";
3229
3314
  DashboardWidgetPosition: {
3230
3315
  h: number;
3231
3316
  w: number;
@@ -4009,6 +4094,13 @@ export interface components {
4009
4094
  PivotItemsMeasuresAxis: "columns" | "rows";
4010
4095
  /** @enum {string} */
4011
4096
  PivotItemsMeasuresPosition: "before" | "after";
4097
+ Policy: {
4098
+ actions: ("All" | "DeploymentsManage" | "DeploymentCreate" | "DeploymentRead" | "DeploymentUpdate" | "DeploymentDelete" | "SecretsManage" | "DownloadData" | "PlaygroundRead" | "SchemaRead" | "SchemaUpdate" | "SchemaUpdateDevBranches" | "APMRead" | "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")[];
4099
+ resourceType: components["schemas"]["PolicyResourceType"];
4100
+ resources: string[];
4101
+ };
4102
+ /** @enum {string} */
4103
+ PolicyResourceType: "Global" | "Deployment" | "Report" | "ReportFolder" | "Agent" | "AgentSpace" | "Workbook" | "Dashboard" | "Folder" | "ChatThread";
4012
4104
  PostTokenBySessionIdInput: {
4013
4105
  sessionId: string;
4014
4106
  };
@@ -4192,6 +4284,7 @@ export interface components {
4192
4284
  canManage?: boolean | null;
4193
4285
  createdAt: string;
4194
4286
  createdBy?: number;
4287
+ currentQueryChecksum?: string | null;
4195
4288
  deploymentId: number;
4196
4289
  description?: string | null;
4197
4290
  endResultCell?: string | null;
@@ -4248,16 +4341,20 @@ export interface components {
4248
4341
  id?: string | null;
4249
4342
  placedAt?: string | null;
4250
4343
  placedByUserId?: number | null;
4344
+ queryChecksum?: string | null;
4251
4345
  refreshedAt?: string | null;
4252
4346
  refreshedByUserId?: number | null;
4253
4347
  resultLocation: string;
4254
4348
  sheetId?: string | null;
4255
4349
  sheetName?: string | null;
4350
+ syncStatus?: components["schemas"]["ReportPlacementSyncStatus"] | null;
4256
4351
  workbookId: string;
4257
4352
  workbookName?: string | null;
4258
4353
  };
4259
4354
  /** @enum {string} */
4260
4355
  ReportPlacementHost: "GOOGLE_SHEETS" | "EXCEL";
4356
+ /** @enum {string} */
4357
+ ReportPlacementSyncStatus: "UP_TO_DATE" | "CHANGED" | "UNKNOWN";
4261
4358
  ReportSnapshot: {
4262
4359
  description?: string | null;
4263
4360
  fillMissingRows?: components["schemas"]["FillMissingRows"] | null;
@@ -4342,6 +4439,13 @@ export interface components {
4342
4439
  SheetsUiSettings: {
4343
4440
  showAppliedFilters?: boolean | null;
4344
4441
  };
4442
+ SheetsUserSettingsInput: {
4443
+ autoRunQueryOnChange?: boolean | null;
4444
+ openExplorationFromSheet?: boolean | null;
4445
+ revealSheetOnOpen?: boolean | null;
4446
+ showAppliedFilters?: boolean | null;
4447
+ suppressDuplicateValues?: boolean | null;
4448
+ };
4345
4449
  SourceTreeResponse: {
4346
4450
  /**
4347
4451
  * @deprecated
@@ -4497,6 +4601,11 @@ export interface components {
4497
4601
  subFormat?: string | null;
4498
4602
  targetEnvVar?: string | null;
4499
4603
  };
4604
+ UpdatePublishedAiWidgetThreadInput: {
4605
+ checksum?: string | null;
4606
+ threadId: string;
4607
+ widgetId: string;
4608
+ };
4500
4609
  UpdateReportInput: {
4501
4610
  endResultCell?: string | null;
4502
4611
  externalWorkbookId?: string | null;
@@ -4587,6 +4696,7 @@ export interface components {
4587
4696
  title?: string | null;
4588
4697
  tosAccepted?: Record<string, never> | null;
4589
4698
  updatedAt?: (string) | null;
4699
+ userPolicies?: components["schemas"]["Policy"][] | null;
4590
4700
  username: string;
4591
4701
  };
4592
4702
  UserAlias: {
@@ -4712,6 +4822,7 @@ export interface components {
4712
4822
  defaultDeploymentId?: number | null;
4713
4823
  lastSeenChangelogId?: number | null;
4714
4824
  locale?: string | null;
4825
+ sheets?: components["schemas"]["SheetsUserSettingsInput"] | null;
4715
4826
  theme?: string | null;
4716
4827
  timezone?: string | null;
4717
4828
  };
@@ -6491,7 +6602,12 @@ export interface operations {
6491
6602
  };
6492
6603
  cookie?: never;
6493
6604
  };
6494
- requestBody?: never;
6605
+ /** @description CreateDeploymentTokenInput */
6606
+ requestBody?: {
6607
+ content: {
6608
+ "application/json": components["schemas"]["CreateDeploymentTokenInput"];
6609
+ };
6610
+ };
6495
6611
  responses: {
6496
6612
  200: {
6497
6613
  headers: {
@@ -6705,6 +6821,33 @@ export interface operations {
6705
6821
  };
6706
6822
  };
6707
6823
  };
6824
+ "WorkbooksPublicController.updatePublishedDashboardAiWidgetThread": {
6825
+ parameters: {
6826
+ query?: never;
6827
+ header?: never;
6828
+ path: {
6829
+ deploymentId: number;
6830
+ workbookId: number;
6831
+ };
6832
+ cookie?: never;
6833
+ };
6834
+ /** @description UpdatePublishedAiWidgetThreadInput */
6835
+ requestBody?: {
6836
+ content: {
6837
+ "application/json": components["schemas"]["UpdatePublishedAiWidgetThreadInput"];
6838
+ };
6839
+ };
6840
+ responses: {
6841
+ 200: {
6842
+ headers: {
6843
+ [name: string]: any;
6844
+ };
6845
+ content: {
6846
+ "application/json": components["schemas"]["Dashboard"];
6847
+ };
6848
+ };
6849
+ };
6850
+ };
6708
6851
  "WorkbooksPublicController.duplicateWorkbook": {
6709
6852
  parameters: {
6710
6853
  query?: never;
@@ -8582,6 +8725,30 @@ export interface operations {
8582
8725
  };
8583
8726
  };
8584
8727
  };
8728
+ "UsersPublicController.updateMySettings": {
8729
+ parameters: {
8730
+ query?: never;
8731
+ header?: never;
8732
+ path?: never;
8733
+ cookie?: never;
8734
+ };
8735
+ /** @description UserSettings */
8736
+ requestBody?: {
8737
+ content: {
8738
+ "application/json": components["schemas"]["UserSettingsInput"];
8739
+ };
8740
+ };
8741
+ responses: {
8742
+ 200: {
8743
+ headers: {
8744
+ [name: string]: any;
8745
+ };
8746
+ content: {
8747
+ "application/json": components["schemas"]["User"];
8748
+ };
8749
+ };
8750
+ };
8751
+ };
8585
8752
  "UsersAdminPublicController.updateUser": {
8586
8753
  parameters: {
8587
8754
  query?: never;