@workos-inc/widgets 1.17.3 → 1.18.0-next.1788904392369

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
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.18.0-next.1788904392369
4
+
5
+ ### Minor Changes
6
+
7
+ - Add an opt-in `enableSharedConnections` prop to `<Pipes>`, which splits the widget into a read-only section of the connections the organization owns and shares with everyone, followed by the member's own connections. Omitting the prop leaves the existing unsectioned list and its requests unchanged.
8
+
9
+ An empty list now says which kind of empty it is, in both the sectioned and the unsectioned widget: "No integrations are available yet." when the endpoint returned nothing, and "No integrations to show." when `filter` matched nothing. The shared section is still omitted outright when the organization shares nothing.
10
+
11
+ `filter` stays a single prop and keeps its existing signature — `PipesProps` is a union discriminated on `enableSharedConnections`, so only hosts that opt in see the widened predicate. With the prop on, `filter` narrows both sections: criteria narrow shared rows by `slugs` alone (their payload carries none of the provider metadata the other criteria read), and a predicate receives `DataIntegrationWithConnections | SharedDataConnection`, discriminated with `"integrationType" in connection` — both payloads carry `connected_accounts`, and `ownership` is `"organization"` on some of the member's own rows, so neither of those tells the shapes apart.
12
+
3
13
  ## 1.17.3
4
14
 
5
15
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n WorkOsWidgets,\n type WorkOsWidgetsProps,\n} from \"./workos-widgets.client.js\";\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n type OrganizationSwitcherProps,\n} from \"./organization-switcher.client.js\";\nexport {\n AdminPortalSsoConnection,\n AdminPortalSsoConnectionLoading,\n type AdminPortalSsoConnectionProps,\n} from \"./admin-portal-sso-connection.client.js\";\nexport {\n UserProfile,\n UserProfileLoading,\n type UserProfileProps,\n} from \"./user-profile.client.js\";\nexport {\n UserSecurity,\n UserSecurityLoading,\n type UserSecurityProps,\n} from \"./user-security.client.js\";\nexport {\n UserSessions,\n UserSessionsLoading,\n type UserSessionsProps,\n} from \"./user-sessions.client.js\";\nexport {\n UsersManagement,\n UsersManagementLoading,\n type UsersManagementProps,\n} from \"./users-management.client.js\";\nexport {\n AdminPortalDomainVerification,\n AdminPortalDomainVerificationLoading,\n type AdminPortalDomainVerificationProps,\n} from \"./admin-portal-domain-verification.client.js\";\nexport {\n AdminPortalAuditLogStreaming,\n AdminPortalAuditLogStreamingLoading,\n AdminPortalAuditLogStreamingError,\n type AdminPortalAuditLogStreamingProps,\n AdminPortalAuditLogStreamingPresentational,\n AdminPortalAuditLogStreamingButton as AdminPortalAuditLogStreamingOpenButton,\n type AdminPortalAuditLogStreamingStatusProps,\n} from \"./admin-portal-audit-log-streaming.client.js\";\nexport {\n ApiKeys,\n ApiKeysLoading,\n type ApiKeysProps,\n} from \"./api-keys.client.js\";\nexport {\n Pipes,\n PipesLoading,\n type PipesAuthMethod,\n type PipesFilter,\n type PipesFilterCriteria,\n type PipesProps,\n} from \"./pipes.client.js\";\nexport type { DataIntegration } from \"./api/endpoint.js\";\nexport {\n PipesAdmin,\n PipesAdminLoading,\n type PipesAdminProps,\n} from \"./pipes-admin.client.js\";\nexport {\n DirectorySync,\n DirectorySyncLoading,\n type DirectorySyncProps,\n} from \"./directory-sync.client.js\";\nexport { IntlContext as internal_IntlContext } from \"./lib/i18n/intl-context.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAGO;AACP,0CAIO;AACP,gDAIO;AACP,iCAIO;AACP,kCAIO;AACP,kCAIO;AACP,qCAIO;AACP,qDAIO;AACP,qDAQO;AACP,6BAIO;AACP,0BAOO;AAEP,gCAIO;AACP,mCAIO;AACP,0BAAoD;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n WorkOsWidgets,\n type WorkOsWidgetsProps,\n} from \"./workos-widgets.client.js\";\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n type OrganizationSwitcherProps,\n} from \"./organization-switcher.client.js\";\nexport {\n AdminPortalSsoConnection,\n AdminPortalSsoConnectionLoading,\n type AdminPortalSsoConnectionProps,\n} from \"./admin-portal-sso-connection.client.js\";\nexport {\n UserProfile,\n UserProfileLoading,\n type UserProfileProps,\n} from \"./user-profile.client.js\";\nexport {\n UserSecurity,\n UserSecurityLoading,\n type UserSecurityProps,\n} from \"./user-security.client.js\";\nexport {\n UserSessions,\n UserSessionsLoading,\n type UserSessionsProps,\n} from \"./user-sessions.client.js\";\nexport {\n UsersManagement,\n UsersManagementLoading,\n type UsersManagementProps,\n} from \"./users-management.client.js\";\nexport {\n AdminPortalDomainVerification,\n AdminPortalDomainVerificationLoading,\n type AdminPortalDomainVerificationProps,\n} from \"./admin-portal-domain-verification.client.js\";\nexport {\n AdminPortalAuditLogStreaming,\n AdminPortalAuditLogStreamingLoading,\n AdminPortalAuditLogStreamingError,\n type AdminPortalAuditLogStreamingProps,\n AdminPortalAuditLogStreamingPresentational,\n AdminPortalAuditLogStreamingButton as AdminPortalAuditLogStreamingOpenButton,\n type AdminPortalAuditLogStreamingStatusProps,\n} from \"./admin-portal-audit-log-streaming.client.js\";\nexport {\n ApiKeys,\n ApiKeysLoading,\n type ApiKeysProps,\n} from \"./api-keys.client.js\";\nexport {\n Pipes,\n PipesLoading,\n type PipesAuthMethod,\n type PipesConnection,\n type PipesConnectionFilter,\n type PipesFilter,\n type PipesFilterCriteria,\n type PipesProps,\n} from \"./pipes.client.js\";\nexport type { DataIntegration, SharedDataConnection } from \"./api/endpoint.js\";\nexport {\n PipesAdmin,\n PipesAdminLoading,\n type PipesAdminProps,\n} from \"./pipes-admin.client.js\";\nexport {\n DirectorySync,\n DirectorySyncLoading,\n type DirectorySyncProps,\n} from \"./directory-sync.client.js\";\nexport { IntlContext as internal_IntlContext } from \"./lib/i18n/intl-context.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mCAGO;AACP,0CAIO;AACP,gDAIO;AACP,iCAIO;AACP,kCAIO;AACP,kCAIO;AACP,qCAIO;AACP,qDAIO;AACP,qDAQO;AACP,6BAIO;AACP,0BASO;AAEP,gCAIO;AACP,mCAIO;AACP,0BAAoD;","names":[]}
@@ -8,8 +8,8 @@ export { UsersManagement, UsersManagementProps } from './users-management.client
8
8
  export { AdminPortalDomainVerification, AdminPortalDomainVerificationProps } from './admin-portal-domain-verification.client.cjs';
