@cube-dev/platform-client 0.14.0 → 0.15.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,7 +9,16 @@ 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.15.0] - 2026-09-25
13
+
14
+ ### Added
15
+
16
+ - `GET /api/v1/app-config` returns `aiPaywalled` (CUB-4684): `true` when the tenant uses the new UI without having enabled AI. An embed then offers no AI, whatever the session's `allowAi` says, because the server refuses its AI credentials.
17
+ - New public REST endpoints for agent scheduled tasks: `GET` / `POST /api/v1/deployments/{deploymentId}/scheduled-tasks`, `GET` / `PUT` / `DELETE …/scheduled-tasks/{taskId}`, `POST …/scheduled-tasks/{taskId}/run` and `GET …/scheduled-tasks/{taskId}/runs` (`ScheduledTasksPublicController.listScheduledTasks` / `createScheduledTask` / `getScheduledTask` / `updateScheduledTask` / `deleteScheduledTask` / `runScheduledTask` / `listScheduledTaskRuns`). A scheduled task is a saved prompt the deployment's agent runs on a cron in an IANA time zone, or only on demand, and each run writes a new chat thread. The endpoints answer `403` unless scheduled tasks are enabled for the account, the caller holds read access to the deployment, and the request is not an embed session. Anyone with that access can list and read the deployment's tasks; only a task's creator, whom every run acts as, or an admin can update, delete or run it. A cron must fire at most once an hour (its minute field is a single number), and a user can have at most 20 active (scheduled and enabled) tasks across the account's deployments. A bad cron or time zone answers `400`, and a create or resume past the limit answers `409`; Manual and paused tasks don't count toward the limit. Each task carries `userId` (the creator) and `nextRunAt`. Both lists support cursor pagination; the tasks list has no cap (omitting `first` returns every task), but the runs list only ever holds the 50 most recent runs, so `first`/`after` page within that window rather than a longer history. New schemas: `ScheduledTaskResponse`, `ScheduledTaskListResponse`, `CreateScheduledTaskInput`, `UpdateScheduledTaskInput`, `RunScheduledTaskResponse`, `ScheduledTaskRunResponse`, `ScheduledTaskRunsListResponse`.
18
+ - `ReportPlacementResultChecksum` / `ReportPlacementResultChecksumInput` — used by `PUT /api/v1/deployments/{deploymentId}/reports/{reportId}/refresh` and `.../connect-workbook` — gained an optional `payload` field (1–128 chars, CUB-4966): a hash of the grid the add-in just wrote, opaque to the server, so a later refresh can skip rewriting an unchanged block.
19
+
12
20
  ## [0.14.0] - 2026-09-23
21
+
13
22
  ### Added
14
23
 
15
24
  - Public REST parity for API key management (CORE-730): `GET` / `POST /api/v1/api-keys` and `GET` / `DELETE /api/v1/api-keys/{id}` (`ApiKeysPublicController.listApiKeys` / `createApiKey` / `getApiKey` / `deleteApiKey`), matching the `cube api-keys list/create/get/delete` CLI commands, which previously had no REST route to target. Admin-only. List and get responses omit the real secret — only a SHA-256 hash is persisted — so only the create response carries the one-time-revealed `token`. New schemas: `ApiKeyResponse`, `ApiKeyCreatedResponse`, `ApiKeysListResponse`, `CreateApiKeyInput`.
package/dist/schema.d.ts CHANGED
@@ -1232,6 +1232,95 @@ export interface paths {
1232
1232
  patch?: never;
1233
1233
  trace?: never;
1234
1234
  };
