@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.
@@ -31,13 +31,13 @@ var import_pipes = require("./lib/pipes.js");
31
31
  var import_endpoint = require("./api/endpoint.js");
32
32
  var import_use_is_hydrated = require("./lib/use-is-hydrated.js");
33
33
  var import_error_boundary = require("./lib/error-boundary.js");
34
- const Pipes = ({ authToken, ...domProps }) => {
34
+ const PipesRoot = ({ authToken, ...props }) => {
35
35
  const baseUrl = (0, import_widgets_context.useWorkOsApiUrl)();
36
36
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
37
  import_error_boundary.ErrorBoundary,
38
38
  {
39
- fallbackRender: ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesError, { ...domProps, error }),
40
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_api_provider.ApiProvider, { widgetType: "pipes", authToken, baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesImpl, { ...domProps }) })
39
+ fallbackRender: ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesError, { ...props, error }),
40
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_api_provider.ApiProvider, { widgetType: "pipes", authToken, baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesImpl, { ...props }) })
41
41
  }
42
42
  );
43
43
  };
@@ -56,7 +56,33 @@ function matchesPipesFilterCriteria(integration, criteria) {
56
56
  }
57
57
  return true;
58
58
  }
59
+ function applySharedPipesFilter(connections, filter) {
60
+ if (!filter) {
61
+ return connections;
62
+ }
63
+ if (typeof filter === "function") {
64
+ return connections.filter(filter);
65
+ }
66
+ const { slugs } = filter;
67
+ return slugs ? connections.filter((connection) => slugs.includes(connection.slug)) : connections;
68
+ }
69
+ function applyPipesFilter(integrations, filter) {
70
+ if (!filter) {
71
+ return integrations;
72
+ }
73
+ return typeof filter === "function" ? integrations.filter((integration) => filter(integration)) : integrations.filter(
74
+ (integration) => matchesPipesFilterCriteria(integration, filter)
75
+ );
76
+ }
59
77
  const PipesImpl = (props) => {
78
+ if (props.enableSharedConnections) {
79
+ const { enableSharedConnections: enableSharedConnections2, ...sectionsProps } = props;
80
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesSectionsImpl, { ...sectionsProps });
81
+ }
82
+ const { enableSharedConnections, ...personalProps } = props;
83
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PipesPersonalImpl, { ...personalProps });
84
+ };
85
+ const PipesPersonalImpl = (props) => {
60
86
  const isHydrated = (0, import_use_is_hydrated.useIsHydrated)();
61
87
  const integrations = (0, import_endpoint.useMyDataIntegrations)();
62
88
  if (!isHydrated || integrations.isLoading) {
@@ -66,15 +92,50 @@ const PipesImpl = (props) => {
66
92
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesError, { error: integrations.error, ...props });
67
93
  }
68
94
  if (integrations.isSuccess) {
69
- const all = integrations.data.data;
70
- const { filter } = props;
71
- const visible = filter ? typeof filter === "function" ? all.filter(filter) : all.filter(
72
- (integration) => matchesPipesFilterCriteria(integration, filter)
73
- ) : all;
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.Pipes, { integrations: visible, ...props });
95
+ const visible = applyPipesFilter(integrations.data.data, props.filter);
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
97
+ import_pipes.Pipes,
98
+ {
99
+ integrations: visible,
100
+ hasUnfilteredIntegrations: integrations.data.data.length > 0,
101
+ ...props
102
+ }
103
+ );
75
104
  }
76
105
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesError, { error: integrations.error, ...props });
77
106
  };
107
+ const PipesSectionsImpl = (props) => {
108
+ const isHydrated = (0, import_use_is_hydrated.useIsHydrated)();
109
+ const integrations = (0, import_endpoint.useMyDataIntegrations)();
110
+ const shared = (0, import_endpoint.useSharedDataConnections)();
111
+ const organizations = (0, import_endpoint.useOrganizations)();
112
+ const organizationName = organizations.data?.data.find(
113
+ (organization) => organization.current
114
+ )?.name;
115
+ if (!isHydrated || integrations.isLoading) {
116
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesLoading, { count: 6, ...props });
117
+ }
118
+ if (integrations.isError || !integrations.isSuccess) {
119
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_pipes.PipesError, { error: integrations.error, ...props });
120
+ }
121
+ const visible = applyPipesFilter(integrations.data.data, props.filter);
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
123
+ import_pipes.PipesSections,
124
+ {
125
+ integrations: visible,
126
+ hasUnfilteredIntegrations: integrations.data.data.length > 0,
127
+ sharedConnections: applySharedPipesFilter(
128
+ shared.data?.data ?? [],
129
+ props.filter
130
+ ),
131
+ hasUnfilteredSharedConnections: (shared.data?.data.length ?? 0) > 0,
132
+ isSharedLoading: shared.isPending && shared.failureCount === 0,
133
+ organizationName,
134
+ ...props
135
+ }
136
+ );
137
+ };
138
+ const Pipes = PipesRoot;
78
139
  // Annotate the CommonJS export names for ESM import in node:
