@camunda/ccma-saas-frontend 0.35.4 → 0.35.6

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.
Files changed (33) hide show
  1. package/lib/esm/runtime/c4-console-data-store.js +3 -2
  2. package/lib/esm/runtime/use-cli-actions-api.d.ts +18 -0
  3. package/lib/esm/runtime/use-cli-actions-api.js +58 -0
  4. package/lib/esm/runtime/use-cli-cluster-api.d.ts +38 -0
  5. package/lib/esm/runtime/use-cli-cluster-api.js +53 -0
  6. package/lib/esm/runtime/use-cli-extras-api.d.ts +34 -0
  7. package/lib/esm/runtime/use-cli-extras-api.js +165 -0
  8. package/lib/esm/runtime/use-cli-org-api.d.ts +28 -0
  9. package/lib/esm/runtime/use-cli-org-api.js +87 -0
  10. package/lib/esm/runtime/use-cli-resources-api.d.ts +53 -0
  11. package/lib/esm/runtime/use-cli-resources-api.js +273 -0
  12. package/lib/esm/runtime/use-console-cli-api.d.ts +3 -3
  13. package/lib/esm/runtime/use-console-cli-api.js +3 -3
  14. package/lib/esm/widgets/cluster-client-details/c4-cluster-client-details-app.js +33 -13
  15. package/lib/esm/widgets/cluster-details/c4-cluster-details-app.js +31 -13
  16. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-byom-clients-tab.js +8 -6
  17. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-clients-tab.js +13 -13
  18. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-connector-secrets-tab.js +31 -18
  19. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-encryption-tab.js +4 -2
  20. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-hot-backups-tab.js +7 -6
  21. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-ip-whitelist-tab.js +4 -3
  22. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-overview-tab.js +15 -16
  23. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-secure-connectivity-tab.js +8 -6
  24. package/lib/esm/widgets/cluster-details/tabs/c4-cluster-details-settings-tab.js +49 -38
  25. package/lib/esm/widgets/clusters/c4-clusters-page.js +14 -12
  26. package/lib/esm/widgets/create-cluster/c4-create-cluster-page.js +5 -2
  27. package/lib/esm/widgets/dashboard/c4-dashboard-app.js +5 -2
  28. package/lib/esm/widgets/environment/use-cluster-api-clients.js +4 -3
  29. package/lib/esm/widgets/job-worker/c4-job-worker-details-page.js +5 -3
  30. package/lib/esm/widgets/job-worker/c4-job-worker-overview-page.js +5 -3
  31. package/lib/esm/widgets/job-worker/c4-job-worker.helpers.d.ts +1 -1
  32. package/lib/esm/widgets/management/c4-management-app.js +16 -31
  33. package/package.json +3 -3
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ConsoleByomMonitoringService, HttpError } from '@camunda/ccma-api';
2
+ import { HttpError } from '@camunda/ccma-api';
3
3
  import { CircleCheck, CircleX, Info } from 'lucide-react';
4
4
  import { useCallback, useEffect, useMemo, useState } from 'react';
5
5
  import { byomClientsShowsOwnCard, C4ClusterByomClients, } from '../../../components/c4-cluster-byom-clients/c4-cluster-byom-clients.js';
6
6
  import { SpinningLoader } from '../../../components/c4-cluster-overview/ds-status-icon-text.js';
7
7
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
8
8
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
9
+ import { useCliExtrasApi } from '../../../runtime/use-cli-extras-api.js';
9
10
  import { Button, CodeSnippet, DsBadge, DsCard, DsCodeBlock, DsText, Modal, Stack, TextInput, } from '../../../ui/index.js';
10
11
  import { safeTranslate } from '../../../utils/safe-translate.js';