1235
+ "/api/v1/deployments/{deploymentId}/scheduled-tasks": {
1236
+ parameters: {
1237
+ query?: never;
1238
+ header?: never;
1239
+ path?: never;
1240
+ cookie?: never;
1241
+ };
1242
+ /**
1243
+ * List scheduled tasks
1244
+ * @description Every scheduled task in the deployment, most recently updated first, with its next run time. Needs access to the deployment; embed sessions get `403`.
1245
+ */
1246
+ get: operations["ScheduledTasksPublicController.listScheduledTasks"];
1247
+ put?: never;
1248
+ /**
1249
+ * Create a scheduled task
1250
+ * @description Saves a prompt for the agent to run on `cronExpression` in `timezone`, or only on demand without a cron. Runs act as the caller. A cron fires at most hourly (`400` otherwise), and a user can have 20 active tasks (`409` past that).
1251
+ */
1252
+ post: operations["ScheduledTasksPublicController.createScheduledTask"];
1253
+ delete?: never;
1254
+ options?: never;
1255
+ head?: never;
1256
+ patch?: never;
1257
+ trace?: never;
1258
+ };
1259
+ "/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}": {
1260
+ parameters: {
1261
+ query?: never;
1262
+ header?: never;
1263
+ path?: never;
1264
+ cookie?: never;
1265
+ };
1266
+ /** Get a scheduled task */
1267
+ get: operations["ScheduledTasksPublicController.getScheduledTask"];
1268
+ /**
1269
+ * Update a scheduled task
1270
+ * @description Changes the fields sent; `cronExpression: null` makes the task Manual. Only the creator or an admin may do this (`403` otherwise). A cron fires at most hourly (`400` otherwise), and a user can have 20 active tasks (`409` past that).
1271
+ */
1272
+ put: operations["ScheduledTasksPublicController.updateScheduledTask"];
1273
+ post?: never;
1274
+ /**
1275
+ * Delete a scheduled task
1276
+ * @description Deletes the task and its schedule; the chat threads of past runs are kept. Only the creator or an admin may do this (`403` otherwise).
1277
+ */
1278
+ delete: operations["ScheduledTasksPublicController.deleteScheduledTask"];
1279
+ options?: never;
1280
+ head?: never;
1281
+ patch?: never;
1282
+ trace?: never;
1283
+ };
1284
+ "/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}/run": {
1285
+ parameters: {
1286
+ query?: never;
1287
+ header?: never;
1288
+ path?: never;
1289
+ cookie?: never;
1290
+ };
1291
+ get?: never;
1292
+ put?: never;
1293
+ /**
1294
+ * Run a scheduled task now
1295
+ * @description Starts one run now, even for a paused or Manual task, and returns its chat thread. Only the creator or an admin may do this (`403` otherwise).
1296
+ */
1297
+ post: operations["ScheduledTasksPublicController.runScheduledTask"];
1298
+ delete?: never;
1299
+ options?: never;
1300
+ head?: never;
1301
+ patch?: never;
1302
+ trace?: never;
1303
+ };
1304
+ "/api/v1/deployments/{deploymentId}/scheduled-tasks/{taskId}/runs": {
1305
+ parameters: {
1306
+ query?: never;
1307
+ header?: never;
1308
+ path?: never;
1309
+ cookie?: never;
1310
+ };
1311
+ /**
1312
+ * List a scheduled task's runs
1313
+ * @description The chat threads of the task's latest 50 runs, newest first. Opening a thread follows the usual chat-history access rules.
1314
+ */
1315
+ get: operations["ScheduledTasksPublicController.listScheduledTaskRuns"];
1316
+ put?: never;
1317
+ post?: never;
1318
+ delete?: never;
1319
+ options?: never;
1320
+ head?: never;
1321
+ patch?: never;
1322
+ trace?: never;
1323
+ };
1235
1324
  "/api/v1/deployments/{deploymentId}/settings": {
1236
1325
  parameters: {
1237
1326
  query?: never;
@@ -3367,6 +3456,7 @@ export interface components {
3367
3456
  pageInfo: components["schemas"]["PageInfo"];
3368
3457
  };
3369
3458
  AppConfigResponse: {
3459
+ aiPaywalled: boolean;
3370
3460
  appTheme?: components["schemas"]["AppTheme"] | null;
3371
3461
  applyThemeGlobally: boolean;
3372
3462
  creatorMode?: components["schemas"]["CreatorMode"] | null;
@@ -3706,6 +3796,16 @@ export interface components {
3706
3796
  CreateReportInputHost: "GOOGLE_SHEETS" | "EXCEL";
3707
3797
  /** @enum {string} */
3708
3798
  CreateReportInputSource: "GOOGLE_SHEETS" | "EXCEL" | "PLAYGROUND" | "D3";
3799
+ CreateScheduledTaskInput: {
3800
+ agentId?: number | null;
3801
+ cronExpression?: string | null;
3802
+ description?: string | null;
3803
+ isEnabled?: boolean | null;
3804
+ name: string;
3805
+ /** @description What the agent is asked on every run, shown as the task's Instructions in Cube. Each run starts a new chat thread with no memory of earlier ones, so write the whole request. */
3806
+ prompt: string;
3807
+ timezone?: string | null;
3808
+ };
3709
3809
  CreateWorkbookInput: {
3710
3810
  folderId?: number | null;
3711
3811
  meta?: {
@@ -5459,10 +5559,12 @@ export interface components {
5459
5559
  ReportPlacementHost: "GOOGLE_SHEETS" | "EXCEL";
5460
5560
  ReportPlacementResultChecksum: {
5461
5561
  chunks: components["schemas"]["ReportPlacementResultChunk"][];
5562
+ payload?: string | null;
5462
5563
  v: number;
5463
5564
  };
5464
5565
  ReportPlacementResultChecksumInput: {
5465
5566
  chunks: components["schemas"]["ReportPlacementResultChunkInput"][];
5567
+ payload?: string | null;
5466
5568
  v: number;
5467
5569
  };
5468
5570
  ReportPlacementResultChunk: {
@@ -5552,6 +5654,10 @@ export interface components {
5552
5654
  id: number;
5553
5655
  name: string;
5554
5656
  };
5657
+ RunScheduledTaskResponse: {
5658
+ /** @description The chat thread this run writes to. */
5659
+ chatThreadUuid: string;
5660
+ };
5555
5661
  SaveDatabricksMetricViewIntegrationInput: {
5556
5662
  deletionPolicy?: components["schemas"]["SaveDatabricksMetricViewIntegrationInputDeletionPolicy"];
5557
5663
  enabled: boolean;
@@ -5570,10 +5676,40 @@ export interface components {
5570
5676
  viewNameRegex?: string;
5571
5677
  viewNames?: string[];
5572
5678
  };
5573
- /** @enum {string} */
5574
5679
  SaveDatabricksMetricViewIntegrationInputDeletionPolicy: "retain" | "delete-managed";
5575
5680
  /** @enum {string} */
5576
5681
  SaveDatabricksMetricViewIntegrationInputSelectionMode: "all" | "selected" | "pattern";
5682
+ ScheduledTaskListResponse: {
5683
+ items: components["schemas"]["ScheduledTaskResponse"][];
5684
+ pageInfo: components["schemas"]["PageInfo"];
5685
+ };
5686
+ ScheduledTaskResponse: {
5687
+ agentId?: number | null;
5688
+ cronExpression?: string | null;
5689
+ deploymentId: number;
5690
+ description?: string | null;
5691
+ id: number;
5692
+ /** @description False while the schedule is paused. */
5693
+ isEnabled: boolean;
5694
+ name: string;
5695
+ nextRunAt?: string | null;
5696
+ /** @description What the agent is asked on every run, shown as the task's Instructions in Cube. Each run starts a new chat thread, so the prompt has to stand on its own. */
5697
+ prompt: string;
5698
+ /** @description IANA time zone the cron is read in, e.g. `America/New_York`. Defaults to `UTC`. */
5699
+ timezone: string;
5700
+ /** @description The creator. Every run executes as this user, and only they or an admin may change, delete or run the task. */
5701
+ userId: number;
5702
+ };
5703
+ ScheduledTaskRunResponse: {
5704
+ /** @description The chat thread the run produced. */
5705
+ chatThreadUuid: string;
5706
+ createdAt: string;
5707
+ status?: string | null;
5708
+ };
5709
+ ScheduledTaskRunsListResponse: {
5710
+ items: components["schemas"]["ScheduledTaskRunResponse"][];
5711
+ pageInfo: components["schemas"]["PageInfo"];
5712
+ };
5577
5713
  SetBranchStagingEnvironmentRequest: {
5578
5714
  branchId?: number | null;
5579
5715
  branchName?: string | null;
@@ -5844,6 +5980,15 @@ export interface components {
5844
5980
  UpdateResourceUserPolicyBodyAction: "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";
5845
5981
  /** @enum {string} */
5846
5982
  UpdateResourceUserPolicyBodyResourceType: "Global" | "Deployment" | "Report" | "ReportFolder" | "Agent" | "AgentSpace" | "Workbook" | "Dashboard" | "Folder" | "ChatThread";
5983
+ UpdateScheduledTaskInput: {
5984
+ agentId?: number | null;
5985
+ cronExpression?: string | null;
5986
+ description?: string | null;
5987
+ isEnabled?: boolean | null;
5988
+ name?: string | null;
5989
+ prompt?: string | null;
5990
+ timezone?: string | null;
5991
+ };
5847
5992
  UpdateWorkbookInput: {
5848
5993
  folderId?: number | null;
5849
5994
  meta?: {
@@ -8346,6 +8491,175 @@ export interface operations {
8346
8491
  };
8347
8492
  };
8348
8493
  };
8494
+ "ScheduledTasksPublicController.listScheduledTasks": {
8495
+ parameters: {
8496
+ query?: {
8497
+ after?: string | null;
8498
+ first?: number | null;
8499
+ };
8500
+ header?: never;
8501
+ path: {
8502
+ deploymentId: number;
8503
+ };
8504
+ cookie?: never;
8505
+ };
8506
+ requestBody?: never;
8507
+ responses: {
8508
+ 200: {
8509
+ headers: {
8510
+ [name: string]: any;
8511
+ };
8512
+ content: {
8513
+ "application/json": components["schemas"]["ScheduledTaskListResponse"];
8514
+ };
8515
+ };
8516
+ };
8517
+ };
8518
+ "ScheduledTasksPublicController.createScheduledTask": {
8519
+ parameters: {
8520
+ query?: never;
8521
+ header?: never;
8522
+ path: {
8523
+ deploymentId: number;
8524
+ };
8525
+ cookie?: never;
8526
+ };
8527
+ /** @description CreateScheduledTaskInput */
8528
+ requestBody: {
8529
+ content: {
8530
+ "application/json": components["schemas"]["CreateScheduledTaskInput"];
8531
+ };
8532
+ };
8533
+ responses: {
8534
+ 200: {
8535
+ headers: {
8536
+ [name: string]: any;
8537
+ };
8538
+ content: {
8539
+ "application/json": components["schemas"]["ScheduledTaskResponse"];
8540
+ };
8541
+ };
8542
+ };
8543
+ };
8544
+ "ScheduledTasksPublicController.getScheduledTask": {
8545
+ parameters: {
8546
+ query?: never;
8547
+ header?: never;
8548
+ path: {
8549
+ deploymentId: number;
8550
+ taskId: number;
8551
+ };
8552
+ cookie?: never;
8553
+ };
8554
+ requestBody?: never;
8555
+ responses: {
8556
+ 200: {
8557
+ headers: {
8558
+ [name: string]: any;
8559
+ };
8560
+ content: {
8561
+ "application/json": components["schemas"]["ScheduledTaskResponse"];
8562
+ };
8563
+ };
8564
+ };
8565
+ };
8566
+ "ScheduledTasksPublicController.updateScheduledTask": {
8567
+ parameters: {
8568
+ query?: never;
8569
+ header?: never;
8570
+ path: {
8571
+ deploymentId: number;
8572
+ taskId: number;
8573
+ };
8574
+ cookie?: never;
8575
+ };
8576
+ /** @description UpdateScheduledTaskInput */
8577
+ requestBody: {
8578
+ content: {
8579
+ "application/json": components["schemas"]["UpdateScheduledTaskInput"];
8580
+ };
8581
+ };
8582
+ responses: {
8583
+ 200: {
8584
+ headers: {
8585
+ [name: string]: any;
8586
+ };
8587
+ content: {
8588
+ "application/json": components["schemas"]["ScheduledTaskResponse"];
8589
+ };
8590
+ };
8591
+ };
8592
+ };
8593
+ "ScheduledTasksPublicController.deleteScheduledTask": {
8594
+ parameters: {
8595
+ query?: never;
8596
+ header?: never;
8597
+ path: {
8598
+ deploymentId: number;
8599
+ taskId: number;
8600
+ };
8601
+ cookie?: never;
8602
+ };
8603
+ requestBody?: never;
8604
+ responses: {
8605
+ /** @description Successful response */
8606
+ 200: {
8607
+ headers: {
8608
+ [name: string]: any;
8609
+ };
8610
+ content: {
8611
+ "application/json": any;
8612
+ };
8613
+ };
8614
+ };
8615
+ };
8616
+ "ScheduledTasksPublicController.runScheduledTask": {
8617
+ parameters: {
8618
+ query?: never;
8619
+ header?: never;
8620
+ path: {
8621
+ deploymentId: number;
8622
+ taskId: number;
8623
+ };
8624
+ cookie?: never;
8625
+ };
8626
+ requestBody?: never;
8627
+ responses: {
8628
+ 200: {
8629
+ headers: {
8630
+ [name: string]: any;
8631
+ };
8632
+ content: {
8633
+ "application/json": components["schemas"]["RunScheduledTaskResponse"];
8634
+ };
8635
+ };
8636
+ };
8637
+ };
8638
+ "ScheduledTasksPublicController.listScheduledTaskRuns": {
8639
+ parameters: {
8640
+ query?: {
8641
+ after?: string | null;
8642
+ first?: number | null;
8643
+ };
8644
+ header?: never;
8645
+ path: {
8646
+ deploymentId: number;
8647
+ taskId: number;
8648
+ };
8649
+ cookie?: never;
8650
+ };
8651
+ requestBody?: never;
8652
+ responses: {
8653
+ 200: {
8654
+ headers: {
8655
+ [name: string]: any;
8656
+ };
8657
+ content: {
8658
+ "application/json": components["schemas"]["ScheduledTaskRunsListResponse"];
8659
+ };
8660
+ };
8661
+ };
8662
+ };
8349
8663
  "DeploymentsPublicController.getDeploymentSettings": {
8350
8664
  parameters: {
8351
8665
  query?: never;