@workos-inc/widgets 1.20.3-next.1793998900035 → 1.21.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +3 -8
  2. package/dist/cjs/widgets/organization-switcher/organization-switcher.cjs +2 -2
  3. package/dist/cjs/widgets/organization-switcher/organization-switcher.cjs.map +1 -1
  4. package/dist/cjs/widgets/pipes/pipes-connections.cjs +15 -15
  5. package/dist/cjs/widgets/pipes/pipes-connections.cjs.map +1 -1
  6. package/dist/cjs/widgets/pipes/pipes-credential-attribution.cjs +2 -2
  7. package/dist/cjs/widgets/pipes/pipes-credential-attribution.cjs.map +1 -1
  8. package/dist/cjs/widgets/pipes/pipes.cjs +6 -6
  9. package/dist/cjs/widgets/pipes/pipes.cjs.map +1 -1
  10. package/dist/cjs/widgets/pipes-admin/pipes-admin.cjs +15 -15
  11. package/dist/cjs/widgets/pipes-admin/pipes-admin.cjs.map +1 -1
  12. package/dist/cjs/widgets/user-sessions/user-sessions.cjs +1 -1
  13. package/dist/cjs/widgets/user-sessions/user-sessions.cjs.map +1 -1
  14. package/dist/esm/widgets/organization-switcher/organization-switcher.js +2 -2
  15. package/dist/esm/widgets/organization-switcher/organization-switcher.js.map +1 -1
  16. package/dist/esm/widgets/pipes/pipes-connections.js +15 -15
  17. package/dist/esm/widgets/pipes/pipes-connections.js.map +1 -1
  18. package/dist/esm/widgets/pipes/pipes-credential-attribution.js +2 -2
  19. package/dist/esm/widgets/pipes/pipes-credential-attribution.js.map +1 -1
  20. package/dist/esm/widgets/pipes/pipes.js +6 -6
  21. package/dist/esm/widgets/pipes/pipes.js.map +1 -1
  22. package/dist/esm/widgets/pipes-admin/pipes-admin.js +15 -15
  23. package/dist/esm/widgets/pipes-admin/pipes-admin.js.map +1 -1
  24. package/dist/esm/widgets/user-sessions/user-sessions.js +1 -1
  25. package/dist/esm/widgets/user-sessions/user-sessions.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/widgets/organization-switcher/organization-switcher.tsx +2 -2
  28. package/src/widgets/pipes/pipes-connections.tsx +15 -15
  29. package/src/widgets/pipes/pipes-credential-attribution.tsx +2 -2
  30. package/src/widgets/pipes/pipes.tsx +6 -6
  31. package/src/widgets/pipes-admin/pipes-admin.tsx +15 -15
  32. package/src/widgets/user-sessions/user-sessions.tsx +1 -1
package/CHANGELOG.md CHANGED
@@ -1,18 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## 1.20.3-next.1793998900035
3
+ ## 1.21.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Sync generated API from upstream schema.
8
-
7
+ - Rename 37 message IDs that didn't match the hash of their message and description. Older `@workos-inc/widgets` versions used with this `@workos-inc/widgets-i18n` version show these strings in English.
9
8
  - Format the SSO connection certificate expiry date in the active locale.
10
-
11
9
  - Fix the User Security widget showing "Invalid passcode" after a valid authenticator app code when Enter is pressed after the code auto-submits.
12
-
13
- - Translate the Directory Sync button labels and status messages, and the fallback error messages in user management, profile, and security dialogs.
14
-
15
- - Translate the placeholder text in the SSO connection, audit log streaming, Directory Sync, and organization switcher loading skeletons. Hide the default avatar icon in User Profile and Users Management from assistive technology instead of giving it an untranslated "User icon" title.
10
+ - Fix several broken translations across several Widgets.
16
11
 
17
12
  ## 1.20.2
18
13
 
@@ -26,13 +26,13 @@ const OrganizationSwitcher = ({ organizations, switchToOrganization, variant, or
26
26
  variant,
27
27
  ...domProps,
28
28
  message: translate({
29
- id: "XimGbo",
29
+ id: "aZ7eyn",
30
30
  defaultMessage: "No organizations found",
31
31
  description: "Shown in the disabled organization switcher when the user belongs to no organizations"
32
32
  })
33
33
  });