11
12
  function asByomStatusLike(value) {
@@ -33,6 +34,7 @@ function formatMetricsEndpoint(metricsEndpoint) {
33
34
  }
34
35
  export const C4ClusterDetailsByomClientsTab = (props) => {
35
36
  const runtime = useC4ConsoleRuntime();
37
+ const cliExtras = useCliExtrasApi();
36
38
  // The table view sits in a card, like the other sections of the
37
39
  // cluster details page. The error and empty states of
38
40
  // `C4ClusterByomClients` are an empty-state card of their own, so they get
@@ -273,7 +275,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
273
275
  try {
274
276
  if (byomActivateOnSubmit) {
275
277
  try {
276
- await ConsoleByomMonitoringService.activateMonitoring({
278
+ await cliExtras.activateMonitoring({
277
279
  config: apiConfig,
278
280
  params: { orgId, clusterId },
279
281
  });
@@ -288,7 +290,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
288
290
  }
289
291
  }
290
292
  }
291
- const created = await ConsoleByomMonitoringService.createMonitoringClient({
293
+ const created = await cliExtras.createMonitoringClient({
292
294
  config: apiConfig,
293
295
  params: { orgId, clusterId },
294
296
  body: { username: normalized },
@@ -325,7 +327,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
325
327
  setByomRotateBusy(true);
326
328
  setByomRotateError({ title: '', description: '' });
327
329
  try {
328
- const result = await ConsoleByomMonitoringService.rotateMonitoringClientPassword({
330
+ const result = await cliExtras.rotateMonitoringClientPassword({
329
331
  config: apiConfig,
330
332
  params: {
331
333
  orgId,
@@ -362,7 +364,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
362
364
  setByomDeleteBusy(true);
363
365
  setByomDeleteError({ title: '', description: '' });
364
366
  try {
365
- await ConsoleByomMonitoringService.deleteMonitoringClient({
367
+ await cliExtras.deleteMonitoringClient({
366
368
  config: apiConfig,
367
369
  params: {
368
370
  orgId,
@@ -396,7 +398,7 @@ export const C4ClusterDetailsByomClientsTab = (props) => {
396
398
  setByomDeactivateBusy(true);
397
399
  setByomDeactivateError({ title: '', description: '' });
398
400
  try {
399
- await ConsoleByomMonitoringService.deactivateMonitoring({
401
+ await cliExtras.deactivateMonitoring({
400
402
  config: apiConfig,
401
403
  params: { orgId, clusterId },
402
404
  });
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ConsoleClusterClientsService, ConsoleConnectorSecretsService, } from '@camunda/ccma-api';
3
2
  import { checkVersion, MCP_MIN_VERSION, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
4
3
  import { useCallback, useMemo, useState } from 'react';
5
4
  import { C4ClusterClientCredentialsModal } from '../../../components/c4-cluster-client-credentials/c4-cluster-client-credentials.js';
@@ -8,6 +7,7 @@ import { C4ClusterDetailsClients } from '../../../components/c4-cluster-details-
8
7
  import { ScopesDescriptionText } from '../../../components/c4-create-cluster-api-client-modal/scopes-description-text.js';
9
8
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
10
9
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
10
+ import { useCliResourcesApi } from '../../../runtime/use-cli-resources-api.js';
11
11
  import { Checkbox, Form, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
12
12
  import { safeTranslate, scopedTranslate } from '../../../utils/safe-translate.js';
13
13
  import { SECTION_HEADING_STYLE } from '../../../utils/section-heading-style.js';
@@ -65,6 +65,7 @@ function renderInlineLink(value, opts) {
65
65
  }
66
66
  export const C4ClusterDetailsClientsTab = (props) => {
67
67
  const runtime = useC4ConsoleRuntime();
68
+ const resourcesApi = useCliResourcesApi();
68
69
  const { cluster, clients, clientsLoading, clientsError, hasIdentityIntegration, orgId, clusterId, clientsDocsUrl, mcpSetupDocsUrl: mcpSetupDocsUrlFromProps, identityAuthorizationDocsUrl, springZeebeGettingStartedDocsUrl, springZeebeConfigDocsUrl, apiConfig, canMutateCluster, clientsPermissions, useClusterSecretsLabel, scope = 'cluster', t, onNavigate, onReloadClients, } = props;
69
70
  const oauthTokenUrl = useMemo(() => {
70
71
  const base = runtime.publicUrls?.loginBaseUrl || runtime.backendUrls.identityApiBaseUrl;
@@ -251,7 +252,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
251
252
  ];
252
253
  return Array.from(new Set(expanded));
253
254
  })();
254
- const response = await ConsoleClusterClientsService.create({
255
+ const response = await resourcesApi.clients.create({
255
256
  config: apiConfig,
256
257
  params: { orgId, clusterId },
257
258
  body: {
@@ -483,20 +484,18 @@ export const C4ClusterDetailsClientsTab = (props) => {
483
484
  const secretName = `${prefix}${middle}${suffix}`;
484
485
  const secretValue = clientSecret;
485
486
  try {
486
- const existing = await ConsoleConnectorSecretsService.getAll({
487
- config: apiConfig,
488
- params: { orgId, clusterId },
489
- });
487
+ // Only the names are needed here.
488
+ const existing = await resourcesApi.secrets.getAll({ config: apiConfig, params: { orgId, clusterId } }, { withValues: false });
490
489
  const exists = Object.hasOwn(existing, secretName);
491
490
  if (exists) {
492
- await ConsoleConnectorSecretsService.update({
491
+ await resourcesApi.secrets.update({
493
492
  config: apiConfig,
494
493
  params: { orgId, clusterId },
495
494
  body: { secretName, secretValue },
496
495
  });
497
496
  }
498
497
  else {
499
- await ConsoleConnectorSecretsService.create({
498
+ await resourcesApi.secrets.create({
500
499
  config: apiConfig,
501
500
  params: { orgId, clusterId },
502
501
  body: { secretName, secretValue },
@@ -842,7 +841,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
842
841
  setClientMutationError('');
843
842
  try {
844
843
  trackEvent('apiClients:update:confirm', 'Confirm Update Api Client Modal');
845
- await ConsoleClusterClientsService.update({
844
+ await resourcesApi.clients.update({
846
845
  config: apiConfig,
847
846
  params: {
848
847
  orgId,
@@ -850,7 +849,8 @@ export const C4ClusterDetailsClientsTab = (props) => {
850
849
  clientId: selectedClientId,
851
850
  },
852
851
  body: { clientName },
853
- });
852
+ }, clients.find((client) => client.uuid === selectedClientId)
853
+ ?.clientId ?? selectedClientId);
854
854
  setUpdateClientOpen(false);
855
855
  await onReloadClients();
856
856
  }
@@ -882,14 +882,14 @@ export const C4ClusterDetailsClientsTab = (props) => {
882
882
  setClientMutationError('');
883
883
  try {
884
884
  trackEvent('apiClients:rotateSecret:confirm', 'Confirm Rotate Api Client Secret Modal', { clientId: client?.clientId ?? selectedClientId });
885
- const response = await ConsoleClusterClientsService.rotateSecret({
885
+ const response = await resourcesApi.clients.rotateSecret({
886
886
  config: apiConfig,
887
887
  params: {
888
888
  orgId,
889
889
  clusterId,
890
890
  clientUuid: selectedClientId,
891
891
  },
892
- });
892
+ }, client?.clientId ?? selectedClientId);
893
893
  setRotateSecretOpen(false);
894
894
  // The same modal as after a creation: the new secret is shown
895
895
  // one time, in every format that the customer can copy.
@@ -923,7 +923,7 @@ export const C4ClusterDetailsClientsTab = (props) => {
923
923
  setClientMutationError('');
924
924
  try {
925
925
  trackEvent('apiClients:delete:confirm', 'Confirm Delete Api Client Modal');
926
- await ConsoleClusterClientsService.delete({
926
+ await resourcesApi.clients.delete({
927
927
  config: apiConfig,
928
928
  params: {
929
929
  orgId,
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ConsoleConnectorSecretsService } from '@camunda/ccma-api';
3
2
  import { SECRETS_MAX_LENGTH, SseEntity } from '@camunda/ccma-shared-types';
4
3
  import { observer } from 'mobx-react-lite';
5
4
  import { useCallback, useEffect, useRef, useState } from 'react';
@@ -9,6 +8,7 @@ import { C4FileUploader } from '../../../components/c4-file-uploader/c4-file-upl
9
8
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
10
9
  import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
11
10
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
11
+ import { SecretExistsError, useCliResourcesApi, } from '../../../runtime/use-cli-resources-api.js';
12
12
  import { CodeSnippet, Form, Link, Modal, PasswordInput, Stack, TextArea, TextInput, } from '../../../ui/index.js';
13
13
  import { Select, SelectItem } from '../../../ui/families.js';
14
14
  import { clientErrorMessage } from '../../../utils/http-error-message.js';
@@ -57,6 +57,10 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
57
57
  // read permission — mirroring the sibling API-clients widget, which passes
58
58
  // `enabled: canReadClients` into its own fetch hook.
59
59
  const canReadSecrets = connectorSecretsPermissions?.canRead ?? canMutateCluster;
60
+ // Only a user who can create or update a secret may read the values.
61
+ const canWriteSecrets = (connectorSecretsPermissions?.canCreate ?? canMutateCluster) ||
62
+ (connectorSecretsPermissions?.canUpdate ?? canMutateCluster);
63
+ const resourcesApi = useCliResourcesApi();
60
64
  const trackEvent = useCallback((eventName, message, meta) => {
61
65
  runtime.telemetry?.track?.(eventName, {
62
66
  message,
@@ -115,10 +119,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
115
119
  connectorSecretsLoadingRef.current = true;
116
120
  setConnectorSecretsLoading(true);
117
121
  setConnectorSecretsError(false);
118
- const fetchAll = () => ConsoleConnectorSecretsService.getAll({
119
- config: apiConfig,
120
- params: { orgId, clusterId },
121
- });
122
+ const fetchAll = () => resourcesApi.secrets.getAll({ config: apiConfig, params: { orgId, clusterId } }, { withValues: canWriteSecrets });
122
123
  try {
123
124
  let loaded;
124
125
  try {
@@ -151,7 +152,14 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
151
152
  void latestReloadRef.current?.();
152
153
  }
153
154
  }
154
- }, [apiConfig, canReadSecrets, clusterId, orgId]);
155
+ }, [
156
+ apiConfig,
157
+ canReadSecrets,
158
+ canWriteSecrets,
159
+ clusterId,
160
+ orgId,
161
+ resourcesApi,
162
+ ]);
155
163
  // The queued run must use the inputs of now, not those of the load that ends.
156
164
  const latestReloadRef = useRef(undefined);
157
165
  latestReloadRef.current = reloadConnectorSecrets;
@@ -345,7 +353,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
345
353
  trackEvent('listConnectors:create:confirm', 'Confirm Create Connector Secret Modal', {
346
354
  key: secretKey,
347
355
  });
348
- await ConsoleConnectorSecretsService.create({
356
+ await resourcesApi.secrets.create({
349
357
  config: apiConfig,
350
358
  params: { orgId, clusterId },
351
359
  body: { secretName: secretKey, secretValue },
@@ -361,7 +369,11 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
361
369
  clusterId,
362
370
  key: secretKey,
363
371
  });
364
- setSecretMutationError(error instanceof Error ? error.message : 'Failed');
372
+ setSecretMutationError(error instanceof SecretExistsError
373
+ ? safeTranslate(t, 'connectorsecrets:create.error.duplicate', "A secret with the name '{{key}}' already exists", { key: error.secretName })
374
+ : error instanceof Error
375
+ ? error.message
376
+ : 'Failed');
365
377
  }
366
378
  finally {
367
379
  setSecretMutationBusy(false);
@@ -399,7 +411,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
399
411
  trackEvent('listConnectors:update:confirm', 'Confirm Update Connector Secret Modal', {
400
412
  key: secretKey,
401
413
  });
402
- await ConsoleConnectorSecretsService.update({
414
+ await resourcesApi.secrets.update({
403
415
  config: apiConfig,
404
416
  params: { orgId, clusterId },
405
417
  body: { secretName: secretKey, secretValue },
@@ -434,7 +446,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
434
446
  trackEvent('listConnectors:delete:confirm', 'Confirm Delete Connector Secret Modal', {
435
447
  key: secretKey,
436
448
  });
437
- await ConsoleConnectorSecretsService.delete({
449
+ await resourcesApi.secrets.delete({
438
450
  config: apiConfig,
439
451
  params: {
440
452
  orgId,
@@ -507,6 +519,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
507
519
  // Import all secrets
508
520
  let successCount = 0;
509
521
  const failures = [];
522
+ const knownNames = new Set(Object.keys(connectorSecretsMap));
510
523
  for (const secret of secrets) {
511
524
  // The backend answers a duplicate with a plain 4xx, and the
512
525
  // reader then saw a count of failures with no reason. A name
@@ -520,7 +533,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
520
533
  continue;
521
534
  }
522
535
  try {
523
- await ConsoleConnectorSecretsService.create({
536
+ await resourcesApi.secrets.create({
524
537
  config: apiConfig,
525
538
  params: {
526
539
  orgId,
@@ -530,7 +543,8 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
530
543
  secretName: secret.key,
531
544
  secretValue: secret.value,
532
545
  },
533
- });
546
+ }, { knownNames });
547
+ knownNames.add(secret.key);
534
548
  successCount++;
535
549
  }
536
550
  catch (error) {
@@ -611,9 +625,10 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
611
625
  const secretEntries = Object.entries(sourceClusterSecrets);
612
626
  let successCount = 0;
613
627
  let errorCount = 0;
628
+ const knownNames = new Set(Object.keys(connectorSecretsMap));
614
629
  for (const [key, value] of secretEntries) {
615
630
  try {
616
- await ConsoleConnectorSecretsService.create({
631
+ await resourcesApi.secrets.create({
617
632
  config: apiConfig,
618
633
  params: {
619
634
  orgId,
@@ -623,7 +638,8 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
623
638
  secretName: key,
624
639
  secretValue: value,
625
640
  },
626
- });
641
+ }, { knownNames });
642
+ knownNames.add(key);
627
643
  successCount++;
628
644
  }
629
645
  catch (error) {
@@ -668,10 +684,7 @@ const C4ClusterDetailsConnectorSecretsTabImpl = (props) => {
668
684
  if (clusterId) {
669
685
  setFetchingSourceSecrets(true);
670
686
  try {
671
- const secrets = await ConsoleConnectorSecretsService.getAll({
672
- config: apiConfig,
673
- params: { orgId, clusterId },
674
- });
687
+ const secrets = await resourcesApi.secrets.getAll({ config: apiConfig, params: { orgId, clusterId } }, { withValues: canWriteSecrets });
675
688
  setSourceClusterSecrets(secrets);
676
689
  }
677
690
  catch (error) {
@@ -1,8 +1,9 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
- import { ConsoleByokScriptsService, ConsoleClusterService, } from '@camunda/ccma-api';
2
+ import { ConsoleByokScriptsService } from '@camunda/ccma-api';
3
3
  import { deriveEncryptionKeyStatus, deriveEncryptionStatus, deriveFailoverKeyPolicyPrincipals, } from '@camunda/ccma-shared-types';
4
4
  import { useCallback, useEffect, useState } from 'react';
5
5
  import { C4ClusterDetailsEncryption } from '../../../components/c4-cluster-details-encryption/c4-cluster-details-encryption.js';
6
+ import { useCliClusterApi } from '../../../runtime/use-cli-cluster-api.js';
6
7
  // ARN validation patterns
7
8
  const ARN = /^arn:aws:kms:(?<region>[a-z0-9-]+):\d{12}:key\/[a-f0-9-]{36}$/u;
8
9
  const MULTI_REGION_ARN = /^arn:aws:kms:(?<region>[a-z0-9-]+):\d{12}:key\/mrk-[a-f0-9-]{32}$/u;
@@ -38,6 +39,7 @@ function buildCloneRolePolicyStatement(cloneRoleArn) {
38
39
  }
39
40
  export const C4ClusterDetailsEncryptionTab = (props) => {
40
41
  const { cluster, orgId, clusterId, apiConfig, activeTabId, onReloadCluster, restoreInProgress, isFailoverTarget, secondaryReplicationNotReady, keyStatusEnabled, docsUrls, } = props;
42
+ const clusterApi = useCliClusterApi();
41
43
  // BYOK script content
42
44
  const [byokCliSingle, setByokCliSingle] = useState('');
43
45
  const [byokCliDual, setByokCliDual] = useState('');
@@ -188,7 +190,7 @@ export const C4ClusterDetailsEncryptionTab = (props) => {
188
190
  void (async () => {
189
191
  setLockArn(true);
190
192
  try {
191
- await ConsoleClusterService.updateCluster({
193
+ await clusterApi.updateCluster({
192
194
  config: apiConfig,
193
195
  params: { orgId, clusterId },
194
196
  body: {
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ConsoleHotBackupsService } from '@camunda/ccma-api';
3
2
  import { BackupStatus, checkVersion, HOT_BACKUP_MIN_VERSION, HOTBACKUP_MIN_CREATE_PERIOD, SseEntity, VersionCheckOperator, } from '@camunda/ccma-shared-types';
4
3
  import { CronExpression, CronExpressionParser, CronFieldCollection, } from 'cron-parser';
5
4
  import { observer } from 'mobx-react-lite';
@@ -10,6 +9,7 @@ import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
10
9
  import { useC4ConsoleNotifications } from '../../../runtime/c4-console-notifications-context.js';
11
10
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
12
11
  import { useCliPilotApi } from '../../../runtime/use-cli-pilot-api.js';
12
+ import { useCliResourcesApi } from '../../../runtime/use-cli-resources-api.js';
13
13
  import { Checkbox, Link, Modal, Stack, TextInput } from '../../../ui/index.js';
14
14
  import { Select, SelectItem } from '../../../ui/families.js';
15
15
  import { safeTranslate } from '../../../utils/safe-translate.js';
@@ -209,6 +209,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
209
209
  // Main state
210
210
  const [hotBackups, setHotBackups] = useState([]);
211
211
  const cliApi = useCliPilotApi();
212
+ const resourcesApi = useCliResourcesApi();
212
213
  const [backupSchedule, setBackupSchedule] = useState(undefined);
213
214
  const [hotBackupsLoading, setHotBackupsLoading] = useState(false);
214
215
  const [hotBackupsError, setHotBackupsError] = useState(false);
@@ -256,7 +257,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
256
257
  }
257
258
  setHotBackupsError(false);
258
259
  const [backupsResult, scheduleResult] = await Promise.allSettled([
259
- ConsoleHotBackupsService.getHotBackups({
260
+ resourcesApi.backups.getHotBackups({
260
261
  config: apiConfig,
261
262
  params: { orgId, clusterId },
262
263
  }),
@@ -282,7 +283,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
282
283
  hotBackupsLoadedRef.current = true;
283
284
  hotBackupsLoadingRef.current = false;
284
285
  setHotBackupsLoading(false);
285
- }, [apiConfig, cliApi, clusterId, isHotBackupEnabled, orgId]);
286
+ }, [apiConfig, cliApi, clusterId, isHotBackupEnabled, orgId, resourcesApi]);
286
287
  const sseBackupsVersion = data.getSseEntityVersion(orgId, SseEntity.BACKUP, clusterId);
287
288
  useEffect(() => {
288
289
  hotBackupsLoadedRef.current = false;
@@ -514,7 +515,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
514
515
  setBackupMutationBusy(true);
515
516
  setBackupMutationError('');
516
517
  try {
517
- await ConsoleHotBackupsService.createHotBackup({
518
+ await resourcesApi.backups.createHotBackup({
518
519
  config: apiConfig,
519
520
  params: { orgId, clusterId },
520
521
  });
@@ -551,7 +552,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
551
552
  setBackupMutationBusy(true);
552
553
  setBackupMutationError('');
553
554
  try {
554
- await ConsoleHotBackupsService.deleteHotBackup({
555
+ await resourcesApi.backups.deleteHotBackup({
555
556
  config: apiConfig,
556
557
  params: {
557
558
  orgId,
@@ -598,7 +599,7 @@ const C4ClusterDetailsHotBackupsTabImpl = (props) => {
598
599
  setBackupMutationBusy(true);
599
600
  setBackupMutationError('');
600
601
  try {
601
- await ConsoleHotBackupsService.restoreHotBackup({
602
+ await resourcesApi.backups.restoreHotBackup({
602
603
  config: apiConfig,
603
604
  params: { orgId, clusterId, backupId },
604
605
  });
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ConsoleSecureConnectivityService } from '@camunda/ccma-api';
3
2
  import { normalizeCIDRList, } from '@camunda/ccma-shared-types';
4
3
  import { useCallback, useEffect, useRef, useState } from 'react';
5
4
  import { C4ClusterDetailsIpWhitelist } from '../../../components/c4-cluster-details-ip-whitelist/c4-cluster-details-ip-whitelist.js';
6
5
  import { C4CreateIpWhitelistModal } from '../../../components/c4-create-ip-whitelist-modal/c4-create-ip-whitelist-modal.js';
7
6
  import { C4InlineNotification } from '../../../components/c4-inline-notification/c4-inline-notification.js';
8
7
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
8
+ import { useCliExtrasApi } from '../../../runtime/use-cli-extras-api.js';
9
9
  import { useCliPilotApi } from '../../../runtime/use-cli-pilot-api.js';
10
10
  import { Form, Modal, Stack, TextInput } from '../../../ui/index.js';
11
11
  import { safeTranslate } from '../../../utils/safe-translate.js';
@@ -89,11 +89,12 @@ export const C4ClusterDetailsIpWhitelistTab = (props) => {
89
89
  // arrive with private VPC IPs (not the customer's public IPs), so the
90
90
  // allowlist will silently block PrivateLink traffic unless the VPC CIDR
91
91
  // is included.
92
+ const cliExtras = useCliExtrasApi();
92
93
  useEffect(() => {
93
94
  let cancelled = false;
94
95
  void (async () => {
95
96
  try {
96
- const status = await ConsoleSecureConnectivityService.getStatus({
97
+ const status = await cliExtras.getSecureConnectivityStatus({
97
98
  config: apiConfig,
98
99
  params: { orgId, clusterId },
99
100
  });
@@ -110,7 +111,7 @@ export const C4ClusterDetailsIpWhitelistTab = (props) => {
110
111
  return () => {
111
112
  cancelled = true;
112
113
  };
113
- }, [apiConfig, clusterId, orgId]);
114
+ }, [apiConfig, cliExtras, clusterId, orgId]);
114
115
  const showPrivateLinkConflictWarning = hasPrivateLink && ipWhitelistItems.length > 0;
115
116
  const privateLinkConflictTitle = safeTranslate(t, 'clusterdetails:secureConnectivity.ipAllowlistConflict.title', 'IP allowlist may block PrivateLink traffic');
116
117
  const privateLinkConflictSubtitle = safeTranslate(t, 'clusterdetails:secureConnectivity.ipAllowlistConflict.subtitle', 'The IP allowlist also applies to PrivateLink traffic. PrivateLink connections arrive with private VPC IPs (not your public or corporate IPs), so they will be blocked unless the allowlist includes your VPC CIDR. Add your VPC CIDR to the allowlist, or remove the allowlist entirely.');
@@ -17,6 +17,8 @@ import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
17
17
  import { useC4ConsoleRuntime, useC4FeatureFlag, } from '../../../runtime/c4-console-runtime-context.js';
18
18
  import { CLUSTER_CREATION_BLOCKED_FLAG } from '../../../runtime/cluster-creation-blocked.js';
19
19
  import { useC4TwoPhaseUpgradeMockup } from '../../../runtime/use-c4-two-phase-upgrade-mockup.js';
20
+ import { useCliActionsApi } from '../../../runtime/use-cli-actions-api.js';
21
+ import { useCliClusterApi } from '../../../runtime/use-cli-cluster-api.js';
20
22
  import { Button, Checkbox, DsText, Link, Modal, Stack } from '../../../ui/index.js';
21
23
  import { RadioButton, RadioButtonGroup } from '../../../ui/families.js';
22
24
  import { isMigrationLabel } from '../../../utils/migration-workaround.js';
@@ -46,6 +48,8 @@ function isUuidLike(value) {
46
48
  }
47
49
  const C4ClusterDetailsOverviewTabImpl = (props) => {
48
50
  const runtime = useC4ConsoleRuntime();
51
+ const clusterActions = useCliActionsApi();
52
+ const clusterApi = useCliClusterApi();
49
53
  const wakeInFlight = useRef(false);
50
54
  const { cluster, clusterError, creationParameters, clustersOfOrg, clusterPlanTypeReservations, clusterLoadLatest, clusterLoadPerDay, clusterLoad24h, clusterLoadLoading, canSeeClusterLoad, canEditCluster, canWakeCluster, canSleepCluster, canManageUsers, canViewConnectorsLink, hasIdentityIntegration, orgId, clusterId, jobDashboardEnabled, upgradeDocsUrls, statisticsConfig, apiConfig, t, onReloadCluster, onReloadClusterLoad, onNavigate, ignoreGracePeriod, upgradeGate, clusterLoadDocsUrl, restoreInProgress, overviewSection, sectionVariant, } = props;
51
55
  const data = useC4ConsoleData();
@@ -283,8 +287,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
283
287
  if (canEditCluster &&
284
288
  cluster &&
285
289
  Boolean(cluster.autoUpdate) !== autoUpdateState) {
286
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
287
- await ConsoleClusterService.updateCluster({
290
+ await clusterApi.updateCluster({
288
291
  config: apiConfig,
289
292
  params: { orgId, clusterId },
290
293
  body: { autoUpdate: autoUpdateState },
@@ -509,6 +512,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
509
512
  return steps;
510
513
  }, [
511
514
  apiConfig,
515
+ clusterApi,
512
516
  autoUpdateState,
513
517
  canEditCluster,
514
518
  cluster,
@@ -927,11 +931,10 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
927
931
  setTagError(undefined);
928
932
  setTagBusy(true);
929
933
  try {
930
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
931
934
  const customLabels = Array.isArray(cluster.labels?.custom)
932
935
  ? cluster.labels.custom.filter((value) => typeof value === 'string' && value.trim().length > 0)
933
936
  : [];
934
- await ConsoleClusterService.updateCluster({
937
+ await clusterApi.updateCluster({
935
938
  config: apiConfig,
936
939
  params: { orgId, clusterId },
937
940
  body: {
@@ -953,6 +956,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
953
956
  }
954
957
  }, [
955
958
  apiConfig,
959
+ clusterApi,
956
960
  cluster,
957
961
  clusterId,
958
962
  onReloadCluster,
@@ -990,14 +994,13 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
990
994
  return cluster?.externalMetadata?.optimizeEnabled === false;
991
995
  }, [cluster?.externalMetadata]);
992
996
  const activateOptimize = useCallback(async () => {
993
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
994
- await ConsoleClusterService.updateCluster({
997
+ await clusterApi.updateCluster({
995
998
  config: apiConfig,
996
999
  params: { orgId, clusterId },
997
1000
  body: { optimizeEnabled: true },
998
1001
  });
999
1002
  await onReloadCluster();
1000
- }, [apiConfig, clusterId, onReloadCluster, orgId]);
1003
+ }, [apiConfig, clusterApi, clusterId, onReloadCluster, orgId]);
1001
1004
  const openHardwareModal = useCallback(() => {
1002
1005
  setHardwareError(undefined);
1003
1006
  setSelectedHardwarePackages(currentHardwarePackages);
@@ -1014,8 +1017,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1014
1017
  setHardwareBusy(true);
1015
1018
  setHardwareError(undefined);
1016
1019
  try {
1017
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
1018
- await ConsoleClusterService.updateCluster({
1020
+ await clusterApi.updateCluster({
1019
1021
  config: apiConfig,
1020
1022
  params: { orgId, clusterId },
1021
1023
  body: { numberOfAllocatedHwPackages: selectedHardwarePackages },
@@ -1033,6 +1035,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1033
1035
  }
1034
1036
  }, [
1035
1037
  apiConfig,
1038
+ clusterApi,
1036
1039
  cluster,
1037
1040
  clusterId,
1038
1041
  currentHardwarePackages,
@@ -1425,9 +1428,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1425
1428
  editLabel: safeTranslate(t, 'clusterdetails:overview.clusterDetails.description.edit', 'Edit'),
1426
1429
  errorMaxLength: safeTranslate(t, 'clusterdetails:overview.clusterDetails.description.error.maxLength', 'Description cannot be longer than 150 characters.'),
1427
1430
  updateAction: async (newDescription) => {
1428
- // Import dynamically to avoid circular dependencies
1429
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
1430
- await ConsoleClusterService.updateCluster({
1431
+ await clusterApi.updateCluster({
1431
1432
  config: apiConfig,
1432
1433
  params: { orgId, clusterId },
1433
1434
  body: { description: newDescription },
@@ -1516,8 +1517,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1516
1517
  return;
1517
1518
  wakeInFlight.current = true;
1518
1519
  try {
1519
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
1520
- await ConsoleClusterService.wakeCluster({
1520
+ await clusterActions.wakeCluster({
1521
1521
  config: apiConfig,
1522
1522
  params: { orgId, clusterId },
1523
1523
  });
@@ -1557,8 +1557,7 @@ const C4ClusterDetailsOverviewTabImpl = (props) => {
1557
1557
  })(),
1558
1558
  sleepAction: canSleepCluster && !isClusterPausedReconciliation && !restoreInProgress
1559
1559
  ? async () => {
1560
- const { ConsoleClusterService } = await import('@camunda/ccma-api');
1561
- await ConsoleClusterService.suspendCluster({
1560
+ await clusterActions.suspendCluster({
1562
1561
  config: apiConfig,
1563
1562
  params: { orgId, clusterId },
1564
1563
  });
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { ConsoleSecureConnectivityService } from '@camunda/ccma-api';
3
2
  import { isValidAwsArn, isValidPrivateLinkRegion, PRIVATE_LINK_REGIONS, SECURE_CONNECTIVITY_ALLOWED_ENTRIES_LIMIT, SseEntity, } from '@camunda/ccma-shared-types';
4
3
  import { Stepper, StepperStep } from '@camunda/design-system';
5
4
  import { Check, X } from 'lucide-react';
@@ -11,6 +10,7 @@ import { C4InlineNotification } from '../../../components/c4-inline-notification
11
10
  import { C4StructuredListBody, C4StructuredListCell, C4StructuredListRow, C4StructuredListWrapper, } from '../../../components/c4-structured-list/c4-structured-list.js';
12
11
  import { useC4ConsoleData } from '../../../runtime/c4-console-data-context.js';
13
12
  import { useC4ConsoleRuntime } from '../../../runtime/c4-console-runtime-context.js';
13
+ import { useCliExtrasApi } from '../../../runtime/use-cli-extras-api.js';
14
14
  import { Button, ComposedModal, FilterableMultiSelect, Modal, ModalBody, ModalFooter, ModalHeader, Stack, TextInput, Tile, } from '../../../ui/index.js';
15
15
  import { safeTranslate } from '../../../utils/safe-translate.js';
16
16
  function adaptSecureConnectivityStatus(options) {
@@ -46,6 +46,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
46
46
  const docsUrl = docsUrls.secureConnectivity;
47
47
  const data = useC4ConsoleData();
48
48
  const runtime = useC4ConsoleRuntime();
49
+ const cliExtras = useCliExtrasApi();
49
50
  const activateModalCompletedRef = useRef(false);
50
51
  const activateModalOpenRef = useRef(false);
51
52
  const hasTrackedEndpointConnectionsOnLoadRef = useRef(false);
@@ -197,7 +198,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
197
198
  const reloadSecureConnectivity = useCallback(async () => {
198
199
  setSecureConnectivityLoading(true);
199
200
  try {
200
- const statusDto = await ConsoleSecureConnectivityService.getStatus({
201
+ const statusDto = await cliExtras.getSecureConnectivityStatus({
201
202
  config: apiConfig,
202
203
  params: { orgId, clusterId },
203
204
  });
@@ -215,7 +216,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
215
216
  finally {
216
217
  setSecureConnectivityLoading(false);
217
218
  }
218
- }, [apiConfig, clusterId, orgId]);
219
+ }, [apiConfig, cliExtras, clusterId, orgId]);
219
220
  useEffect(() => {
220
221
  if (secureConnectivityLoading) {
221
222
  hasSeenSecureConnectivityLoadingRef.current = true;
@@ -317,7 +318,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
317
318
  setSecureConnectivityMutationBusy(true);
318
319
  setSecureConnectivityMutationError('');
319
320
  try {
320
- await ConsoleSecureConnectivityService.update({
321
+ await cliExtras.updateSecureConnectivity({
321
322
  config: apiConfig,
322
323
  params: {
323
324
  orgId,
@@ -338,6 +339,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
338
339
  allowedPrincipals,
339
340
  allowedRegions,
340
341
  apiConfig,
342
+ cliExtras,
341
343
  closeUpdateModal,
342
344
  clusterId,
343
345
  orgId,
@@ -483,7 +485,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
483
485
  setSecureConnectivityMutationBusy(true);
484
486
  setSecureConnectivityMutationError('');
485
487
  try {
486
- await ConsoleSecureConnectivityService.activate({
488
+ await cliExtras.activateSecureConnectivity({
487
489
  config: apiConfig,
488
490
  params: {
489
491
  orgId,
@@ -560,7 +562,7 @@ const C4ClusterDetailsSecureConnectivityTabImpl = (props) => {
560
562
  setSecureConnectivityMutationError('');
561
563
  setSecureConnectivityDeactivating(true);
562
564
  try {
563
- await ConsoleSecureConnectivityService.deactivate({
565
+ await cliExtras.deactivateSecureConnectivity({
564
566
  config: apiConfig,
565
567
  params: { orgId, clusterId },
566
568
  });