9
9
  export { AdminPortalAuditLogStreaming, AdminPortalAuditLogStreamingProps } from './admin-portal-audit-log-streaming.client.cjs';
10
10
  export { ApiKeys, ApiKeysProps } from './api-keys.client.cjs';
11
- export { Pipes, PipesAuthMethod, PipesFilter, PipesFilterCriteria, PipesProps } from './pipes.client.cjs';
12
- export { DataIntegration } from './api/endpoint.cjs';
11
+ export { Pipes, PipesAuthMethod, PipesConnection, PipesConnectionFilter, PipesFilter, PipesFilterCriteria, PipesProps } from './pipes.client.cjs';
12
+ export { DataIntegration, SharedDataConnection } from './api/endpoint.cjs';
13
13
  export { PipesAdmin, PipesAdminProps } from './pipes-admin.client.cjs';
14
14
  export { DirectorySync, DirectorySyncProps } from './directory-sync.client.cjs';
15
15
  export { IntlContext as internal_IntlContext } from './lib/i18n/intl-context.cjs';
@@ -31,7 +31,8 @@ var pipes_exports = {};
31
31
  __export(pipes_exports, {
32
32
  Pipes: () => Pipes,
33
33
  PipesError: () => PipesError,
34
- PipesLoading: () => PipesLoading
34
+ PipesLoading: () => PipesLoading,
35
+ PipesSections: () => PipesSections
35
36
  });