34
34
  const currentOrganizationName = currentOrganization?.name ?? translate({
35
- id: "aZ7eyn",
35
+ id: "OLi4Va",
36
36
  defaultMessage: "Select an organization",
37
37
  description: "Placeholder in the organization switcher trigger when the user has organizations but none is active"
38
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"organization-switcher.cjs","names":["useWidgetsInvalidator","useTranslation","Button","cx","Flex","Text","isPromiseLike","VisuallyHidden","Translation","CheckIcon","Box","Skeleton","ChevronDownIcon","getErrorMessage","getWidgetDomProps"],"sources":["../../../../src/widgets/organization-switcher/organization-switcher.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon } from \"@radix-ui/react-icons\";\nimport {\n Box,\n ChevronDownIcon,\n Flex,\n Text,\n VisuallyHidden,\n} from \"@radix-ui/themes\";\nimport cx from \"clsx\";\nimport type { ListUserOrganizationsQuery } from \"../../api/client-graphql/generated.js\";\nimport { Button, DropdownMenu, Skeleton } from \"../../components/elements.js\";\nimport type { ButtonProps } from \"../../components/elements.js\";\nimport { getErrorMessage } from \"../../components/generic-error.js\";\nimport { Translation } from \"../../lib/i18n/translation.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\nimport { useWidgetsInvalidator } from \"../../lib/use-widgets-invalidator.js\";\nimport { isPromiseLike } from \"../../lib/utils.js\";\nimport { getWidgetDomProps } from \"../../lib/widget-dom-props.js\";\nimport type {\n WidgetRootDomProps,\n WidgetRootState,\n} from \"../../lib/widget-types.js\";\n\ntype OrganizationSwitcherVariant = \"ghost\" | \"outline\";\n\n// Rename all uses of `org` to `organization`\ninterface OrganizationSwitcherPassthroughProps extends WidgetRootDomProps {\n switchToOrganization: ({\n organizationId,\n }: {\n organizationId: string;\n }) => void | Promise<void>;\n // Simple props to affect the overall style\n variant?: OrganizationSwitcherVariant;\n organizationLabel?: string | null;\n children?: React.ReactNode;\n /**\n * Choose where to truncate organization name in the trigger and dropdown\n * items.\n *\n * - `right`: Truncate the right side of the organization name\n * - `middle`: Truncate the middle of the organization name, trying to keep\n * words whole\n */\n truncateBehavior?: \"right\" | \"middle\";\n}\n\ntype UserOrganization = ListUserOrganizationsQuery[\"organizations\"][number];\n\ninterface OrganizationSwitcherProps extends OrganizationSwitcherPassthroughProps {\n organizations: UserOrganization[];\n}\n\nconst OrganizationSwitcher: React.FC<OrganizationSwitcherProps> = ({\n organizations,\n switchToOrganization,\n variant,\n organizationLabel = \"Organizations\",\n truncateBehavior = \"right\",\n children,\n ...domProps\n}) => {\n const currentOrganization = organizations.find(\n (organization) => organization.isCurrent,\n );\n const invalidateAllWidgets = useWidgetsInvalidator();\n const translate = useTranslation();\n\n if (organizations.length === 0) {\n return (\n <OrganizationSwitcherError\n variant={variant}\n {...domProps}\n message={translate({\n id: \"XimGbo\",\n defaultMessage: \"No organizations found\",\n description:\n \"Shown in the disabled organization switcher when the user belongs to no organizations\",\n })}\n />\n );\n }\n\n const currentOrganizationName =\n currentOrganization?.name ??\n translate({\n id: \"aZ7eyn\",\n defaultMessage: \"Select an organization\",\n description:\n \"Placeholder in the organization switcher trigger when the user has organizations but none is active\",\n });\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <Button\n variant=\"secondary\"\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"resolved\", {\n ...domProps,\n // TODO(v2): Remove `OrganizationSwitcherTrigger` in the next major\n // version. This should follow conventions of all other widgets\n // using classnames in getWidgetRootDomProps.\n className: cx(domProps.className, \"OrganizationSwitcherTrigger\"),\n })}\n >\n <Flex\n align=\"center\"\n justify=\"between\"\n gap=\"2\"\n flexGrow=\"1\"\n overflow=\"hidden\"\n minWidth=\"0\"\n >\n <TruncatedOrganizationName\n organizationName={currentOrganizationName}\n truncateBehavior={truncateBehavior}\n />\n <Flex asChild flexShrink=\"0\">\n <DropdownMenu.TriggerIcon />\n </Flex>\n </Flex>\n </Button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content>\n <DropdownMenu.Group>\n {organizationLabel ? (\n <DropdownMenu.Label>\n <Text>{organizationLabel}</Text>\n </DropdownMenu.Label>\n ) : null}\n {organizations.map((organization) => (\n <Flex\n key={organization.id}\n asChild\n pr=\"2\"\n maxWidth=\"280px\"\n minWidth=\"180px\"\n >\n <DropdownMenu.Item\n onClick={() => {\n if (\n !currentOrganization ||\n organization.id !== currentOrganization.id\n ) {\n const result = switchToOrganization({\n organizationId: organization.id,\n });\n if (isPromiseLike(result)) {\n result.then(invalidateAllWidgets);\n } else {\n invalidateAllWidgets();\n }\n }\n }}\n >\n <Flex\n justify=\"between\"\n align=\"center\"\n gap=\"4\"\n flexGrow=\"1\"\n overflow=\"hidden\"\n >\n <TruncatedOrganizationName\n organizationName={organization.name}\n truncateBehavior={truncateBehavior}\n />\n {organization.isCurrent && (\n <VisuallyHidden>\n <Translation\n defaultMessage=\"(current)\"\n id=\"daFXTP\"\n description=\"Label for screen readers indicating current organization\"\n />\n </VisuallyHidden>\n )}\n <Flex\n aria-hidden\n align=\"center\"\n justify=\"center\"\n flexShrink=\"0\"\n >\n {organization.isCurrent ? (\n <CheckIcon width=\"18px\" height=\"18px\" />\n ) : (\n // make the extra space for\n <Box width=\"18px\" height=\"18px\" />\n )}\n </Flex>\n </Flex>\n </DropdownMenu.Item>\n </Flex>\n ))}\n </DropdownMenu.Group>\n {children}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n};\n\ninterface OrganizationSwitcherLoadingProps extends WidgetRootDomProps {\n variant?: OrganizationSwitcherVariant;\n}\n\nconst OrganizationSwitcherLoading: React.FC<\n OrganizationSwitcherLoadingProps\n> = ({ variant, ...props }: OrganizationSwitcherLoadingProps) => {\n return (\n // Always need DropdownMenu.Root to wrap children than may include\n <Button\n variant=\"secondary\"\n disabled\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"loading\", props)}\n >\n <Flex align=\"center\" gap=\"2\">\n <Skeleton>\n <Text>\n <Translation\n defaultMessage=\"Loading...\"\n id=\"MPkIXK\"\n description=\"Placeholder text while organizations load\"\n />\n </Text>\n </Skeleton>\n <ChevronDownIcon />\n </Flex>\n </Button>\n );\n};\n\ninterface OrganizationSwitcherErrorProps extends WidgetRootDomProps {\n error?: unknown;\n message?: string;\n variant?: OrganizationSwitcherVariant;\n}\n\nconst OrganizationSwitcherError: React.FC<OrganizationSwitcherErrorProps> = ({\n error,\n variant,\n message,\n ...domProps\n}) => {\n const translate = useTranslation();\n const heading = message || getErrorMessage(error, translate).heading;\n\n return (\n <Button\n variant=\"secondary\"\n disabled\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"error\", domProps)}\n >\n <Flex align=\"center\" gap=\"2\">\n <Text>{heading}</Text>\n <ChevronDownIcon />\n </Flex>\n </Button>\n );\n};\n\nconst MAX_TRUNCATED_SUFFIX_LENGTH = 10;\nconst MIN_TRUNCATED_SUFFIX_LENGTH = 3;\n\nconst WHITE_SPACE_REGEX = /\\s/;\n\nconst getSplitPosition = (organizationName: string) => {\n if (organizationName.length <= MAX_TRUNCATED_SUFFIX_LENGTH) {\n return organizationName.length;\n }\n\n for (\n let i = organizationName.length - MAX_TRUNCATED_SUFFIX_LENGTH;\n i < organizationName.length - MIN_TRUNCATED_SUFFIX_LENGTH;\n i++\n ) {\n if (WHITE_SPACE_REGEX.test(organizationName[i - 1])) {\n return i;\n }\n }\n\n return organizationName.length - MAX_TRUNCATED_SUFFIX_LENGTH;\n};\n\nconst splitOrganizationName = (organizationName: string) => {\n const splitPosition = getSplitPosition(organizationName);\n return [\n organizationName.slice(0, splitPosition),\n organizationName.slice(splitPosition),\n ];\n};\n\ninterface TruncatedOrganizationNameProps {\n organizationName: string;\n truncateBehavior: \"right\" | \"middle\";\n}\n\nconst TruncatedOrganizationName: React.FC<TruncatedOrganizationNameProps> = ({\n organizationName,\n truncateBehavior,\n}) => {\n if (truncateBehavior === \"right\") {\n return <Text truncate>{organizationName}</Text>;\n }\n\n const [organizationNameLeft, organizationNameRight] =\n splitOrganizationName(organizationName);\n\n return (\n <Flex overflow=\"hidden\">\n <VisuallyHidden>\n <Text>{organizationName}</Text>\n </VisuallyHidden>\n <Text aria-hidden truncate style={{ whiteSpace: \"pre\" }}>\n {organizationNameLeft}\n </Text>\n <Text aria-hidden>{organizationNameRight}</Text>\n </Flex>\n );\n};\n\nfunction mapVariantProps(variant?: OrganizationSwitcherVariant): ButtonProps {\n const variantProps: ButtonProps = {};\n // Passing `undefined` to the variant prop will result in overrides to props we\n // set internally. This should be addressed in Radix Themes, but we can\n // explicitly set it only when it's provided and _not_ undefined.\n if (variant) {\n variantProps.unsafe_radixVariant = variant;\n }\n return variantProps;\n}\n\nfunction getWidgetRootDomProps(\n state: WidgetRootState,\n domProps: WidgetRootDomProps,\n) {\n return getWidgetDomProps({\n ...domProps,\n isWidgetRoot: true,\n widgetId: \"organization-switcher\",\n widgetState: state,\n });\n}\nexport type {\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherErrorProps,\n OrganizationSwitcherPassthroughProps,\n UserOrganization,\n};\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n OrganizationSwitcherError,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,MAAM,wBAA6D,EACjE,eACA,sBACA,SACA,oBAAoB,iBACpB,mBAAmB,SACnB,UACA,GAAG,eACC;CACJ,MAAM,sBAAsB,cAAc,MACvC,iBAAiB,aAAa,SACjC;CACA,MAAM,uBAAuBA,oCAAAA,sBAAsB;CACnD,MAAM,YAAYC,iCAAAA,eAAe;CAEjC,IAAI,cAAc,WAAW,GAC3B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,2BAAD;EACW;EACT,GAAI;EACJ,SAAS,UAAU;GACjB,IAAI;GACJ,gBAAgB;GAChB,aACE;EACJ,CAAC;CACF,CAAA;CAIL,MAAM,0BACJ,qBAAqB,QACrB,UAAU;EACR,IAAI;EACJ,gBAAgB;EAChB,aACE;CACJ,CAAC;CAEH,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,0CAAA,MAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAA,0CAAA,SAAA,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,mCAAAA,QAAD;EACE,SAAQ;EACR,GAAI,gBAAgB,OAAO;EAC3B,GAAI,sBAAsB,YAAY;GACpC,GAAG;GAIH,YAAA,GAAWC,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,CAAA;CAGhD,MAAM,CAAC,sBAAsB,yBAC3B,sBAAsB,gBAAgB;CAExC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACD,iBAAAA,MAAD;EAAM,UAAS;EAAf,UAAA;GACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,iBAAAA,gBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,IAAA,CAACF,iBAAAA,MAAD,EAAA,UAAO,iBAAuB,CAAA,EAChB,CAAA;GAChB,iBAAA,GAAA,kBAAA,IAAA,CAACA,iBAAAA,MAAD;IAAM,eAAA;IAAY,UAAA;IAAS,OAAO,EAAE,YAAY,MAAM;IACnD,UAAA;GACG,CAAA;GACN,iBAAA,GAAA,kBAAA,IAAA,CAACA,iBAAAA,MAAD;IAAM,eAAA;IAAa,UAAA;GAA4B,CAAA;EAC3C;;AAEV;AAEA,SAAS,gBAAgB,SAAoD;CAC3E,MAAM,eAA4B,CAAC;CAInC,IAAI,SACF,aAAa,sBAAsB;CAErC,OAAO;AACT;AAEA,SAAS,sBACP,OACA,UACA;CACA,OAAOS,6BAAAA,kBAAkB;EACvB,GAAG;EACH,cAAc;EACd,UAAU;EACV,aAAa;CACf,CAAC;AACH"}
1
+ {"version":3,"file":"organization-switcher.cjs","names":["useWidgetsInvalidator","useTranslation","Button","cx","Flex","Text","isPromiseLike","VisuallyHidden","Translation","CheckIcon","Box","Skeleton","ChevronDownIcon","getErrorMessage","getWidgetDomProps"],"sources":["../../../../src/widgets/organization-switcher/organization-switcher.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon } from \"@radix-ui/react-icons\";\nimport {\n Box,\n ChevronDownIcon,\n Flex,\n Text,\n VisuallyHidden,\n} from \"@radix-ui/themes\";\nimport cx from \"clsx\";\nimport type { ListUserOrganizationsQuery } from \"../../api/client-graphql/generated.js\";\nimport { Button, DropdownMenu, Skeleton } from \"../../components/elements.js\";\nimport type { ButtonProps } from \"../../components/elements.js\";\nimport { getErrorMessage } from \"../../components/generic-error.js\";\nimport { Translation } from \"../../lib/i18n/translation.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\nimport { useWidgetsInvalidator } from \"../../lib/use-widgets-invalidator.js\";\nimport { isPromiseLike } from \"../../lib/utils.js\";\nimport { getWidgetDomProps } from \"../../lib/widget-dom-props.js\";\nimport type {\n WidgetRootDomProps,\n WidgetRootState,\n} from \"../../lib/widget-types.js\";\n\ntype OrganizationSwitcherVariant = \"ghost\" | \"outline\";\n\n// Rename all uses of `org` to `organization`\ninterface OrganizationSwitcherPassthroughProps extends WidgetRootDomProps {\n switchToOrganization: ({\n organizationId,\n }: {\n organizationId: string;\n }) => void | Promise<void>;\n // Simple props to affect the overall style\n variant?: OrganizationSwitcherVariant;\n organizationLabel?: string | null;\n children?: React.ReactNode;\n /**\n * Choose where to truncate organization name in the trigger and dropdown\n * items.\n *\n * - `right`: Truncate the right side of the organization name\n * - `middle`: Truncate the middle of the organization name, trying to keep\n * words whole\n */\n truncateBehavior?: \"right\" | \"middle\";\n}\n\ntype UserOrganization = ListUserOrganizationsQuery[\"organizations\"][number];\n\ninterface OrganizationSwitcherProps extends OrganizationSwitcherPassthroughProps {\n organizations: UserOrganization[];\n}\n\nconst OrganizationSwitcher: React.FC<OrganizationSwitcherProps> = ({\n organizations,\n switchToOrganization,\n variant,\n organizationLabel = \"Organizations\",\n truncateBehavior = \"right\",\n children,\n ...domProps\n}) => {\n const currentOrganization = organizations.find(\n (organization) => organization.isCurrent,\n );\n const invalidateAllWidgets = useWidgetsInvalidator();\n const translate = useTranslation();\n\n if (organizations.length === 0) {\n return (\n <OrganizationSwitcherError\n variant={variant}\n {...domProps}\n message={translate({\n id: \"aZ7eyn\",\n defaultMessage: \"No organizations found\",\n description:\n \"Shown in the disabled organization switcher when the user belongs to no organizations\",\n })}\n />\n );\n }\n\n const currentOrganizationName =\n currentOrganization?.name ??\n translate({\n id: \"OLi4Va\",\n defaultMessage: \"Select an organization\",\n description:\n \"Placeholder in the organization switcher trigger when the user has organizations but none is active\",\n });\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger>\n <Button\n variant=\"secondary\"\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"resolved\", {\n ...domProps,\n // TODO(v2): Remove `OrganizationSwitcherTrigger` in the next major\n // version. This should follow conventions of all other widgets\n // using classnames in getWidgetRootDomProps.\n className: cx(domProps.className, \"OrganizationSwitcherTrigger\"),\n })}\n >\n <Flex\n align=\"center\"\n justify=\"between\"\n gap=\"2\"\n flexGrow=\"1\"\n overflow=\"hidden\"\n minWidth=\"0\"\n >\n <TruncatedOrganizationName\n organizationName={currentOrganizationName}\n truncateBehavior={truncateBehavior}\n />\n <Flex asChild flexShrink=\"0\">\n <DropdownMenu.TriggerIcon />\n </Flex>\n </Flex>\n </Button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Content>\n <DropdownMenu.Group>\n {organizationLabel ? (\n <DropdownMenu.Label>\n <Text>{organizationLabel}</Text>\n </DropdownMenu.Label>\n ) : null}\n {organizations.map((organization) => (\n <Flex\n key={organization.id}\n asChild\n pr=\"2\"\n maxWidth=\"280px\"\n minWidth=\"180px\"\n >\n <DropdownMenu.Item\n onClick={() => {\n if (\n !currentOrganization ||\n organization.id !== currentOrganization.id\n ) {\n const result = switchToOrganization({\n organizationId: organization.id,\n });\n if (isPromiseLike(result)) {\n result.then(invalidateAllWidgets);\n } else {\n invalidateAllWidgets();\n }\n }\n }}\n >\n <Flex\n justify=\"between\"\n align=\"center\"\n gap=\"4\"\n flexGrow=\"1\"\n overflow=\"hidden\"\n >\n <TruncatedOrganizationName\n organizationName={organization.name}\n truncateBehavior={truncateBehavior}\n />\n {organization.isCurrent && (\n <VisuallyHidden>\n <Translation\n defaultMessage=\"(current)\"\n id=\"daFXTP\"\n description=\"Label for screen readers indicating current organization\"\n />\n </VisuallyHidden>\n )}\n <Flex\n aria-hidden\n align=\"center\"\n justify=\"center\"\n flexShrink=\"0\"\n >\n {organization.isCurrent ? (\n <CheckIcon width=\"18px\" height=\"18px\" />\n ) : (\n // make the extra space for\n <Box width=\"18px\" height=\"18px\" />\n )}\n </Flex>\n </Flex>\n </DropdownMenu.Item>\n </Flex>\n ))}\n </DropdownMenu.Group>\n {children}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n};\n\ninterface OrganizationSwitcherLoadingProps extends WidgetRootDomProps {\n variant?: OrganizationSwitcherVariant;\n}\n\nconst OrganizationSwitcherLoading: React.FC<\n OrganizationSwitcherLoadingProps\n> = ({ variant, ...props }: OrganizationSwitcherLoadingProps) => {\n return (\n // Always need DropdownMenu.Root to wrap children than may include\n <Button\n variant=\"secondary\"\n disabled\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"loading\", props)}\n >\n <Flex align=\"center\" gap=\"2\">\n <Skeleton>\n <Text>\n <Translation\n defaultMessage=\"Loading...\"\n id=\"MPkIXK\"\n description=\"Placeholder text while organizations load\"\n />\n </Text>\n </Skeleton>\n <ChevronDownIcon />\n </Flex>\n </Button>\n );\n};\n\ninterface OrganizationSwitcherErrorProps extends WidgetRootDomProps {\n error?: unknown;\n message?: string;\n variant?: OrganizationSwitcherVariant;\n}\n\nconst OrganizationSwitcherError: React.FC<OrganizationSwitcherErrorProps> = ({\n error,\n variant,\n message,\n ...domProps\n}) => {\n const translate = useTranslation();\n const heading = message || getErrorMessage(error, translate).heading;\n\n return (\n <Button\n variant=\"secondary\"\n disabled\n {...mapVariantProps(variant)}\n {...getWidgetRootDomProps(\"error\", domProps)}\n >\n <Flex align=\"center\" gap=\"2\">\n <Text>{heading}</Text>\n <ChevronDownIcon />\n </Flex>\n </Button>\n );\n};\n\nconst MAX_TRUNCATED_SUFFIX_LENGTH = 10;\nconst MIN_TRUNCATED_SUFFIX_LENGTH = 3;\n\nconst WHITE_SPACE_REGEX = /\\s/;\n\nconst getSplitPosition = (organizationName: string) => {\n if (organizationName.length <= MAX_TRUNCATED_SUFFIX_LENGTH) {\n return organizationName.length;\n }\n\n for (\n let i = organizationName.length - MAX_TRUNCATED_SUFFIX_LENGTH;\n i < organizationName.length - MIN_TRUNCATED_SUFFIX_LENGTH;\n i++\n ) {\n if (WHITE_SPACE_REGEX.test(organizationName[i - 1])) {\n return i;\n }\n }\n\n return organizationName.length - MAX_TRUNCATED_SUFFIX_LENGTH;\n};\n\nconst splitOrganizationName = (organizationName: string) => {\n const splitPosition = getSplitPosition(organizationName);\n return [\n organizationName.slice(0, splitPosition),\n organizationName.slice(splitPosition),\n ];\n};\n\ninterface TruncatedOrganizationNameProps {\n organizationName: string;\n truncateBehavior: \"right\" | \"middle\";\n}\n\nconst TruncatedOrganizationName: React.FC<TruncatedOrganizationNameProps> = ({\n organizationName,\n truncateBehavior,\n}) => {\n if (truncateBehavior === \"right\") {\n return <Text truncate>{organizationName}</Text>;\n }\n\n const [organizationNameLeft, organizationNameRight] =\n splitOrganizationName(organizationName);\n\n return (\n <Flex overflow=\"hidden\">\n <VisuallyHidden>\n <Text>{organizationName}</Text>\n </VisuallyHidden>\n <Text aria-hidden truncate style={{ whiteSpace: \"pre\" }}>\n {organizationNameLeft}\n </Text>\n <Text aria-hidden>{organizationNameRight}</Text>\n </Flex>\n );\n};\n\nfunction mapVariantProps(variant?: OrganizationSwitcherVariant): ButtonProps {\n const variantProps: ButtonProps = {};\n // Passing `undefined` to the variant prop will result in overrides to props we\n // set internally. This should be addressed in Radix Themes, but we can\n // explicitly set it only when it's provided and _not_ undefined.\n if (variant) {\n variantProps.unsafe_radixVariant = variant;\n }\n return variantProps;\n}\n\nfunction getWidgetRootDomProps(\n state: WidgetRootState,\n domProps: WidgetRootDomProps,\n) {\n return getWidgetDomProps({\n ...domProps,\n isWidgetRoot: true,\n widgetId: \"organization-switcher\",\n widgetState: state,\n });\n}\nexport type {\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherErrorProps,\n OrganizationSwitcherPassthroughProps,\n UserOrganization,\n};\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n OrganizationSwitcherError,\n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,CAACA,iBAAAA,MAAD;IAAM,eAAA;IAAa,UAAA;GAA4B,CAAA;EAC3C;;AAEV;AAEA,SAAS,gBAAgB,SAAoD;CAC3E,MAAM,eAA4B,CAAC;CAInC,IAAI,SACF,aAAa,sBAAsB;CAErC,OAAO;AACT;AAEA,SAAS,sBACP,OACA,UACA;CACA,OAAOS,6BAAAA,kBAAkB;EACvB,GAAG;EACH,cAAc;EACd,UAAU;EACV,aAAa;CACf,CAAC;AACH"}
@@ -138,7 +138,7 @@ function toAccountDisplayNameInput(name) {
138
138
  const ConnectionNameField = ({ id, value, onChange }) => {
139
139
  const placeholder = require_lib_i18n_use_translation.useTranslation()({
140
140
  defaultMessage: "e.g. Marketing",
141
- id: "Rn4cLp",
141
+ id: "pWC98E",
142
142
  description: "Placeholder for the connection name input"
143
143
  });
144
144
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_radix_ui_themes.Flex, {
@@ -151,7 +151,7 @@ const ConnectionNameField = ({ id, value, onChange }) => {
151
151
  htmlFor: id,
152
152
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
153
153
  defaultMessage: "Name",
154
- id: "Rn1lNm",
154
+ id: "KdgU9T",
155
155
  description: "Label for the connection name input"
156
156
  })
157
157
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_themes.Text, {
@@ -159,7 +159,7 @@ const ConnectionNameField = ({ id, value, onChange }) => {
159
159
  color: "gray",
160
160
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
161
161
  defaultMessage: "Optional",
162
- id: "Rn0oPt",
162
+ id: "2Yy441",
163
163
  description: "Hint beside the connection name input saying it can be left empty"
164
164
  })
165
165
  })]
@@ -191,7 +191,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
191
191
  const errorMessage = error instanceof require_api_errors.ApiError && error.message ? error.message : null;
192
192
  const placeholder = translate({
193
193
  defaultMessage: "e.g. Marketing",
194
- id: "Rn4cLp",
194
+ id: "pWC98E",
195
195
  description: "Placeholder for the connection name input"
196
196
  });
197
197
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_themes_components_dialog.Root, {
@@ -205,7 +205,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
205
205
  weight: "bold",
206
206
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
207
207
  defaultMessage: "Rename {integrationName} connection",
208
- id: "Rn7tTl",
208
+ id: "c1jT5Q",
209
209
  description: "Dialog title for renaming one connection to a provider",
210
210
  values: { integrationName }
211
211
  })
@@ -215,7 +215,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
215
215
  mt: "1",
216
216
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
217
217
  defaultMessage: "Give this connection a name to tell it apart from your other {integrationName} connections.",
218
- id: "Rn2dSc",
218
+ id: "Ptf2r1",
219
219
  description: "Explains what a connection name is for",
220
220
  values: { integrationName }
221
221
  })