79
140
  0 && (module.exports = {
80
141
  Pipes,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pipes.client.tsx"],"sourcesContent":["\"use client\";\nimport { ApiProvider, AuthToken } from \"./api/api-provider.js\";\nimport { useWorkOsApiUrl } from \"./lib/widgets-context.js\";\nimport {\n Pipes as PipesPresentational,\n PipesError,\n PipesLoading,\n} from \"./lib/pipes.js\";\nimport type { PipesErrorProps, PipesLoadingProps } from \"./lib/pipes.js\";\nimport { DataIntegration, useMyDataIntegrations } from \"./api/endpoint.js\";\nimport { useIsHydrated } from \"./lib/use-is-hydrated.js\";\nimport { ErrorBoundary } from \"./lib/error-boundary.js\";\nimport { WidgetRootDomProps } from \"./lib/utils.js\";\n\n/** An auth method a provider advertises (defaults to `oauth` when unset). */\ntype PipesAuthMethod = NonNullable<DataIntegration[\"authMethods\"]>[number];\n\n/**\n * Serializable criteria for narrowing which integrations render. All provided\n * criteria are ANDed; an absent criterion is ignored. Safe to pass from a\n * Server Component, since props cross the server/client boundary.\n */\ninterface PipesFilterCriteria {\n /** Render only integrations whose `slug` is in this list. */\n slugs?: string[];\n /** Render only integrations whose `integrationType` is in this list. */\n integrationTypes?: string[];\n /** Render only integrations that advertise at least one of these methods. */\n authMethods?: PipesAuthMethod[];\n}\n\n/**\n * Narrows which enabled integrations the widget renders. Either a predicate\n * (use from a Client Component host) or serializable criteria (use from a\n * Server Component host, where props must cross the server/client boundary).\n */\ntype PipesFilter =\n | PipesFilterCriteria\n | ((integration: DataIntegration) => boolean);\n\ninterface PipesProps extends WidgetRootDomProps {\n authToken: AuthToken;\n /**\n * Optional filter that narrows which enabled integrations the widget\n * renders. The widget still fetches the full set of integrations the user's\n * organization has enabled (plus any the user is still connected to so they\n * can disconnect); this prop only controls which of those rows are shown.\n *\n * Accepts either form:\n *\n * - **Serializable criteria** (`{ slugs, integrationTypes, authMethods }`),\n * ANDed together. This is the form to use when `<Pipes>` is embedded in a\n * Server Component (the documented token-minting pattern), because props\n * must be serializable across the server/client boundary and plain objects\n * survive it. e.g. `filter={{ slugs: [\"google-drive\"] }}`.\n *\n * - **A predicate** `((integration) => boolean)` for arbitrary filtering by any\n * field on the integration (`authMethods`, `integrationType`,\n * `installation.state`, etc.). A function is **not serializable across the\n * server/client boundary**: the predicate must be defined inside client\n * code and must never be passed in from a Server Component. Concretely, a\n * host using the App Router server-component pattern that needs a predicate\n * must author its own `\"use client\"` wrapper that *owns* the predicate and\n * receives only serializable props (e.g. `authToken`) from the server page.\n *\n * Undefined renders every enabled integration (the default).\n */\n filter?: PipesFilter;\n}\n\nconst Pipes: React.FC<PipesProps> = ({ authToken, ...domProps }) => {\n const baseUrl = useWorkOsApiUrl();\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => <PipesError {...domProps} error={error} />}\n >\n <ApiProvider widgetType=\"pipes\" authToken={authToken} baseUrl={baseUrl}>\n <PipesImpl {...domProps} />\n </ApiProvider>\n </ErrorBoundary>\n );\n};\n\n/**\n * Evaluates serializable {@link PipesFilterCriteria} against an integration.\n * Provided criteria are ANDed; an integration with no declared `authMethods`\n * is treated as `oauth` (matching the widget's connect-method defaults).\n */\nfunction matchesPipesFilterCriteria(\n integration: DataIntegration,\n criteria: PipesFilterCriteria,\n): boolean {\n if (criteria.slugs && !criteria.slugs.includes(integration.slug)) {\n return false;\n }\n if (\n criteria.integrationTypes &&\n !criteria.integrationTypes.includes(integration.integrationType)\n ) {\n return false;\n }\n if (criteria.authMethods) {\n const methods = integration.authMethods ?? [\"oauth\"];\n if (!criteria.authMethods.some((method) => methods.includes(method))) {\n return false;\n }\n }\n return true;\n}\n\nconst PipesImpl = (props: Omit<PipesProps, \"authToken\">) => {\n const isHydrated = useIsHydrated();\n const integrations = useMyDataIntegrations();\n\n if (!isHydrated || integrations.isLoading) {\n return <PipesLoading count={6} {...props} />;\n }\n\n if (integrations.isError) {\n return <PipesError error={integrations.error} {...props} />;\n }\n\n if (integrations.isSuccess) {\n const all = integrations.data.data;\n const { filter } = props;\n const visible = filter\n ? typeof filter === \"function\"\n ? all.filter(filter)\n : all.filter((integration) =>\n matchesPipesFilterCriteria(integration, filter),\n )\n : all;\n\n return <PipesPresentational integrations={visible} {...props} />;\n }\n\n return <PipesError error={integrations.error} {...props} />;\n};\n\nexport type {\n PipesProps,\n PipesFilter,\n PipesFilterCriteria,\n PipesAuthMethod,\n PipesLoadingProps,\n PipesErrorProps,\n};\nexport { Pipes, PipesLoading, PipesError };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2EqC;AA1ErC,0BAAuC;AACvC,6BAAgC;AAChC,mBAIO;AAEP,sBAAuD;AACvD,6BAA8B;AAC9B,4BAA8B;AA2D9B,MAAM,QAA8B,CAAC,EAAE,W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AAAA,EAChE;AAEA,SAAO,4CAAC,2BAAW,OAAO,aAAa,OAAQ,GAAG,OAAO;AAC3D;","names":["PipesPresentational"]}
1
+ {"version":3,"sources":["../../src/pipes.client.tsx"],"sourcesContent":["\"use client\";\nimport { ApiProvider, AuthToken } from \"./api/api-provider.js\";\nimport { useWorkOsApiUrl } from \"./lib/widgets-context.js\";\nimport {\n Pipes as PipesPresentational,\n PipesSections as PipesSectionsPresentational,\n PipesError,\n PipesLoading,\n} from \"./lib/pipes.js\";\nimport type { PipesErrorProps, PipesLoadingProps } from \"./lib/pipes.js\";\nimport {\n DataIntegration,\n DataIntegrationWithConnections,\n SharedDataConnection,\n useMyDataIntegrations,\n useOrganizations,\n useSharedDataConnections,\n} from \"./api/endpoint.js\";\nimport { useIsHydrated } from \"./lib/use-is-hydrated.js\";\nimport { ErrorBoundary } from \"./lib/error-boundary.js\";\nimport { WidgetRootDomProps } from \"./lib/utils.js\";\n\n/** An auth method a provider advertises (defaults to `oauth` when unset). */\ntype PipesAuthMethod = NonNullable<DataIntegration[\"authMethods\"]>[number];\n\n/**\n * Serializable criteria for narrowing which integrations render. All provided\n * criteria are ANDed; an absent criterion is ignored. Safe to pass from a\n * Server Component, since props cross the server/client boundary.\n */\ninterface PipesFilterCriteria {\n /** Render only integrations whose `slug` is in this list. */\n slugs?: string[];\n /** Render only integrations whose `integrationType` is in this list. */\n integrationTypes?: string[];\n /** Render only integrations that advertise at least one of these methods. */\n authMethods?: PipesAuthMethod[];\n}\n\n/**\n * Narrows which enabled integrations the widget renders. The widget still\n * fetches the full set of integrations the user's organization has enabled\n * (plus any the user is still connected to so they can disconnect); a filter\n * only controls which of those rows are shown, in either of two forms:\n *\n * - **Serializable criteria** (`{ slugs, integrationTypes, authMethods }`),\n * ANDed together. This is the form to use when `<Pipes>` is embedded in a\n * Server Component (the documented token-minting pattern), because props must\n * be serializable across the server/client boundary and plain objects survive\n * it. e.g. `filter={{ slugs: [\"google-drive\"] }}`.\n *\n * - **A predicate** `((integration) => boolean)` for arbitrary filtering by any\n * field on the integration (`authMethods`, `integrationType`,\n * `installation.state`, etc.). A function is **not serializable across the\n * server/client boundary**: the predicate must be defined inside client code\n * and must never be passed in from a Server Component. Concretely, a host\n * using the App Router server-component pattern that needs a predicate must\n * author its own `\"use client\"` wrapper that *owns* the predicate and\n * receives only serializable props (e.g. `authToken`) from the server page.\n *\n * Undefined renders every enabled integration (the default).\n */\ntype PipesFilter =\n | PipesFilterCriteria\n | ((integration: DataIntegration) => boolean);\n\n/** A row the widget renders when `enableSharedConnections` is on. */\ntype PipesConnection = DataIntegrationWithConnections | SharedDataConnection;\n\n/**\n * {@link PipesFilter} as `enableSharedConnections` widens it: the same two\n * forms, except they narrow both sections. The predicate also sees the\n * organization's shared rows, discriminated with `\"integrationType\" in\n * connection` — shared rows carry none of the provider metadata the member's\n * own rows do. Neither `ownership` nor `connected_accounts` discriminates\n * them: the member's own connections can be `\"organization\"` too, and both\n * payloads carry `connected_accounts` (of different element types). Criteria\n * narrow shared rows by `slugs` alone, for the same want of metadata.\n */\ntype PipesConnectionFilter =\n | PipesFilterCriteria\n | ((connection: PipesConnection) => boolean);\n\n/** The unsectioned widget, whose `filter` is what it always was. */\ntype PipesPersonalProps = WidgetRootDomProps & {\n authToken: AuthToken;\n /**\n * Defaults to `false`, which renders the single unsectioned list of the\n * member's own connections and never requests shared connections.\n */\n enableSharedConnections?: false;\n /** Narrows the member's own connections: {@link PipesFilter}. */\n filter?: PipesFilter;\n};\n\n/**\n * The sectioned widget, whose `filter` also narrows the shared section and so\n * takes the widened predicate.\n */\ntype PipesSectionsProps = WidgetRootDomProps & {\n authToken: AuthToken;\n /**\n * Opt in to the sectioned member experience: the connections the organization\n * owns and shares with everyone, followed by the member's own connections.\n *\n * Shared connections are read-only for members — they carry no\n * credential-management actions — and are fetched separately from the\n * member's own connections, so the personal section renders as soon as it\n * resolves regardless of the shared one.\n *\n * Typed `boolean` rather than `true` so a host can forward a runtime feature\n * flag: a predicate has to cope with shared rows whenever the flag can be on.\n */\n enableSharedConnections: boolean;\n /** Narrows both sections: {@link PipesConnectionFilter}. */\n filter?: PipesConnectionFilter;\n};\n\ntype PipesProps = PipesPersonalProps | PipesSectionsProps;\n\ntype PipesImplProps =\n | Omit<PipesPersonalProps, \"authToken\">\n | Omit<PipesSectionsProps, \"authToken\">;\n\n/**\n * Overloads rather than one props union, so that opting in widens the\n * predicate's parameter for that host alone while every other host's `filter`\n * stays exactly as it was. A union leaves `enableSharedConnections={false}`\n * satisfying both members — the opt-in one accepts every `boolean` — leaving an\n * inline predicate no single contextual type to draw on (`TS7006`). Overloads\n * are ordered instead: a literal `false` resolves to the personal signature,\n * and anything else, a runtime flag included, to the widened one.\n *\n * The last signature takes the whole union, so that a wrapper forwarding\n * `PipesProps` it hasn't narrowed (`<Pipes {...props} />`) still resolves, and\n * so that `React.ComponentProps<typeof Pipes>` — which reads the last\n * signature — describes the widget rather than only its opted-in half.\n */\ninterface PipesComponent {\n (props: PipesPersonalProps): React.ReactNode;\n (props: PipesSectionsProps): React.ReactNode;\n (props: PipesProps): React.ReactNode;\n}\n\nconst PipesRoot = ({ authToken, ...props }: PipesProps) => {\n const baseUrl = useWorkOsApiUrl();\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => <PipesError {...props} error={error} />}\n >\n <ApiProvider widgetType=\"pipes\" authToken={authToken} baseUrl={baseUrl}>\n <PipesImpl {...props} />\n </ApiProvider>\n </ErrorBoundary>\n );\n};\n\n/**\n * Evaluates serializable {@link PipesFilterCriteria} against an integration.\n * Provided criteria are ANDed; an integration with no declared `authMethods`\n * is treated as `oauth` (matching the widget's connect-method defaults).\n */\nfunction matchesPipesFilterCriteria(\n integration: DataIntegration,\n criteria: PipesFilterCriteria,\n): boolean {\n if (criteria.slugs && !criteria.slugs.includes(integration.slug)) {\n return false;\n }\n if (\n criteria.integrationTypes &&\n !criteria.integrationTypes.includes(integration.integrationType)\n ) {\n return false;\n }\n if (criteria.authMethods) {\n const methods = integration.authMethods ?? [\"oauth\"];\n if (!criteria.authMethods.some((method) => methods.includes(method))) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Narrows shared connections. Criteria match them on `slugs` alone, since their\n * payload carries none of the provider metadata the other criteria read.\n */\nfunction applySharedPipesFilter(\n connections: SharedDataConnection[],\n filter: PipesConnectionFilter | undefined,\n): SharedDataConnection[] {\n if (!filter) {\n return connections;\n }\n\n if (typeof filter === \"function\") {\n return connections.filter(filter);\n }\n\n const { slugs } = filter;\n\n return slugs\n ? connections.filter((connection) => slugs.includes(connection.slug))\n : connections;\n}\n\n/** Applies a {@link PipesFilter} in either of its forms. */\nfunction applyPipesFilter(\n integrations: DataIntegrationWithConnections[],\n filter: PipesFilter | PipesConnectionFilter | undefined,\n): DataIntegrationWithConnections[] {\n if (!filter) {\n return integrations;\n }\n\n return typeof filter === \"function\"\n ? integrations.filter((integration) => filter(integration))\n : integrations.filter((integration) =>\n matchesPipesFilterCriteria(integration, filter),\n );\n}\n\ntype PipesSectionsImplProps = WidgetRootDomProps & {\n filter?: PipesConnectionFilter;\n};\n\n// The two experiences are separate components so the opt-out path mounts no\n// shared-connections hook at all, and therefore issues exactly the requests it\n// always has.\nconst PipesImpl = (props: PipesImplProps) => {\n if (props.enableSharedConnections) {\n const { enableSharedConnections, ...sectionsProps } = props;\n return <PipesSectionsImpl {...sectionsProps} />;\n }\n\n const { enableSharedConnections, ...personalProps } = props;\n return <PipesPersonalImpl {...personalProps} />;\n};\n\ntype PipesPersonalImplProps = WidgetRootDomProps & {\n filter?: PipesFilter | PipesConnectionFilter;\n};\n\nconst PipesPersonalImpl = (props: PipesPersonalImplProps) => {\n const isHydrated = useIsHydrated();\n const integrations = useMyDataIntegrations();\n\n if (!isHydrated || integrations.isLoading) {\n return <PipesLoading count={6} {...props} />;\n }\n\n if (integrations.isError) {\n return <PipesError error={integrations.error} {...props} />;\n }\n\n if (integrations.isSuccess) {\n const visible = applyPipesFilter(integrations.data.data, props.filter);\n\n return (\n <PipesPresentational\n integrations={visible}\n hasUnfilteredIntegrations={integrations.data.data.length > 0}\n {...props}\n />\n );\n }\n\n return <PipesError error={integrations.error} {...props} />;\n};\n\nconst PipesSectionsImpl = (props: PipesSectionsImplProps) => {\n const isHydrated = useIsHydrated();\n const integrations = useMyDataIntegrations();\n // Both sections have their own cache entry and resolve independently: the\n // member's own connections render as soon as they arrive, and a slow or\n // failing shared request only affects the shared section.\n const shared = useSharedDataConnections();\n const organizations = useOrganizations();\n const organizationName = organizations.data?.data.find(\n (organization) => organization.current,\n )?.name;\n\n if (!isHydrated || integrations.isLoading) {\n return <PipesLoading count={6} {...props} />;\n }\n\n if (integrations.isError || !integrations.isSuccess) {\n return <PipesError error={integrations.error} {...props} />;\n }\n\n const visible = applyPipesFilter(integrations.data.data, props.filter);\n\n return (\n <PipesSectionsPresentational\n integrations={visible}\n hasUnfilteredIntegrations={integrations.data.data.length > 0}\n sharedConnections={applySharedPipesFilter(\n shared.data?.data ?? [],\n props.filter,\n )}\n hasUnfilteredSharedConnections={(shared.data?.data.length ?? 0) > 0}\n // A failed attempt drops the section rather than leaving skeletons up\n // for the whole retry sequence.\n isSharedLoading={shared.isPending && shared.failureCount === 0}\n organizationName={organizationName}\n {...props}\n />\n );\n};\n\nconst Pipes: PipesComponent = PipesRoot;\n\nexport type {\n PipesProps,\n PipesConnection,\n PipesFilter,\n PipesFilterCriteria,\n PipesConnectionFilter,\n PipesAuthMethod,\n PipesLoadingProps,\n PipesErrorProps,\n};\nexport { Pipes, PipesLoading, PipesError };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqJqC;AApJrC,0BAAuC;AACvC,6BAAgC;AAChC,mBAKO;AAEP,sBAOO;AACP,6BAA8B;AAC9B,4BAA8B;AA6H9B,MAAM,YAAY,CAAC,EAAE,WAAW,GAAG,MAAM,MAAkB;AACzD,QAAM,cAAU,wCAAgB;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA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;AAAA,MACd,2BAA2B,aAAa,KAAK,KAAK,SAAS;AAAA,MAC3D,mBAAmB;AAAA,QACjB,OAAO,MAAM,QAAQ,CAAC;AAAA,QACtB,MAAM;AAAA,MACR;AAAA,MACA,iCAAiC,OAAO,MAAM,KAAK,UAAU,KAAK;AAAA,MAGlE,iBAAiB,OAAO,aAAa,OAAO,iBAAiB;AAAA,MAC7D;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,MAAM,QAAwB;","names":["enableSharedConnections","PipesPresentational","PipesSectionsPresentational"]}
@@ -1,6 +1,6 @@
1
1
  import { AuthToken } from './api/api-provider.cjs';
2
2
  export { PipesError, PipesErrorProps, PipesLoading, PipesLoadingProps } from './lib/pipes.cjs';
3
- import { DataIntegration } from './api/endpoint.cjs';
3
+ import { DataIntegration, DataIntegrationWithConnections, SharedDataConnection } from './api/endpoint.cjs';
4
4
  import { WidgetRootDomProps } from './lib/utils.cjs';
5
5
  import 'react';
6
6
  import '@tanstack/react-query';
@@ -33,40 +33,95 @@ interface PipesFilterCriteria {
33
33
  authMethods?: PipesAuthMethod[];
34
34
  }
35
35
  /**
36
- * Narrows which enabled integrations the widget renders. Either a predicate
37
- * (use from a Client Component host) or serializable criteria (use from a
38
- * Server Component host, where props must cross the server/client boundary).
36
+ * Narrows which enabled integrations the widget renders. The widget still
37
+ * fetches the full set of integrations the user's organization has enabled
38
+ * (plus any the user is still connected to so they can disconnect); a filter
39
+ * only controls which of those rows are shown, in either of two forms:
40
+ *
41
+ * - **Serializable criteria** (`{ slugs, integrationTypes, authMethods }`),
42
+ * ANDed together. This is the form to use when `<Pipes>` is embedded in a
43
+ * Server Component (the documented token-minting pattern), because props must
44
+ * be serializable across the server/client boundary and plain objects survive
45
+ * it. e.g. `filter={{ slugs: ["google-drive"] }}`.
46
+ *
47
+ * - **A predicate** `((integration) => boolean)` for arbitrary filtering by any
48
+ * field on the integration (`authMethods`, `integrationType`,
49
+ * `installation.state`, etc.). A function is **not serializable across the
50
+ * server/client boundary**: the predicate must be defined inside client code
51
+ * and must never be passed in from a Server Component. Concretely, a host
52
+ * using the App Router server-component pattern that needs a predicate must
53
+ * author its own `"use client"` wrapper that *owns* the predicate and
54
+ * receives only serializable props (e.g. `authToken`) from the server page.
55
+ *
56
+ * Undefined renders every enabled integration (the default).
39
57
  */
40
58
  type PipesFilter = PipesFilterCriteria | ((integration: DataIntegration) => boolean);
41
- interface PipesProps extends WidgetRootDomProps {
59
+ /** A row the widget renders when `enableSharedConnections` is on. */
60
+ type PipesConnection = DataIntegrationWithConnections | SharedDataConnection;
61
+ /**
62
+ * {@link PipesFilter} as `enableSharedConnections` widens it: the same two
63
+ * forms, except they narrow both sections. The predicate also sees the
64
+ * organization's shared rows, discriminated with `"integrationType" in
65
+ * connection` — shared rows carry none of the provider metadata the member's
66
+ * own rows do. Neither `ownership` nor `connected_accounts` discriminates
67
+ * them: the member's own connections can be `"organization"` too, and both
68
+ * payloads carry `connected_accounts` (of different element types). Criteria
69
+ * narrow shared rows by `slugs` alone, for the same want of metadata.
70
+ */
71
+ type PipesConnectionFilter = PipesFilterCriteria | ((connection: PipesConnection) => boolean);
72
+ /** The unsectioned widget, whose `filter` is what it always was. */
73
+ type PipesPersonalProps = WidgetRootDomProps & {
42
74
  authToken: AuthToken;
43
75
  /**
44
- * Optional filter that narrows which enabled integrations the widget
45
- * renders. The widget still fetches the full set of integrations the user's
46
- * organization has enabled (plus any the user is still connected to so they
47
- * can disconnect); this prop only controls which of those rows are shown.
48
- *
49
- * Accepts either form:
50
- *
51
- * - **Serializable criteria** (`{ slugs, integrationTypes, authMethods }`),
52
- * ANDed together. This is the form to use when `<Pipes>` is embedded in a
53
- * Server Component (the documented token-minting pattern), because props
54
- * must be serializable across the server/client boundary and plain objects
55
- * survive it. e.g. `filter={{ slugs: ["google-drive"] }}`.
76
+ * Defaults to `false`, which renders the single unsectioned list of the
77
+ * member's own connections and never requests shared connections.
78
+ */
79
+ enableSharedConnections?: false;
80
+ /** Narrows the member's own connections: {@link PipesFilter}. */
81
+ filter?: PipesFilter;
82
+ };
83
+ /**
84
+ * The sectioned widget, whose `filter` also narrows the shared section and so
85
+ * takes the widened predicate.
86
+ */
87
+ type PipesSectionsProps = WidgetRootDomProps & {
88
+ authToken: AuthToken;
89
+ /**
90
+ * Opt in to the sectioned member experience: the connections the organization
91
+ * owns and shares with everyone, followed by the member's own connections.
56
92
  *
57
- * - **A predicate** `((integration) => boolean)` for arbitrary filtering by any
58
- * field on the integration (`authMethods`, `integrationType`,
59
- * `installation.state`, etc.). A function is **not serializable across the
60
- * server/client boundary**: the predicate must be defined inside client
61
- * code and must never be passed in from a Server Component. Concretely, a
62
- * host using the App Router server-component pattern that needs a predicate
63
- * must author its own `"use client"` wrapper that *owns* the predicate and
64
- * receives only serializable props (e.g. `authToken`) from the server page.
93
+ * Shared connections are read-only for members — they carry no
94
+ * credential-management actions — and are fetched separately from the
95
+ * member's own connections, so the personal section renders as soon as it
96
+ * resolves regardless of the shared one.
65
97
  *
66
- * Undefined renders every enabled integration (the default).
98
+ * Typed `boolean` rather than `true` so a host can forward a runtime feature
99
+ * flag: a predicate has to cope with shared rows whenever the flag can be on.
67
100
  */
68
- filter?: PipesFilter;
101
+ enableSharedConnections: boolean;
102
+ /** Narrows both sections: {@link PipesConnectionFilter}. */
103
+ filter?: PipesConnectionFilter;
104
+ };
105
+ type PipesProps = PipesPersonalProps | PipesSectionsProps;
106
+ /**
107
+ * Overloads rather than one props union, so that opting in widens the
108
+ * predicate's parameter for that host alone while every other host's `filter`
109
+ * stays exactly as it was. A union leaves `enableSharedConnections={false}`
110
+ * satisfying both members — the opt-in one accepts every `boolean` — leaving an
111
+ * inline predicate no single contextual type to draw on (`TS7006`). Overloads
112
+ * are ordered instead: a literal `false` resolves to the personal signature,
113
+ * and anything else, a runtime flag included, to the widened one.
114
+ *
115
+ * The last signature takes the whole union, so that a wrapper forwarding
116
+ * `PipesProps` it hasn't narrowed (`<Pipes {...props} />`) still resolves, and
117
+ * so that `React.ComponentProps<typeof Pipes>` — which reads the last
118
+ * signature — describes the widget rather than only its opted-in half.
119
+ */
120
+ interface PipesComponent {
121
+ (props: PipesPersonalProps): React.ReactNode;
122
+ (props: PipesSectionsProps): React.ReactNode;
123
+ (props: PipesProps): React.ReactNode;
69
124
  }
70
- declare const Pipes: React.FC<PipesProps>;
125
+ declare const Pipes: PipesComponent;
71
126
 
72
- export { Pipes, type PipesAuthMethod, type PipesFilter, type PipesFilterCriteria, type PipesProps };
127
+ export { Pipes, type PipesAuthMethod, type PipesConnection, type PipesConnectionFilter, type PipesFilter, type PipesFilterCriteria, type PipesProps };
@@ -8,8 +8,8 @@ export { UsersManagement, UsersManagementProps } from './users-management.client
8
8
  export { AdminPortalDomainVerification, AdminPortalDomainVerificationProps } from './admin-portal-domain-verification.client.js';
9
9
  export { AdminPortalAuditLogStreaming, AdminPortalAuditLogStreamingProps } from './admin-portal-audit-log-streaming.client.js';
10
10
  export { ApiKeys, ApiKeysProps } from './api-keys.client.js';
11
- export { Pipes, PipesAuthMethod, PipesFilter, PipesFilterCriteria, PipesProps } from './pipes.client.js';
12
- export { DataIntegration } from './api/endpoint.js';
11
+ export { Pipes, PipesAuthMethod, PipesConnection, PipesConnectionFilter, PipesFilter, PipesFilterCriteria, PipesProps } from './pipes.client.js';
12
+ export { DataIntegration, SharedDataConnection } from './api/endpoint.js';
13
13
  export { PipesAdmin, PipesAdminProps } from './pipes-admin.client.js';
14
14
  export { DirectorySync, DirectorySyncProps } from './directory-sync.client.js';
15
15
  export { IntlContext as internal_IntlContext } from './lib/i18n/intl-context.js';
@@ -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,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACsC;AAAA,OAEjC;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAwB,mBAA4B;","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,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACsC;AAAA,OAEjC;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAOK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAwB,mBAA4B;","names":[]}
@@ -1,4 +1,4 @@
1
- import { DataIntegration } from '../api/endpoint.js';
1
+ import { DataIntegration, SharedDataConnection } from '../api/endpoint.js';
2
2
  import { WidgetRootDomProps } from './utils.js';
3
3
  import '@tanstack/react-query';
4
4
  import '../api/widgets-api-client.js';
@@ -17,15 +17,50 @@ import '@radix-ui/themes/components/select';
17
17
 
18
18
  interface PipesProps extends WidgetRootDomProps {
19
19
  integrations: DataIntegration[];
20
+ /**
21
+ * Whether the endpoint returned any connections before the host's `filter`
22
+ * ran, which is what tells an organization with nothing enabled yet apart
23
+ * from a filter that matched nothing. Defaults to whatever survived, the
24
+ * reading for an unfiltered list.
25
+ */
26
+ hasUnfilteredIntegrations?: boolean;
27
+ }
28
+ interface PipesSectionsProps extends PipesProps {
29
+ /**
30
+ * Organization-owned connections, as returned by the shared-connections
31
+ * endpoint. Empty both when the organization shares nothing and when the
32
+ * request failed, since neither is something a member can act on.
33
+ */
34
+ sharedConnections: SharedDataConnection[];
35
+ /**
36
+ * {@link PipesProps.hasUnfilteredIntegrations} for the shared section. The
37
+ * section is dropped entirely unless the organization shares something, so
38
+ * this only ever decides whether a filtered-out lane says so.
39
+ */
40
+ hasUnfilteredSharedConnections?: boolean;
41
+ /** Renders the shared section as skeleton rows while it resolves. */
42
+ isSharedLoading?: boolean;
43
+ /** Names the owning organization in the shared section's description. */
44
+ organizationName?: string;
20
45
  }
21
46
  interface PipesLoadingProps extends WidgetRootDomProps {
22
47
  count: number;
23
48
  }
24
49
  declare const PipesLoading: React.FC<PipesLoadingProps>;
25
50
  declare const Pipes: React.FC<PipesProps>;
51
+ /**
52
+ * The sectioned member experience: the connections the organization shares,
53
+ * then the member's own. The two lanes come from different endpoints and are
54
+ * never merged — the same provider can legitimately appear in both, once as an
55
+ * organization-owned connection and once as the member's own account.
56
+ *
57
+ * The shared section is omitted entirely when the organization shares nothing
58
+ * (or the request failed), leaving the member's own section usable on its own.
59
+ */
60
+ declare const PipesSections: React.FC<PipesSectionsProps>;
26
61
  interface PipesErrorProps extends WidgetRootDomProps {
27
62
  error: unknown;
28
63
  }
29
64
  declare const PipesError: React.FC<PipesErrorProps>;
30
65
 
31
- export { Pipes, PipesError, type PipesErrorProps, PipesLoading, type PipesLoadingProps, type PipesProps };
66
+ export { Pipes, PipesError, type PipesErrorProps, PipesLoading, type PipesLoadingProps, type PipesProps, PipesSections, type PipesSectionsProps };