36
37
  module.exports = __toCommonJS(pipes_exports);
37
38
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -1371,8 +1372,8 @@ function DisconnectAccountDialog({
1371
1372
  ] })
1372
1373
  ] }) });
1373
1374
  }
1374
- const PipesLoading = ({ count, ...domProps }) => {
1375
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { ...getWidgetRootDomProps("loading", domProps), children: Array.from({ length: count }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
1375
+ function PipesSkeletonItems({ count }) {
1376
+ return Array.from({ length: count }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
1376
1377
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "4", align: "center", children: [
1377
1378
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_panel.IconPanel, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_provider_icon.ProviderIcon, { provider: "google", size: "2" }) }) }),
1378
1379
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Skeleton, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", weight: "bold", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1392,16 +1393,409 @@ const PipesLoading = ({ count, ...domProps }) => {
1392
1393
  description: "Placeholder button text for loading state"
1393
1394
  }
1394
1395
  ) }) })
1395
- ] }) }, index)) });
1396
+ ] }) }, index));
1397
+ }
1398
+ const PipesLoading = ({ count, ...domProps }) => {
1399
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { ...getWidgetRootDomProps("loading", domProps), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesSkeletonItems, { count }) });
1396
1400
  };
1397
- const Pipes = ({ integrations, ...domProps }) => {
1398
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { ...getWidgetRootDomProps("resolved", domProps), children: integrations.map((integration) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
1401
+ function PipesItems({ integrations }) {
1402
+ return integrations.map((integration) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "row", justify: "between", align: "center", gap: "2", children: [
1399
1403
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "4", align: "center", children: [
1400
1404
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_panel.IconPanel, { color: "panel", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_data_integration_icon.DataIntegrationIcon, { integration, size: "2" }) }),
1401
1405
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", weight: "bold", children: integration.name })
1402
1406
  ] }),
1403
1407
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProviderStatus, { integration })
1404
- ] }) }, integration.id)) });
1408
+ ] }) }, integration.id));
1409
+ }
1410
+ function PipesEmptyItem({ isFiltered }) {
1411
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "gray", children: isFiltered ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1412
+ import_translation.Translation,
1413
+ {
1414
+ defaultMessage: "No integrations to show.",
1415
+ id: "cAs7JC",
1416
+ description: "Empty state shown when the host's filter leaves no integrations to list"
1417
+ }
1418
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1419
+ import_translation.Translation,
1420
+ {
1421
+ defaultMessage: "No integrations are available yet.",
1422
+ id: "oK0Rjh",
1423
+ description: "Empty state shown when no integrations are enabled at all"
1424
+ }
1425
+ ) }) });
1426
+ }
1427
+ const Pipes = ({
1428
+ integrations,
1429
+ hasUnfilteredIntegrations,
1430
+ ...domProps
1431
+ }) => {
1432
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { ...getWidgetRootDomProps("resolved", domProps), children: integrations.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesItems, { integrations }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesEmptyItem, { isFiltered: hasUnfilteredIntegrations ?? false }) });
1433
+ };
1434
+ function SharedConnectionStatus({
1435
+ connection
1436
+ }) {
1437
+ const isAvailable = connection.connected_accounts.some(
1438
+ (account) => account.availability === "available"
1439
+ );
1440
+ return isAvailable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_status.Status, { state: "success", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1441
+ import_translation.Translation,
1442
+ {
1443
+ defaultMessage: "Available",
1444
+ id: "_jQjSu",
1445
+ description: "Status text for a shared connection the member can use"
1446
+ }
1447
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_status.Status, { state: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1448
+ import_translation.Translation,
1449
+ {
1450
+ defaultMessage: "Needs admin attention",
1451
+ id: "K5YoFj",
1452
+ description: "Status text for a shared connection an administrator must repair"
1453
+ }
1454
+ ) });
1455
+ }
1456
+ function SectionedItem({
1457
+ icon,
1458
+ name,
1459
+ status,
1460
+ description,
1461
+ actions
1462
+ }) {
1463
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "row", justify: "between", align: "center", gap: "4", children: [
1464
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { gap: "4", align: "center", children: [
1465
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon_panel.IconPanel, { color: "panel", children: icon }),
1466
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "1", children: [
1467
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { align: "center", gap: "2", wrap: "wrap", children: [
1468
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", weight: "bold", children: name }),
1469
+ status
1470
+ ] }),
1471
+ description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "gray", children: description })
1472
+ ] })
1473
+ ] }),
1474
+ actions
1475
+ ] }) });
1476
+ }
1477
+ function SharedConnectionItem({
1478
+ connection
1479
+ }) {
1480
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1481
+ SectionedItem,
1482
+ {
1483
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1484
+ import_data_integration_icon.DataIntegrationIcon,
1485
+ {
1486
+ integration: {
1487
+ integrationType: connection.slug,
1488
+ iconSlug: connection.iconSlug,
1489
+ iconUrl: connection.iconUrl,
1490
+ iconDarkUrl: connection.iconDarkUrl
1491
+ },
1492
+ size: "2"
1493
+ }
1494
+ ),
1495
+ name: connection.name,
1496
+ status: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SharedConnectionStatus, { connection }),
1497
+ description: connection.description
1498
+ }
1499
+ );
1500
+ }
1501
+ function MemberConnectionStatus({
1502
+ integration
1503
+ }) {
1504
+ const installation = integration.installation;
1505
+ if (!installation) {
1506
+ return null;
1507
+ }
1508
+ if (installation.state === "connected") {
1509
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_status.Status, { state: "success", children: installation.auth_method === "api_key" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1510
+ import_translation.Translation,
1511
+ {
1512
+ defaultMessage: "Connected via API key",
1513
+ id: "jQLTNe",
1514
+ description: "Status text for a connection established with an API key"
1515
+ }
1516
+ ) : installation.auth_method === "client_credentials" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1517
+ import_translation.Translation,
1518
+ {
1519
+ defaultMessage: "Connected via client credentials",
1520
+ id: "hQKIrx",
1521
+ description: "Status text for a connection established with client credentials"
1522
+ }
1523
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1524
+ import_translation.Translation,
1525
+ {
1526
+ defaultMessage: "Connected via OAuth",
1527
+ id: "pJcK_M",
1528
+ description: "Status text for a connection established with OAuth"
1529
+ }
1530
+ ) });
1531
+ }
1532
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_status.Status, { state: "warning", children: installation.auth_method === "api_key" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1533
+ import_translation.Translation,
1534
+ {
1535
+ defaultMessage: "Update your API key",
1536
+ id: "-YLPTk",
1537
+ description: "Status text for a connection whose API key stopped working"
1538
+ }
1539
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1540
+ import_translation.Translation,
1541
+ {
1542
+ defaultMessage: "Requires reauthorization",
1543
+ id: "dqczQS",
1544
+ description: "Status text for integration needing reauthorization"
1545
+ }
1546
+ ) });
1547
+ }
1548
+ function MemberConnectionActions({
1549
+ integration
1550
+ }) {
1551
+ const [disconnectOpen, setDisconnectOpen] = (0, import_react.useState)(false);
1552
+ const [apiKeyOpen, setApiKeyOpen] = (0, import_react.useState)(false);
1553
+ const [clientCredentialsOpen, setClientCredentialsOpen] = (0, import_react.useState)(false);
1554
+ const [reauthConfigOpen, setReauthConfigOpen] = (0, import_react.useState)(false);
1555
+ const authorizeEventHandler = useOpenDataIntegrationAuthorizeUrl(integration);
1556
+ const translate = (0, import_use_translation.useTranslation)();
1557
+ const pipeActionsTitle = translate({
1558
+ defaultMessage: "Pipe actions",
1559
+ id: "1uF9ve",
1560
+ description: "Title for pipe actions dropdown button"
1561
+ });
1562
+ const unpinnedFields = getUnpinnedInstallationFields(integration);
1563
+ if (!integration.installation) {
1564
+ const authMethods = integration.authMethods ?? [];
1565
+ const methods = CONNECT_AUTH_METHODS.filter(
1566
+ (method) => authMethods.includes(method)
1567
+ );
1568
+ return methods.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MultiMethodConnectButton, { integration, methods }) : methods.length === 1 && methods[0] === "api_key" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ApiKeyConnectButton, { integration }) : methods.length === 1 && methods[0] === "client_credentials" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClientCredentialsConnectButton, { integration }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConnectIntegrationButton, { integration });
1569
+ }
1570
+ const connected = integration.installation.state === "connected";
1571
+ const isApiKeyInstallation = integration.installation.auth_method === "api_key";
1572
+ const isClientCredentialsInstallation = integration.installation.auth_method === "client_credentials";
1573
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1575
+ DisconnectAccountDialog,
1576
+ {
1577
+ integrationName: integration.name,
1578
+ installationId: integration.installation.id,
1579
+ open: disconnectOpen,
1580
+ onOpenChange: setDisconnectOpen
1581
+ }
1582
+ ),
1583
+ apiKeyOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1584
+ ApiKeyDialog,
1585
+ {
1586
+ integration,
1587
+ open: apiKeyOpen,
1588
+ onOpenChange: setApiKeyOpen
1589
+ }
1590
+ ),
1591
+ clientCredentialsOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1592
+ ClientCredentialsDialog,
1593
+ {
1594
+ integration,
1595
+ fields: unpinnedFields,
1596
+ open: clientCredentialsOpen,
1597
+ onOpenChange: setClientCredentialsOpen
1598
+ }
1599
+ ),
1600
+ unpinnedFields.length > 0 && !isClientCredentialsInstallation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1601
+ ConnectDialog,
1602
+ {
1603
+ integration,
1604
+ fields: unpinnedFields,
1605
+ open: reauthConfigOpen,
1606
+ onOpenChange: setReauthConfigOpen
1607
+ }
1608
+ ),
1609
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { align: "center", gap: "4", children: [
1610
+ !connected && (isApiKeyInstallation ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Button, { variant: "secondary", onClick: () => setApiKeyOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1611
+ import_translation.Translation,
1612
+ {
1613
+ defaultMessage: "Update key",
1614
+ id: "MP-aOE",
1615
+ description: "Button to replace the API key of a connection that stopped working"
1616
+ }
1617
+ ) }) : isClientCredentialsInstallation ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1618
+ import_elements.Button,
1619
+ {
1620
+ variant: "secondary",
1621
+ onClick: () => setClientCredentialsOpen(true),
1622
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1623
+ import_translation.Translation,
1624
+ {
1625
+ defaultMessage: "Update credentials",
1626
+ id: "1inB3Y",
1627
+ description: "Button to update the client credentials of a connection that stopped working"
1628
+ }
1629
+ )
1630
+ }
1631
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1632
+ import_elements.Button,
1633
+ {
1634
+ variant: "secondary",
1635
+ onClick: async () => {
1636
+ if (unpinnedFields.length > 0) {
1637
+ setReauthConfigOpen(true);
1638
+ return;
1639
+ }
1640
+ try {
1641
+ await authorizeEventHandler();
1642
+ } catch {
1643
+ }
1644
+ },
1645
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1646
+ import_translation.Translation,
1647
+ {
1648
+ defaultMessage: "Reauthorize",
1649
+ id: "3IbiTG",
1650
+ description: "Button to reauthorize a connection that stopped working"
1651
+ }
1652
+ )
1653
+ }
1654
+ )),
1655
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_elements.DropdownMenu.Root, { children: [
1656
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.DropdownMenu.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.IconButton, { title: pipeActionsTitle, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_icons.DotsHorizontalIcon, {}) }) }),
1657
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_elements.DropdownMenu.Content, { align: "end", children: [
1658
+ connected && isApiKeyInstallation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.DropdownMenu.Item, { onClick: () => setApiKeyOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1659
+ import_translation.Translation,
1660
+ {
1661
+ defaultMessage: "Rotate API key",
1662
+ id: "GML+c8",
1663
+ description: "Menu option to rotate the API key"
1664
+ }
1665
+ ) }),
1666
+ connected && isClientCredentialsInstallation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.DropdownMenu.Item, { onClick: () => setClientCredentialsOpen(true), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1667
+ import_translation.Translation,
1668
+ {
1669
+ defaultMessage: "Update client credentials",
1670
+ id: "daHKWE",
1671
+ description: "Menu option to update stored client credentials"
1672
+ }
1673
+ ) }),
1674
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1675
+ import_elements.DropdownMenu.Item,
1676
+ {
1677
+ variant: "destructive",
1678
+ onClick: () => setDisconnectOpen(true),
1679
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1680
+ import_translation.Translation,
1681
+ {
1682
+ defaultMessage: "Disconnect account",
1683
+ id: "esZQrd",
1684
+ description: "Menu option to disconnect an account"
1685
+ }
1686
+ )
1687
+ }
1688
+ )
1689
+ ] })
1690
+ ] })
1691
+ ] })
1692
+ ] });
1693
+ }
1694
+ function MemberConnectionItems({
1695
+ integrations
1696
+ }) {
1697
+ return integrations.map((integration) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1698
+ SectionedItem,
1699
+ {
1700
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_data_integration_icon.DataIntegrationIcon, { integration, size: "2" }),
1701
+ name: integration.name,
1702
+ status: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberConnectionStatus, { integration }),
1703
+ description: integration.description,
1704
+ actions: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberConnectionActions, { integration })
1705
+ },
1706
+ integration.id
1707
+ ));
1708
+ }
1709
+ function PipesSection({
1710
+ title,
1711
+ description,
1712
+ children
1713
+ }) {
1714
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "3", children: [
1715
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "1", children: [
1716
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "3", weight: "bold", children: title }),
1717
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "gray", children: description })
1718
+ ] }),
1719
+ children
1720
+ ] });
1721
+ }
1722
+ const PipesSections = ({
1723
+ integrations,
1724
+ hasUnfilteredIntegrations,
1725
+ sharedConnections,
1726
+ hasUnfilteredSharedConnections,
1727
+ isSharedLoading,
1728
+ organizationName,
1729
+ ...domProps
1730
+ }) => {
1731
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1732
+ import_themes.Flex,
1733
+ {
1734
+ direction: "column",
1735
+ gap: "5",
1736
+ ...getWidgetRootDomProps("resolved", domProps),
1737
+ children: [
1738
+ (isSharedLoading || sharedConnections.length > 0 || hasUnfilteredSharedConnections) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1739
+ PipesSection,
1740
+ {
1741
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1742
+ import_translation.Translation,
1743
+ {
1744
+ defaultMessage: "Shared connections",
1745
+ id: "Fcd-bK",
1746
+ description: "Heading for the section listing connections the organization owns"
1747
+ }
1748
+ ),
1749
+ description: organizationName ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1750
+ import_translation.Translation,
1751
+ {
1752
+ defaultMessage: "Accounts {organizationName} owns and shares with everyone.",
1753
+ id: "7U8P0v",
1754
+ description: "Description of the shared connections section, naming the organization",
1755
+ values: { organizationName }
1756
+ }
1757
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1758
+ import_translation.Translation,
1759
+ {
1760
+ defaultMessage: "Accounts your organization owns and shares with everyone.",
1761
+ id: "72FEZi",
1762
+ description: "Description of the shared connections section when the organization name is unknown"
1763
+ }
1764
+ ),
1765
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { children: isSharedLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesSkeletonItems, { count: 2 }) : sharedConnections.length > 0 ? sharedConnections.map((connection) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1766
+ SharedConnectionItem,
1767
+ {
1768
+ connection
1769
+ },
1770
+ connection.id
1771
+ )) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesEmptyItem, { isFiltered: true }) })
1772
+ }
1773
+ ),
1774
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1775
+ PipesSection,
1776
+ {
1777
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1778
+ import_translation.Translation,
1779
+ {
1780
+ defaultMessage: "Your connections",
1781
+ id: "-VDI3G",
1782
+ description: "Heading for the section listing the member's own connections"
1783
+ }
1784
+ ),
1785
+ description: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1786
+ import_translation.Translation,
1787
+ {
1788
+ defaultMessage: "Connect your account to access these connections.",
1789
+ id: "ObXqUu",
1790
+ description: "Description of the personal connections section"
1791
+ }
1792
+ ),
1793
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardList.Root, { children: integrations.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MemberConnectionItems, { integrations }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesEmptyItem, { isFiltered: hasUnfilteredIntegrations ?? false }) })
1794
+ }
1795
+ )
1796
+ ]
1797
+ }
1798
+ );
1405
1799
  };
1406
1800
  const PipesError = ({ error, ...domProps }) => {
1407
1801
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Card, { size: "2", ...getWidgetRootDomProps("error", domProps), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_generic_error.GenericError, { error }) });
@@ -1418,6 +1812,7 @@ function getWidgetRootDomProps(state, domProps) {
1418
1812
  0 && (module.exports = {
1419
1813
  Pipes,
1420
1814
  PipesError,
1421
- PipesLoading
1815
+ PipesLoading,
1816
+ PipesSections
1422
1817
  });
1423
1818
  //# sourceMappingURL=pipes.cjs.map