@@ -226,7 +226,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
226
226
  role: "alert",
227
227
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_themes.Callout.Text, { children: errorMessage ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
228
228
  defaultMessage: "An error occurred while renaming this connection. Please try again.",
229
- id: "Rn9eRr",
229
+ id: "0grPwn",
230
230
  description: "Error message when renaming a connection fails"
231
231
  }) })
232
232
  }),
@@ -236,7 +236,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
236
236
  role: "status",
237
237
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_radix_ui_themes.Callout.Text, { children: warning.code === DUPLICATE_LABEL_WARNING ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
238
238
  defaultMessage: "Saved. Another {integrationName} connection already uses this name, so you may want to pick one that tells them apart.",
239
- id: "Rn2wDp",
239
+ id: "eB4eyQ",
240
240
  description: "Notice after renaming a connection to a name another connection to the same provider already has",
241
241
  values: { integrationName }
242
242
  }) : warning.message })
@@ -260,7 +260,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
260
260
  htmlFor: `rename-connection-${installation.id}`,
261
261
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
262
262
  defaultMessage: "Name",
263
- id: "Rn1lNm",
263
+ id: "KdgU9T",
264
264
  description: "Label for the connection name input"
265
265
  })
266
266
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_elements_text_field.Root, {
@@ -280,7 +280,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
280
280
  variant: "secondary",
281
281
  children: warnings.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
282
282
  defaultMessage: "Done",
283
- id: "Rn6dDn",
283
+ id: "YlARFG",
284
284
  description: "Button to close the rename dialog after a name was saved with a warning"
285
285
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
286
286
  defaultMessage: "Cancel",
@@ -293,7 +293,7 @@ const RenameConnectionDialog = ({ integrationName, installation, owner = "user",
293
293
  loading: isPending,
294
294
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
295
295
  defaultMessage: "Save",
296
- id: "Rn5sVe",
296
+ id: "JmvID+",
297
297
  description: "Button to save a connection's new name"
298
298
  })
299
299
  })]
@@ -313,7 +313,7 @@ const ConnectionCountStatus = ({ count }) => {
313
313
  state: "neutral",
314
314
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
315
315
  defaultMessage: "{count} connections",
316
- id: "Rn3cCt",
316
+ id: "ZarniP",
317
317
  description: "Status for a provider grouping two or more connections, giving how many",
318
318
  values: { count }
319
319
  })
@@ -322,21 +322,21 @@ const ConnectionCountStatus = ({ count }) => {
322
322
  const RenameMenuLabel = () => {
323
323
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
324
324
  defaultMessage: "Rename",
325
- id: "Rn6mRn",
325
+ id: "iiQbUM",
326
326
  description: "Menu option to rename one connection"
327
327
  });
328
328
  };
329
329
  const ConnectAnotherAccountMenuLabel = () => {
330
330
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
331
331
  defaultMessage: "Connect another account",
332
- id: "Rn8mCa",
332
+ id: "SNK0to",
333
333
  description: "Menu option to add another connection to the same provider"
334
334
  });
335
335
  };
336
336
  const AddConnectionButtonLabel = () => {
337
337
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
338
338
  defaultMessage: "Add connection",
339
- id: "Rn0bAc",
339
+ id: "DFzo7c",
340
340
  description: "Button to add another connection to a provider that already has several"
341
341
  });
342
342
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pipes-connections.cjs","names":["useInvalidateConnections","useClientGraphqlMutation","useTranslation","Flex","Label","Translation","Text","useState","ApiError","Callout","Button","Status"],"sources":["../../../../src/widgets/pipes/pipes-connections.tsx"],"sourcesContent":["\"use client\";\nimport { Callout, Flex, Text } from \"@radix-ui/themes\";\nimport { useEffect, useState } from \"react\";\nimport type {\n ConnectionIntent,\n DataProviderConnectionLabelResultFieldsFragment,\n UpdateDataProviderConnectionLabelInput,\n} from \"../../api/client-graphql/generated.js\";\nimport { useClientGraphqlMutation } from \"../../api/client-graphql/hooks.js\";\nimport { ApiError } from \"../../api/errors.js\";\nimport { Button, Dialog, Label, TextField } from \"../../components/elements.js\";\nimport { Status } from \"../../components/status.js\";\nimport { useInvalidateConnections } from \"../../lib/api/pipes.js\";\nimport type { DataInstallation } from \"../../lib/api/types.js\";\nimport { Translation } from \"../../lib/i18n/translation.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\nimport type { ConnectionOwner } from \"./pipes.js\";\n\n/**\n * Multiple connections per provider, shared by the member and administrator\n * widgets: naming a connection, targeting the connect flows at one exact\n * connection (or at a new one), and renaming.\n */\n\n/**\n * How one connection is named within its provider's group: the label someone\n * gave it, then the provider account it disclosed, then the provider itself.\n */\nfunction getConnectionLabel(\n integrationName: string,\n installation: DataInstallation,\n): string {\n return (\n installation.account_display_name?.trim() ||\n installation.account_identifier ||\n integrationName\n );\n}\n\n/**\n * Which connection a connect flow writes. Left unset, the flows keep the API's\n * compatibility behavior: they write the owner's single compatibility\n * connection, creating it if there is none.\n */\ntype ConnectionTarget =\n /**\n * Create another connection alongside the owner's existing ones.\n * `idempotencyKey` identifies one logical Add, so a retry after an\n * ambiguous failure returns the connection the first attempt created\n * instead of creating a second (see {@link createAddConnectionTarget}).\n */\n | { intent: \"Add\"; idempotencyKey?: string }\n /** Re-authorize, or replace the credentials of, one exact connection. */\n | { intent: \"Reauthorize\"; connectedAccountId: string };\n\n/** Requests an Add; the flow that runs it mints the idempotency key. */\nconst ADD_CONNECTION: ConnectionTarget = { intent: \"Add\" };\n\n/**\n * A random key for one logical Add. `crypto.randomUUID` needs a secure\n * context, so plain-HTTP hosts fall back to `getRandomValues`, which doesn't.\n */\nfunction createIdempotencyKey(): string {\n if (typeof crypto.randomUUID === \"function\") {\n return crypto.randomUUID();\n }\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n return Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\n \"\",\n );\n}\n\n/**\n * The target for one logical Add, carrying a fresh idempotency key. Mint it\n * once when the Add starts and reuse it for every retry of that Add; a\n * deliberate second Add gets its own. The key is only honored with the Add\n * intent, and within 24 hours of the first attempt.\n */\nfunction createAddConnectionTarget(): ConnectionTarget {\n return { intent: \"Add\", idempotencyKey: createIdempotencyKey() };\n}\n\n/**\n * The target for writing an existing connection's credentials. Standard\n * connections are only reachable by naming them; the compatibility connection\n * is what an untargeted write already means, and leaving the intent off keeps\n * working where the environment has multiple connections turned off (the API\n * refuses explicit intents there).\n */\nfunction getConnectionTarget(\n installation: DataInstallation | null | undefined,\n): ConnectionTarget | undefined {\n return installation?.connection_role === \"standard\"\n ? { intent: \"Reauthorize\", connectedAccountId: installation.id }\n : undefined;\n}\n\n/**\n * Whether a provider's connections can be renamed: only once it can hold more\n * than one, since a lone connection's name is never shown beside another's.\n * The API reports no setting for this, so it's inferred: either an add is\n * available, or a standard connection exists, which only multiple connections\n * create (and which any provider with several connections has, at the cap\n * too).\n */\nfunction canRenameConnections(integration: {\n capabilities: { canAddConnection: boolean };\n connected_accounts: DataInstallation[];\n}): boolean {\n return (\n integration.capabilities.canAddConnection ||\n integration.connected_accounts.some(\n (connection) => connection.connection_role === \"standard\",\n )\n );\n}\n\n/**\n * The `connectionIntent` / `connectedAccountId` fields of a connect input.\n * Every connect input takes these, including OAuth authorization, which has\n * no idempotency key — see {@link toCreationTargetInput} for the inputs that do.\n */\nfunction toConnectionTargetInput(target: ConnectionTarget | undefined): {\n connectionIntent?: ConnectionIntent;\n connectedAccountId?: string;\n} {\n if (!target) {\n return {};\n }\n return target.intent === \"Add\"\n ? { connectionIntent: \"Add\" }\n : {\n connectionIntent: \"Reauthorize\",\n connectedAccountId: target.connectedAccountId,\n };\n}\n\n/**\n * {@link toConnectionTargetInput} plus the Add's `idempotencyKey`, for the\n * synchronous creation inputs (API key and client credentials) that accept it.\n * Never spread this into an authorization input: the API rejects the field.\n */\nfunction toCreationTargetInput(target: ConnectionTarget | undefined): {\n connectionIntent?: ConnectionIntent;\n connectedAccountId?: string;\n idempotencyKey?: string;\n} {\n const input = toConnectionTargetInput(target);\n return target?.intent === \"Add\" && target.idempotencyKey\n ? { ...input, idempotencyKey: target.idempotencyKey }\n : input;\n}\n\n/**\n * Saves a connection's label through the owner's mutation (`null` clears it\n * back to the computed fallback) and refreshes the owner's lists.\n */\nfunction useRenameConnection(owner: ConnectionOwner) {\n const invalidateConnections = useInvalidateConnections(owner);\n return useClientGraphqlMutation({\n mutationFn: async (\n sdk,\n input: UpdateDataProviderConnectionLabelInput,\n ): Promise<DataProviderConnectionLabelResultFieldsFragment> => {\n if (owner === \"organization\") {\n const { updateOrganizationDataProviderConnectionLabel } =\n await sdk.UpdateOrganizationDataProviderConnectionLabel({ input });\n return updateOrganizationDataProviderConnectionLabel;\n }\n const { updateDataProviderConnectionLabel } =\n await sdk.UpdateDataProviderConnectionLabel({ input });\n return updateDataProviderConnectionLabel;\n },\n onSuccess: invalidateConnections,\n });\n}\n\n/** The label code the API warns with when a sibling already uses the name. */\nconst DUPLICATE_LABEL_WARNING = \"duplicate_account_display_name\";\n\n/** Maximum label length the API accepts (PVIT-904). */\nconst MAX_LABEL_LENGTH = 255;\n\n/**\n * The `accountDisplayName` field of a creation input: the trimmed name when\n * one was entered, otherwise nothing, so an untouched field never sends an\n * empty label.\n */\nfunction toAccountDisplayNameInput(name: string | undefined): {\n accountDisplayName?: string;\n} {\n const trimmed = name?.trim();\n return trimmed ? { accountDisplayName: trimmed } : {};\n}\n\ninterface ConnectionNameFieldProps {\n id: string;\n value: string;\n onChange: (value: string) => void;\n}\n\n/**\n * The optional name a connect dialog collects for the connection it creates,\n * so it can be told apart from the owner's other connections to the provider.\n * Only the sectioned experiences ask for it, and only when creating.\n */\nconst ConnectionNameField: React.FC<ConnectionNameFieldProps> = ({\n id,\n value,\n onChange,\n}) => {\n const translate = useTranslation();\n const placeholder = translate({\n defaultMessage: \"e.g. Marketing\",\n id: \"Rn4cLp\",\n description: \"Placeholder for the connection name input\",\n });\n\n return (\n <Flex direction=\"column\" gap=\"1\">\n <Flex align=\"baseline\" gap=\"2\">\n <Label htmlFor={id}>\n <Translation\n defaultMessage=\"Name\"\n id=\"Rn1lNm\"\n description=\"Label for the connection name input\"\n />\n </Label>\n <Text size=\"1\" color=\"gray\">\n <Translation\n defaultMessage=\"Optional\"\n id=\"Rn0oPt\"\n description=\"Hint beside the connection name input saying it can be left empty\"\n />\n </Text>\n </Flex>\n <TextField.Root\n id={id}\n value={value}\n maxLength={MAX_LABEL_LENGTH}\n autoComplete=\"off\"\n placeholder={placeholder}\n onChange={(event) => onChange(event.target.value)}\n />\n </Flex>\n );\n};\n\ninterface RenameConnectionDialogProps {\n integrationName: string;\n installation: DataInstallation;\n owner?: ConnectionOwner;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * Renames one connection. A duplicate name never blocks the save; when the API\n * warns about one, the dialog stays open on the saved name to say so, and the\n * field stays editable so a distinct name can be saved right away.\n */\nconst RenameConnectionDialog: React.FC<RenameConnectionDialogProps> = ({\n integrationName,\n installation,\n owner = \"user\",\n open,\n onOpenChange,\n}) => {\n const [label, setLabel] = useState(installation.account_display_name ?? \"\");\n const translate = useTranslation();\n const { mutate, data, error, reset, isPending } = useRenameConnection(owner);\n\n // Mounted only while open, so the field starts from the saved label.\n useEffect(() => {\n reset();\n }, [reset]);\n\n const trimmed = label.trim();\n // After a save that warned, the name to compare against is the one just\n // saved, so the warning can be answered with another name straight away.\n const savedLabel = data\n ? (data.connection.accountDisplayName ?? \"\")\n : (installation.account_display_name ?? \"\");\n const unchanged = trimmed === savedLabel;\n // A save's warnings describe the name it saved, so they only stand while\n // the field still shows that name. Once it's edited they (and \"Done\") give\n // way to Cancel, so closing can't be mistaken for keeping the new text.\n const warnings = unchanged ? (data?.warnings ?? []) : [];\n const errorMessage =\n error instanceof ApiError && error.message ? error.message : null;\n\n const placeholder = translate({\n defaultMessage: \"e.g. Marketing\",\n id: \"Rn4cLp\",\n description: \"Placeholder for the connection name input\",\n });\n\n return (\n <Dialog.Root open={open} onOpenChange={onOpenChange}>\n <Dialog.Content maxWidth=\"430px\">\n <Dialog.Title size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Rename {integrationName} connection\"\n id=\"Rn7tTl\"\n description=\"Dialog title for renaming one connection to a provider\"\n values={{ integrationName }}\n />\n </Dialog.Title>\n <Dialog.Description color=\"gray\" mt=\"1\">\n <Translation\n defaultMessage=\"Give this connection a name to tell it apart from your other {integrationName} connections.\"\n id=\"Rn2dSc\"\n description=\"Explains what a connection name is for\"\n values={{ integrationName }}\n />\n </Dialog.Description>\n\n {error && (\n <Callout.Root my=\"3\" color=\"red\" role=\"alert\">\n <Callout.Text>\n {errorMessage ?? (\n <Translation\n defaultMessage=\"An error occurred while renaming this connection. Please try again.\"\n id=\"Rn9eRr\"\n description=\"Error message when renaming a connection fails\"\n />\n )}\n </Callout.Text>\n </Callout.Root>\n )}\n\n {warnings.map((warning) => (\n <Callout.Root key={warning.code} my=\"3\" color=\"amber\" role=\"status\">\n <Callout.Text>\n {warning.code === DUPLICATE_LABEL_WARNING ? (\n <Translation\n defaultMessage=\"Saved. Another {integrationName} connection already uses this name, so you may want to pick one that tells them apart.\"\n id=\"Rn2wDp\"\n description=\"Notice after renaming a connection to a name another connection to the same provider already has\"\n values={{ integrationName }}\n />\n ) : (\n warning.message\n )}\n </Callout.Text>\n </Callout.Root>\n ))}\n\n <form\n onSubmit={(event) => {\n event.preventDefault();\n if (unchanged) {\n return;\n }\n mutate(\n { id: installation.id, accountDisplayName: trimmed || null },\n {\n onSuccess: (result) => {\n if (result.warnings.length === 0) {\n onOpenChange(false);\n }\n },\n },\n );\n }}\n >\n <Flex direction=\"column\" gap=\"1\" mt=\"4\">\n <Label htmlFor={`rename-connection-${installation.id}`}>\n <Translation\n defaultMessage=\"Name\"\n id=\"Rn1lNm\"\n description=\"Label for the connection name input\"\n />\n </Label>\n <TextField.Root\n id={`rename-connection-${installation.id}`}\n value={label}\n maxLength={MAX_LABEL_LENGTH}\n autoComplete=\"off\"\n placeholder={placeholder}\n onChange={(event) => setLabel(event.target.value)}\n />\n </Flex>\n\n <Flex justify=\"end\" gap=\"3\" mt=\"5\">\n <Dialog.Close>\n <Button type=\"button\" variant=\"secondary\">\n {/* With a saved name shown (and warned about), closing keeps it. */}\n {warnings.length > 0 ? (\n <Translation\n defaultMessage=\"Done\"\n id=\"Rn6dDn\"\n description=\"Button to close the rename dialog after a name was saved with a warning\"\n />\n ) : (\n <Translation\n defaultMessage=\"Cancel\"\n id=\"hHNj31\"\n description=\"Cancel button text\"\n />\n )}\n </Button>\n </Dialog.Close>\n <Button\n type=\"submit\"\n disabled={isPending || unchanged}\n loading={isPending}\n >\n <Translation\n defaultMessage=\"Save\"\n id=\"Rn5sVe\"\n description=\"Button to save a connection's new name\"\n />\n </Button>\n </Flex>\n </form>\n </Dialog.Content>\n </Dialog.Root>\n );\n};\n\ninterface ConnectionCountStatusProps {\n count: number;\n}\n\n/**\n * A provider row's status once it groups its connections, which it only does\n * for two or more — hence no singular form (plurals also need the optional\n * I18nProvider to format).\n */\nconst ConnectionCountStatus: React.FC<ConnectionCountStatusProps> = ({\n count,\n}) => {\n return (\n <Status state=\"neutral\">\n <Translation\n defaultMessage=\"{count} connections\"\n id=\"Rn3cCt\"\n description=\"Status for a provider grouping two or more connections, giving how many\"\n values={{ count }}\n />\n </Status>\n );\n};\n\nconst RenameMenuLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Rename\"\n id=\"Rn6mRn\"\n description=\"Menu option to rename one connection\"\n />\n );\n};\n\nconst ConnectAnotherAccountMenuLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Connect another account\"\n id=\"Rn8mCa\"\n description=\"Menu option to add another connection to the same provider\"\n />\n );\n};\n\nconst AddConnectionButtonLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Add connection\"\n id=\"Rn0bAc\"\n description=\"Button to add another connection to a provider that already has several\"\n />\n );\n};\nexport type { ConnectionTarget };\nexport {\n getConnectionLabel,\n ADD_CONNECTION,\n createAddConnectionTarget,\n getConnectionTarget,\n canRenameConnections,\n toConnectionTargetInput,\n toCreationTargetInput,\n toAccountDisplayNameInput,\n ConnectionNameField,\n RenameConnectionDialog,\n ConnectionCountStatus,\n RenameMenuLabel,\n ConnectAnotherAccountMenuLabel,\n AddConnectionButton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,IAAA,CAACA,6BAAAA,aAAD;EACE,gBAAe;EACf,IAAG;EACH,aAAY;CACb,CAAA;AAEL;AAEA,MAAM,uCAAiD;CACrD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,6BAAAA,aAAD;EACE,gBAAe;EACf,IAAG;EACH,aAAY;CACb,CAAA;AAEL;AAEA,MAAM,iCAA2C;CAC/C,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACA,6BAAAA,aAAD;EACE,gBAAe;EACf,IAAG;EACH,aAAY;CACb,CAAA;AAEL"}
1
+ {"version":3,"file":"pipes-connections.cjs","names":["useInvalidateConnections","useClientGraphqlMutation","useTranslation","Flex","Label","Translation","Text","useState","ApiError","Callout","Button","Status"],"sources":["../../../../src/widgets/pipes/pipes-connections.tsx"],"sourcesContent":["\"use client\";\nimport { Callout, Flex, Text } from \"@radix-ui/themes\";\nimport { useEffect, useState } from \"react\";\nimport type {\n ConnectionIntent,\n DataProviderConnectionLabelResultFieldsFragment,\n UpdateDataProviderConnectionLabelInput,\n} from \"../../api/client-graphql/generated.js\";\nimport { useClientGraphqlMutation } from \"../../api/client-graphql/hooks.js\";\nimport { ApiError } from \"../../api/errors.js\";\nimport { Button, Dialog, Label, TextField } from \"../../components/elements.js\";\nimport { Status } from \"../../components/status.js\";\nimport { useInvalidateConnections } from \"../../lib/api/pipes.js\";\nimport type { DataInstallation } from \"../../lib/api/types.js\";\nimport { Translation } from \"../../lib/i18n/translation.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\nimport type { ConnectionOwner } from \"./pipes.js\";\n\n/**\n * Multiple connections per provider, shared by the member and administrator\n * widgets: naming a connection, targeting the connect flows at one exact\n * connection (or at a new one), and renaming.\n */\n\n/**\n * How one connection is named within its provider's group: the label someone\n * gave it, then the provider account it disclosed, then the provider itself.\n */\nfunction getConnectionLabel(\n integrationName: string,\n installation: DataInstallation,\n): string {\n return (\n installation.account_display_name?.trim() ||\n installation.account_identifier ||\n integrationName\n );\n}\n\n/**\n * Which connection a connect flow writes. Left unset, the flows keep the API's\n * compatibility behavior: they write the owner's single compatibility\n * connection, creating it if there is none.\n */\ntype ConnectionTarget =\n /**\n * Create another connection alongside the owner's existing ones.\n * `idempotencyKey` identifies one logical Add, so a retry after an\n * ambiguous failure returns the connection the first attempt created\n * instead of creating a second (see {@link createAddConnectionTarget}).\n */\n | { intent: \"Add\"; idempotencyKey?: string }\n /** Re-authorize, or replace the credentials of, one exact connection. */\n | { intent: \"Reauthorize\"; connectedAccountId: string };\n\n/** Requests an Add; the flow that runs it mints the idempotency key. */\nconst ADD_CONNECTION: ConnectionTarget = { intent: \"Add\" };\n\n/**\n * A random key for one logical Add. `crypto.randomUUID` needs a secure\n * context, so plain-HTTP hosts fall back to `getRandomValues`, which doesn't.\n */\nfunction createIdempotencyKey(): string {\n if (typeof crypto.randomUUID === \"function\") {\n return crypto.randomUUID();\n }\n const bytes = crypto.getRandomValues(new Uint8Array(16));\n return Array.from(bytes, (byte) => byte.toString(16).padStart(2, \"0\")).join(\n \"\",\n );\n}\n\n/**\n * The target for one logical Add, carrying a fresh idempotency key. Mint it\n * once when the Add starts and reuse it for every retry of that Add; a\n * deliberate second Add gets its own. The key is only honored with the Add\n * intent, and within 24 hours of the first attempt.\n */\nfunction createAddConnectionTarget(): ConnectionTarget {\n return { intent: \"Add\", idempotencyKey: createIdempotencyKey() };\n}\n\n/**\n * The target for writing an existing connection's credentials. Standard\n * connections are only reachable by naming them; the compatibility connection\n * is what an untargeted write already means, and leaving the intent off keeps\n * working where the environment has multiple connections turned off (the API\n * refuses explicit intents there).\n */\nfunction getConnectionTarget(\n installation: DataInstallation | null | undefined,\n): ConnectionTarget | undefined {\n return installation?.connection_role === \"standard\"\n ? { intent: \"Reauthorize\", connectedAccountId: installation.id }\n : undefined;\n}\n\n/**\n * Whether a provider's connections can be renamed: only once it can hold more\n * than one, since a lone connection's name is never shown beside another's.\n * The API reports no setting for this, so it's inferred: either an add is\n * available, or a standard connection exists, which only multiple connections\n * create (and which any provider with several connections has, at the cap\n * too).\n */\nfunction canRenameConnections(integration: {\n capabilities: { canAddConnection: boolean };\n connected_accounts: DataInstallation[];\n}): boolean {\n return (\n integration.capabilities.canAddConnection ||\n integration.connected_accounts.some(\n (connection) => connection.connection_role === \"standard\",\n )\n );\n}\n\n/**\n * The `connectionIntent` / `connectedAccountId` fields of a connect input.\n * Every connect input takes these, including OAuth authorization, which has\n * no idempotency key — see {@link toCreationTargetInput} for the inputs that do.\n */\nfunction toConnectionTargetInput(target: ConnectionTarget | undefined): {\n connectionIntent?: ConnectionIntent;\n connectedAccountId?: string;\n} {\n if (!target) {\n return {};\n }\n return target.intent === \"Add\"\n ? { connectionIntent: \"Add\" }\n : {\n connectionIntent: \"Reauthorize\",\n connectedAccountId: target.connectedAccountId,\n };\n}\n\n/**\n * {@link toConnectionTargetInput} plus the Add's `idempotencyKey`, for the\n * synchronous creation inputs (API key and client credentials) that accept it.\n * Never spread this into an authorization input: the API rejects the field.\n */\nfunction toCreationTargetInput(target: ConnectionTarget | undefined): {\n connectionIntent?: ConnectionIntent;\n connectedAccountId?: string;\n idempotencyKey?: string;\n} {\n const input = toConnectionTargetInput(target);\n return target?.intent === \"Add\" && target.idempotencyKey\n ? { ...input, idempotencyKey: target.idempotencyKey }\n : input;\n}\n\n/**\n * Saves a connection's label through the owner's mutation (`null` clears it\n * back to the computed fallback) and refreshes the owner's lists.\n */\nfunction useRenameConnection(owner: ConnectionOwner) {\n const invalidateConnections = useInvalidateConnections(owner);\n return useClientGraphqlMutation({\n mutationFn: async (\n sdk,\n input: UpdateDataProviderConnectionLabelInput,\n ): Promise<DataProviderConnectionLabelResultFieldsFragment> => {\n if (owner === \"organization\") {\n const { updateOrganizationDataProviderConnectionLabel } =\n await sdk.UpdateOrganizationDataProviderConnectionLabel({ input });\n return updateOrganizationDataProviderConnectionLabel;\n }\n const { updateDataProviderConnectionLabel } =\n await sdk.UpdateDataProviderConnectionLabel({ input });\n return updateDataProviderConnectionLabel;\n },\n onSuccess: invalidateConnections,\n });\n}\n\n/** The label code the API warns with when a sibling already uses the name. */\nconst DUPLICATE_LABEL_WARNING = \"duplicate_account_display_name\";\n\n/** Maximum label length the API accepts (PVIT-904). */\nconst MAX_LABEL_LENGTH = 255;\n\n/**\n * The `accountDisplayName` field of a creation input: the trimmed name when\n * one was entered, otherwise nothing, so an untouched field never sends an\n * empty label.\n */\nfunction toAccountDisplayNameInput(name: string | undefined): {\n accountDisplayName?: string;\n} {\n const trimmed = name?.trim();\n return trimmed ? { accountDisplayName: trimmed } : {};\n}\n\ninterface ConnectionNameFieldProps {\n id: string;\n value: string;\n onChange: (value: string) => void;\n}\n\n/**\n * The optional name a connect dialog collects for the connection it creates,\n * so it can be told apart from the owner's other connections to the provider.\n * Only the sectioned experiences ask for it, and only when creating.\n */\nconst ConnectionNameField: React.FC<ConnectionNameFieldProps> = ({\n id,\n value,\n onChange,\n}) => {\n const translate = useTranslation();\n const placeholder = translate({\n defaultMessage: \"e.g. Marketing\",\n id: \"pWC98E\",\n description: \"Placeholder for the connection name input\",\n });\n\n return (\n <Flex direction=\"column\" gap=\"1\">\n <Flex align=\"baseline\" gap=\"2\">\n <Label htmlFor={id}>\n <Translation\n defaultMessage=\"Name\"\n id=\"KdgU9T\"\n description=\"Label for the connection name input\"\n />\n </Label>\n <Text size=\"1\" color=\"gray\">\n <Translation\n defaultMessage=\"Optional\"\n id=\"2Yy441\"\n description=\"Hint beside the connection name input saying it can be left empty\"\n />\n </Text>\n </Flex>\n <TextField.Root\n id={id}\n value={value}\n maxLength={MAX_LABEL_LENGTH}\n autoComplete=\"off\"\n placeholder={placeholder}\n onChange={(event) => onChange(event.target.value)}\n />\n </Flex>\n );\n};\n\ninterface RenameConnectionDialogProps {\n integrationName: string;\n installation: DataInstallation;\n owner?: ConnectionOwner;\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * Renames one connection. A duplicate name never blocks the save; when the API\n * warns about one, the dialog stays open on the saved name to say so, and the\n * field stays editable so a distinct name can be saved right away.\n */\nconst RenameConnectionDialog: React.FC<RenameConnectionDialogProps> = ({\n integrationName,\n installation,\n owner = \"user\",\n open,\n onOpenChange,\n}) => {\n const [label, setLabel] = useState(installation.account_display_name ?? \"\");\n const translate = useTranslation();\n const { mutate, data, error, reset, isPending } = useRenameConnection(owner);\n\n // Mounted only while open, so the field starts from the saved label.\n useEffect(() => {\n reset();\n }, [reset]);\n\n const trimmed = label.trim();\n // After a save that warned, the name to compare against is the one just\n // saved, so the warning can be answered with another name straight away.\n const savedLabel = data\n ? (data.connection.accountDisplayName ?? \"\")\n : (installation.account_display_name ?? \"\");\n const unchanged = trimmed === savedLabel;\n // A save's warnings describe the name it saved, so they only stand while\n // the field still shows that name. Once it's edited they (and \"Done\") give\n // way to Cancel, so closing can't be mistaken for keeping the new text.\n const warnings = unchanged ? (data?.warnings ?? []) : [];\n const errorMessage =\n error instanceof ApiError && error.message ? error.message : null;\n\n const placeholder = translate({\n defaultMessage: \"e.g. Marketing\",\n id: \"pWC98E\",\n description: \"Placeholder for the connection name input\",\n });\n\n return (\n <Dialog.Root open={open} onOpenChange={onOpenChange}>\n <Dialog.Content maxWidth=\"430px\">\n <Dialog.Title size=\"3\" weight=\"bold\">\n <Translation\n defaultMessage=\"Rename {integrationName} connection\"\n id=\"c1jT5Q\"\n description=\"Dialog title for renaming one connection to a provider\"\n values={{ integrationName }}\n />\n </Dialog.Title>\n <Dialog.Description color=\"gray\" mt=\"1\">\n <Translation\n defaultMessage=\"Give this connection a name to tell it apart from your other {integrationName} connections.\"\n id=\"Ptf2r1\"\n description=\"Explains what a connection name is for\"\n values={{ integrationName }}\n />\n </Dialog.Description>\n\n {error && (\n <Callout.Root my=\"3\" color=\"red\" role=\"alert\">\n <Callout.Text>\n {errorMessage ?? (\n <Translation\n defaultMessage=\"An error occurred while renaming this connection. Please try again.\"\n id=\"0grPwn\"\n description=\"Error message when renaming a connection fails\"\n />\n )}\n </Callout.Text>\n </Callout.Root>\n )}\n\n {warnings.map((warning) => (\n <Callout.Root key={warning.code} my=\"3\" color=\"amber\" role=\"status\">\n <Callout.Text>\n {warning.code === DUPLICATE_LABEL_WARNING ? (\n <Translation\n defaultMessage=\"Saved. Another {integrationName} connection already uses this name, so you may want to pick one that tells them apart.\"\n id=\"eB4eyQ\"\n description=\"Notice after renaming a connection to a name another connection to the same provider already has\"\n values={{ integrationName }}\n />\n ) : (\n warning.message\n )}\n </Callout.Text>\n </Callout.Root>\n ))}\n\n <form\n onSubmit={(event) => {\n event.preventDefault();\n if (unchanged) {\n return;\n }\n mutate(\n { id: installation.id, accountDisplayName: trimmed || null },\n {\n onSuccess: (result) => {\n if (result.warnings.length === 0) {\n onOpenChange(false);\n }\n },\n },\n );\n }}\n >\n <Flex direction=\"column\" gap=\"1\" mt=\"4\">\n <Label htmlFor={`rename-connection-${installation.id}`}>\n <Translation\n defaultMessage=\"Name\"\n id=\"KdgU9T\"\n description=\"Label for the connection name input\"\n />\n </Label>\n <TextField.Root\n id={`rename-connection-${installation.id}`}\n value={label}\n maxLength={MAX_LABEL_LENGTH}\n autoComplete=\"off\"\n placeholder={placeholder}\n onChange={(event) => setLabel(event.target.value)}\n />\n </Flex>\n\n <Flex justify=\"end\" gap=\"3\" mt=\"5\">\n <Dialog.Close>\n <Button type=\"button\" variant=\"secondary\">\n {/* With a saved name shown (and warned about), closing keeps it. */}\n {warnings.length > 0 ? (\n <Translation\n defaultMessage=\"Done\"\n id=\"YlARFG\"\n description=\"Button to close the rename dialog after a name was saved with a warning\"\n />\n ) : (\n <Translation\n defaultMessage=\"Cancel\"\n id=\"hHNj31\"\n description=\"Cancel button text\"\n />\n )}\n </Button>\n </Dialog.Close>\n <Button\n type=\"submit\"\n disabled={isPending || unchanged}\n loading={isPending}\n >\n <Translation\n defaultMessage=\"Save\"\n id=\"JmvID+\"\n description=\"Button to save a connection's new name\"\n />\n </Button>\n </Flex>\n </form>\n </Dialog.Content>\n </Dialog.Root>\n );\n};\n\ninterface ConnectionCountStatusProps {\n count: number;\n}\n\n/**\n * A provider row's status once it groups its connections, which it only does\n * for two or more — hence no singular form (plurals also need the optional\n * I18nProvider to format).\n */\nconst ConnectionCountStatus: React.FC<ConnectionCountStatusProps> = ({\n count,\n}) => {\n return (\n <Status state=\"neutral\">\n <Translation\n defaultMessage=\"{count} connections\"\n id=\"ZarniP\"\n description=\"Status for a provider grouping two or more connections, giving how many\"\n values={{ count }}\n />\n </Status>\n );\n};\n\nconst RenameMenuLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Rename\"\n id=\"iiQbUM\"\n description=\"Menu option to rename one connection\"\n />\n );\n};\n\nconst ConnectAnotherAccountMenuLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Connect another account\"\n id=\"SNK0to\"\n description=\"Menu option to add another connection to the same provider\"\n />\n );\n};\n\nconst AddConnectionButtonLabel: React.FC = () => {\n return (\n <Translation\n defaultMessage=\"Add connection\"\n id=\"DFzo7c\"\n description=\"Button to add another connection to a provider that already has several\"\n />\n );\n};\nexport type { ConnectionTarget };\nexport {\n getConnectionLabel,\n ADD_CONNECTION,\n createAddConnectionTarget,\n getConnectionTarget,\n canRenameConnections,\n toConnectionTargetInput,\n toCreationTargetInput,\n toAccountDisplayNameInput,\n ConnectionNameField,\n RenameConnectionDialog,\n ConnectionCountStatus,\n RenameMenuLabel,\n ConnectAnotherAccountMenuLabel,\n AddConnectionButtonLabel,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAS,mBACP,iBACA,cACQ;CACR,OACE,aAAa,sBAAsB,KAAK,KACxC,aAAa,sBACb;AAEJ;;AAmBA,MAAM,iBAAmC,EAAE,QAAQ,MAAM;;;;;AAMzD,SAAS,uBAA+B;CACtC,IAAI,OAAO,OAAO,eAAe,YAC/B,OAAO,OAAO,WAAW;CAE3B,MAAM,QAAQ,OAAO,gCAAgB,IAAI,WAAW,EAAE,CAAC;CACvD,OAAO,MAAM,KAAK,QAAQ,SAAS,K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usePipesCredentialAttribution() {
19
19
  error: sessionUserId && hostUserId && hostUserId !== sessionUserId ? translate({
20
20
  defaultMessage: "Shared credentials must be attributed to the signed-in user. The application must omit PipesAdmin's userId prop or pass the signed-in user's WorkOS user ID.",
21
21
  description: "Configuration error when the host-supplied PipesAdmin user ID differs from the authenticated user",
22
- id: "pipesCredentialUserMismatch"
22
+ id: "jhlRXY"
23
23
  }) : !userId ? translate({
24
24
  defaultMessage: "Shared credentials require an acting WorkOS user. The application must use a user-backed session or supply the acting person's WorkOS user ID through PipesAdmin's userId prop when using an application credential token.",
25
25
  description: "Configuration guidance for shared credential writes without an acting user; no user ID entry is requested",
26
- id: "pipesCredentialUserRequired"
26
+ id: "LXD0s/"
27
27
  }) : void 0
28
28
  };
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pipes-credential-attribution.cjs","names":["createContext","useContext","useApi","useTranslation","getClaims","getAuthenticatedUserId"],"sources":["../../../../src/widgets/pipes/pipes-credential-attribution.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport { useApi } from \"../../api/api-provider.js\";\nimport { getAuthenticatedUserId, getClaims } from \"../../api/claims.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\n\nconst PipesCredentialUserIdContext = createContext<string | undefined>(\n undefined,\n);\nPipesCredentialUserIdContext.displayName = \"PipesCredentialUserIdContext\";\n\nfunction usePipesCredentialAttribution() {\n const hostUserId = useContext(PipesCredentialUserIdContext)?.trim();\n const { authToken } = useApi();\n const translate = useTranslation();\n const claims = authToken ? getClaims(authToken) : undefined;\n const sessionUserId = claims && getAuthenticatedUserId(claims);\n const userId =\n sessionUserId ??\n (claims?.sub_type === \"client_api_credential\" &&\n hostUserId?.startsWith(\"user_\")\n ? hostUserId\n : undefined);\n\n const error =\n sessionUserId && hostUserId && hostUserId !== sessionUserId\n ? translate({\n defaultMessage:\n \"Shared credentials must be attributed to the signed-in user. The application must omit PipesAdmin's userId prop or pass the signed-in user's WorkOS user ID.\",\n description:\n \"Configuration error when the host-supplied PipesAdmin user ID differs from the authenticated user\",\n id: \"pipesCredentialUserMismatch\",\n })\n : !userId\n ? translate({\n defaultMessage:\n \"Shared credentials require an acting WorkOS user. The application must use a user-backed session or supply the acting person's WorkOS user ID through PipesAdmin's userId prop when using an application credential token.\",\n description:\n \"Configuration guidance for shared credential writes without an acting user; no user ID entry is requested\",\n id: \"pipesCredentialUserRequired\",\n })\n : undefined;\n\n return { userId, error };\n}\nexport { PipesCredentialUserIdContext, usePipesCredentialAttribution };\n"],"mappings":";;;;;;;AAOA,MAAM,gCAAA,GAA+BA,MAAAA,cAAAA,CACnC,MACF;AACA,6BAA6B,cAAc;AAE3C,SAAS,gCAAgC;CACvC,MAAM,cAAA,GAAaC,MAAAA,WAAAA,CAAW,4BAA4B,CAAC,EAAE,KAAK;CAClE,MAAM,EAAE,cAAcC,yBAAAA,OAAO;CAC7B,MAAM,YAAYC,iCAAAA,eAAe;CACjC,MAAM,SAAS,YAAYC,mBAAAA,UAAU,SAAS,IAAI;CAClD,MAAM,gBAAgB,UAAUC,mBAAAA,uBAAuB,MAAM;CAC7D,MAAM,SACJ,kBACC,QAAQ,aAAa,2BACtB,YAAY,WAAW,OAAO,IAC1B,aACA;CAqBN,OAAO;EAAE;EAAQ,OAlBf,iBAAiB,cAAc,eAAe,gBAC1C,UAAU;GACR,gBACE;GACF,aACE;GACF,IAAI;EACN,CAAC,IACD,CAAC,SACC,UAAU;GACR,gBACE;GACF,aACE;GACF,IAAI;EACN,CAAC,IACD;CAEe;AACzB"}
1
+ {"version":3,"file":"pipes-credential-attribution.cjs","names":["createContext","useContext","useApi","useTranslation","getClaims","getAuthenticatedUserId"],"sources":["../../../../src/widgets/pipes/pipes-credential-attribution.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport { useApi } from \"../../api/api-provider.js\";\nimport { getAuthenticatedUserId, getClaims } from \"../../api/claims.js\";\nimport { useTranslation } from \"../../lib/i18n/use-translation.js\";\n\nconst PipesCredentialUserIdContext = createContext<string | undefined>(\n undefined,\n);\nPipesCredentialUserIdContext.displayName = \"PipesCredentialUserIdContext\";\n\nfunction usePipesCredentialAttribution() {\n const hostUserId = useContext(PipesCredentialUserIdContext)?.trim();\n const { authToken } = useApi();\n const translate = useTranslation();\n const claims = authToken ? getClaims(authToken) : undefined;\n const sessionUserId = claims && getAuthenticatedUserId(claims);\n const userId =\n sessionUserId ??\n (claims?.sub_type === \"client_api_credential\" &&\n hostUserId?.startsWith(\"user_\")\n ? hostUserId\n : undefined);\n\n const error =\n sessionUserId && hostUserId && hostUserId !== sessionUserId\n ? translate({\n defaultMessage:\n \"Shared credentials must be attributed to the signed-in user. The application must omit PipesAdmin's userId prop or pass the signed-in user's WorkOS user ID.\",\n description:\n \"Configuration error when the host-supplied PipesAdmin user ID differs from the authenticated user\",\n id: \"jhlRXY\",\n })\n : !userId\n ? translate({\n defaultMessage:\n \"Shared credentials require an acting WorkOS user. The application must use a user-backed session or supply the acting person's WorkOS user ID through PipesAdmin's userId prop when using an application credential token.\",\n description:\n \"Configuration guidance for shared credential writes without an acting user; no user ID entry is requested\",\n id: \"LXD0s/\",\n })\n : undefined;\n\n return { userId, error };\n}\nexport { PipesCredentialUserIdContext, usePipesCredentialAttribution };\n"],"mappings":";;;;;;;AAOA,MAAM,gCAAA,GAA+BA,MAAAA,cAAAA,CACnC,MACF;AACA,6BAA6B,cAAc;AAE3C,SAAS,gCAAgC;CACvC,MAAM,cAAA,GAAaC,MAAAA,WAAAA,CAAW,4BAA4B,CAAC,EAAE,KAAK;CAClE,MAAM,EAAE,cAAcC,yBAAAA,OAAO;CAC7B,MAAM,YAAYC,iCAAAA,eAAe;CACjC,MAAM,SAAS,YAAYC,mBAAAA,UAAU,SAAS,IAAI;CAClD,MAAM,gBAAgB,UAAUC,mBAAAA,uBAAuB,MAAM;CAC7D,MAAM,SACJ,kBACC,QAAQ,aAAa,2BACtB,YAAY,WAAW,OAAO,IAC1B,aACA;CAqBN,OAAO;EAAE;EAAQ,OAlBf,iBAAiB,cAAc,eAAe,gBAC1C,UAAU;GACR,gBACE;GACF,aACE;GACF,IAAI;EACN,CAAC,IACD,CAAC,SACC,UAAU;GACR,gBACE;GACF,aACE;GACF,IAAI;EACN,CAAC,IACD;CAEe;AACzB"}
@@ -1723,7 +1723,7 @@ const SharedConnectionStatus = ({ connection }) => {
1723
1723
  state: "success",
1724
1724
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
1725
1725
  defaultMessage: "Available",
1726
- id: "_jQjSu",
1726
+ id: "/jQjSu",
1727
1727
  description: "Status text for a shared connection the member can use"
1728
1728
  })
1729
1729
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_status.Status, {
@@ -1817,7 +1817,7 @@ const MemberConnectionStatus = ({ installation, connectionError }) => {
1817
1817
  description: "Status text for a connection established with client credentials"
1818
1818
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
1819
1819
  defaultMessage: "Connected via OAuth",
1820
- id: "pJcK_M",
1820
+ id: "pJcK/M",
1821
1821
  description: "Status text for a connection established with OAuth"
1822
1822
  })
1823
1823
  });
@@ -1825,7 +1825,7 @@ const MemberConnectionStatus = ({ installation, connectionError }) => {
1825
1825
  state: "warning",
1826
1826
  children: installation.auth_method === "api_key" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
1827
1827
  defaultMessage: "Update your API key",
1828
- id: "-YLPTk",
1828
+ id: "+YLPTk",
1829
1829
  description: "Status text for a connection whose API key stopped working"
1830
1830
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
1831
1831
  defaultMessage: "Requires reauthorization",
@@ -1924,7 +1924,7 @@ const MemberConnectionActions = ({ integration, installation, label, onConnect,
1924
1924
  onClick: openApiKey,
1925
1925
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
1926
1926
  defaultMessage: "Update key",
1927
- id: "MP-aOE",
1927
+ id: "MP+aOE",
1928
1928
  description: "Button to replace the API key of a connection that stopped working"
1929
1929
  })
1930
1930
  }) : isClientCredentialsInstallation ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_elements_button.Button, {
@@ -2132,7 +2132,7 @@ const PipesSections = ({ integrations, hasUnfilteredIntegrations, sharedConnecti
2132
2132
  children: [(isSharedLoading || sharedConnections.length > 0 || hasUnfilteredSharedConnections) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PipesSection, {
2133
2133
  title: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
2134
2134
  defaultMessage: "Shared connections",
2135
- id: "Fcd-bK",
2135
+ id: "Fcd+bK",
2136
2136
  description: "Heading for the section listing connections the organization owns"
2137
2137
  }),
2138
2138
  description: organizationName ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
@@ -2149,7 +2149,7 @@ const PipesSections = ({ integrations, hasUnfilteredIntegrations, sharedConnecti
2149
2149
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PipesSection, {
2150
2150
  title: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {
2151
2151
  defaultMessage: "Your connections",
2152
- id: "-VDI3G",
2152
+ id: "+VDI3G",
2153
2153
  description: "Heading for the section listing the member's own connections"
2154
2154
  }),
2155
2155
  description: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_lib_i18n_translation.Translation, {