@workos-inc/widgets 1.20.0-next.1790966764940 → 1.20.0-next.1791237372282

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 (45) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/cjs/api/client-graphql/client.cjs +4 -13
  3. package/dist/cjs/api/client-graphql/client.cjs.map +1 -1
  4. package/dist/cjs/api/client-graphql/generated.cjs +60 -0
  5. package/dist/cjs/api/client-graphql/generated.cjs.map +1 -1
  6. package/dist/cjs/api/client-graphql/generated.d.cts +219 -11
  7. package/dist/cjs/lib/api/pipes.cjs +46 -6
  8. package/dist/cjs/lib/api/pipes.cjs.map +1 -1
  9. package/dist/cjs/lib/api/pipes.d.cts +50 -7
  10. package/dist/cjs/lib/card-list.cjs +2 -1
  11. package/dist/cjs/lib/card-list.cjs.map +1 -1
  12. package/dist/cjs/lib/card-list.d.cts +3 -1
  13. package/dist/cjs/lib/pipes-admin.cjs +233 -75
  14. package/dist/cjs/lib/pipes-admin.cjs.map +1 -1
  15. package/dist/cjs/lib/pipes-admin.d.cts +4 -3
  16. package/dist/cjs/lib/pipes-connections.cjs +356 -0
  17. package/dist/cjs/lib/pipes-connections.cjs.map +1 -0
  18. package/dist/cjs/lib/pipes-connections.d.cts +128 -0
  19. package/dist/cjs/lib/pipes.cjs +439 -174
  20. package/dist/cjs/lib/pipes.cjs.map +1 -1
  21. package/dist/cjs/lib/pipes.d.cts +74 -8
  22. package/dist/cjs/pipes.client.cjs.map +1 -1
  23. package/dist/css/lib/card-list.css +24 -0
  24. package/dist/esm/api/client-graphql/client.js +4 -13
  25. package/dist/esm/api/client-graphql/client.js.map +1 -1
  26. package/dist/esm/api/client-graphql/generated.d.ts +219 -11
  27. package/dist/esm/api/client-graphql/generated.js +58 -1
  28. package/dist/esm/api/client-graphql/generated.js.map +1 -1
  29. package/dist/esm/lib/api/pipes.d.ts +50 -7
  30. package/dist/esm/lib/api/pipes.js +46 -7
  31. package/dist/esm/lib/api/pipes.js.map +1 -1
  32. package/dist/esm/lib/card-list.d.ts +3 -1
  33. package/dist/esm/lib/card-list.js +2 -1
  34. package/dist/esm/lib/card-list.js.map +1 -1
  35. package/dist/esm/lib/pipes-admin.d.ts +4 -3
  36. package/dist/esm/lib/pipes-admin.js +234 -76
  37. package/dist/esm/lib/pipes-admin.js.map +1 -1
  38. package/dist/esm/lib/pipes-connections.d.ts +128 -0
  39. package/dist/esm/lib/pipes-connections.js +341 -0
  40. package/dist/esm/lib/pipes-connections.js.map +1 -0
  41. package/dist/esm/lib/pipes.d.ts +74 -8
  42. package/dist/esm/lib/pipes.js +439 -175
  43. package/dist/esm/lib/pipes.js.map +1 -1
  44. package/dist/esm/pipes.client.js.map +1 -1
  45. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,9 +1,11 @@
1
1
  # Changelog
2
2
 
3
- ## 1.20.0-next.1790966764940
3
+ ## 1.20.0-next.1791237372282
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - Prepare the sectioned `<Pipes>` and `<PipesAdmin>` experiences (`enableSharedConnections`) for multiple connections per provider. Nothing changes until multiple connections are enabled for your environment; until then each provider keeps its single connection and looks as it did before. Once enabled, a provider with several connections renders as a group with one row per connection, oldest first, each with its own status and actions. "Add connection" and "Connect another account" add one (asking for an optional name) when the API reports it available, and connections can be renamed. Repairs target the exact connection, and adds are retry-safe.
8
+
7
9
  - Surface data integration connection failures in the Pipes widget
8
10
 
9
11
  When an OAuth handoff popup fails or closes without completing, the widget now
@@ -21,10 +23,14 @@
21
23
 
22
24
  - Unify relative date display logic across all Widgets.
23
25
 
26
+ - Client GraphQL requests no longer treat errors with the message "Forbidden resource" as auth failures. Only `UNAUTHENTICATED`/`FORBIDDEN` error codes and HTTP 401/403 now trigger a token refresh and retry.
27
+
24
28
  - Ensure "Unknown Location" is translated in User Sessions Widget.
25
29
 
26
30
  - Stabilize dates during render to prevent dates re-rendering arbitrarily
27
31
 
32
+ - Data provider connection input types now include an optional `idempotencyKey` field.
33
+
28
34
  - Fix CommonJS builds requiring `.js` files that don't exist in `dist/cjs`.
29
35
 
30
36
  ## 1.19.0
@@ -12,29 +12,20 @@ let _tanstack_react_query = require("@tanstack/react-query");
12
12
  let graphql_request = require("graphql-request");
13
13
  //#region src/api/client-graphql/client.ts
14
14
  /**
15
- * Message NestJS attaches to a bare `ForbiddenException`, which is what the
16
- * Client API's auth guard produces when it rejects a token (expired, revoked,
17
- * or otherwise invalid). The GraphQL layer reports it as an HTTP 200 whose
18
- * error carries `extensions.code: "INTERNAL_SERVER_ERROR"`, so the message is
19
- * the only signal that distinguishes it from a genuine server fault.
20
- */
21
- const GUARD_DENIAL_MESSAGE = "Forbidden resource";
22
- /**
23
15
  * A GraphQL request failed because the request was unauthenticated or the token
24
16
  * no longer carries the required permissions.
25
17
  *
26
- * Permission denials surface as an HTTP 200 whose `errors[].extensions.code`
27
- * is `"FORBIDDEN"`; token rejections from the auth guard surface as described
28
- * on `GUARD_DENIAL_MESSAGE`. The HTTP-status check is only a safety net for
18
+ * Both surface as an HTTP 200 whose `errors[].extensions.code` is
19
+ * `"UNAUTHENTICATED"` (token rejected by the auth guard) or `"FORBIDDEN"`
20
+ * (permission denied). The HTTP-status check is only a safety net for
29
21
  * transport-level rejections (proxies, gateways) that never reach GraphQL.
30
- * `"UNAUTHENTICATED"` is included for when the backend reports it directly.
31
22
  */
32
23
  function isAuthError(error) {
33
24
  const status = error.response.status;
34
25
  if (status === 401 || status === 403) return true;
35
26
  return (error.response.errors ?? []).some((graphQlError) => {
36
27
  const code = graphQlError.extensions?.code;
37
- return code === "UNAUTHENTICATED" || code === "FORBIDDEN" || graphQlError.message === GUARD_DENIAL_MESSAGE;
28
+ return code === "UNAUTHENTICATED" || code === "FORBIDDEN";
38
29
  });
39
30
  }
40
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.cjs","names":["ClientError","ExpiredTokenError","IncorrectPermissionsError","ApiError","FetchError","useApi","useQueryClient","React","CLIENT_API_GRAPHQL_PATH","GraphQLClient","authTokenQueryKey","getSdk"],"sources":["../../../../src/api/client-graphql/client.ts"],"sourcesContent":["import { useQueryClient } from \"@tanstack/react-query\";\nimport { ClientError, GraphQLClient } from \"graphql-request\";\nimport * as React from \"react\";\nimport {\n AuthTokenQueryData,\n authTokenQueryKey,\n useApi,\n WidgetType,\n} from \"../api-provider.js\";\nimport { WIDGETS_API_VERSION } from \"../constants.js\";\nimport { ApiError, FetchError } from \"../errors.js\";\nimport {\n ExpiredTokenError,\n IncorrectPermissionsError,\n} from \"../../lib/errors.js\";\nimport { getSdk, Sdk, SdkFunctionWrapper } from \"./generated.js\";\nimport { CLIENT_API_GRAPHQL_PATH } from \"./constants.js\";\n\ntype QueryType = \"query\" | \"mutation\";\n\n/**\n * Message NestJS attaches to a bare `ForbiddenException`, which is what the\n * Client API's auth guard produces when it rejects a token (expired, revoked,\n * or otherwise invalid). The GraphQL layer reports it as an HTTP 200 whose\n * error carries `extensions.code: \"INTERNAL_SERVER_ERROR\"`, so the message is\n * the only signal that distinguishes it from a genuine server fault.\n */\nconst GUARD_DENIAL_MESSAGE = \"Forbidden resource\";\n\n/**\n * A GraphQL request failed because the request was unauthenticated or the token\n * no longer carries the required permissions.\n *\n * Permission denials surface as an HTTP 200 whose `errors[].extensions.code`\n * is `\"FORBIDDEN\"`; token rejections from the auth guard surface as described\n * on `GUARD_DENIAL_MESSAGE`. The HTTP-status check is only a safety net for\n * transport-level rejections (proxies, gateways) that never reach GraphQL.\n * `\"UNAUTHENTICATED\"` is included for when the backend reports it directly.\n */\nfunction isAuthError(error: ClientError): boolean {\n const status = error.response.status;\n if (status === 401 || status === 403) {\n return true;\n }\n\n return (error.response.errors ?? []).some((graphQlError) => {\n const code = graphQlError.extensions?.code;\n return (\n code === \"UNAUTHENTICATED\" ||\n code === \"FORBIDDEN\" ||\n graphQlError.message === GUARD_DENIAL_MESSAGE\n );\n });\n}\n\n/**\n * The Client API returns GraphQL-level errors (validation, not-found, etc.) as\n * an HTTP 200 with an `errors` array. Surfacing that raw `200` on an `ApiError`\n * is misleading for downstream consumers and telemetry, so normalize any\n * non-error HTTP status to a 500.\n */\nfunction normalizeErrorStatus(status: number): number {\n return status >= 400 ? status : 500;\n}\n\n/**\n * Translate a graphql-request failure into the same error classes the REST\n * Widgets client throws, so presentational components and error boundaries can\n * handle both transports uniformly.\n */\nfunction toWidgetError(\n error: unknown,\n queryType: QueryType,\n isExpiredToken: boolean,\n): Error {\n if (error instanceof ClientError) {\n if (isAuthError(error)) {\n const context = { status: error.response.status, queryType } as const;\n return isExpiredToken\n ? new ExpiredTokenError({ context })\n : new IncorrectPermissionsError({ context });\n }\n\n const firstError = error.response.errors?.[0];\n return new ApiError({\n message: firstError?.message ?? error.message,\n status: normalizeErrorStatus(error.response.status),\n queryType,\n context: { errors: error.response.errors },\n });\n }\n\n return new FetchError({\n message: error instanceof Error ? error.message : \"GraphQL request failed\",\n queryType,\n context: { error },\n });\n}\n\n/**\n * Returns a typed SDK for the WorkOS Client GraphQL API, wired up to the same\n * `ApiProvider` auth plumbing the REST Widgets client uses:\n *\n * - Sends the current bearer token plus the widget-type / version headers.\n * - On an auth failure, re-mints the token via the shared `authToken` query and\n * retries the operation once (mirrors the REST client's 403 retry).\n * - Maps GraphQL/network failures onto the widget error classes.\n *\n * Elevated-access tokens are intentionally not attached here; the Client API\n * takes them as mutation input fields, so call sites read them from\n * `useElevatedAccessToken` and pass them through the relevant inputs.\n */\nexport function useClientGraphql(): Sdk {\n const { authToken, baseUrl, widgetType } = useApi();\n const queryClient = useQueryClient();\n\n return React.useMemo(() => {\n const endpoint = new URL(baseUrl);\n endpoint.pathname = CLIENT_API_GRAPHQL_PATH;\n const client = new GraphQLClient(endpoint.toString());\n\n const buildHeaders = (\n token: string | undefined,\n ): Record<string, string> => {\n const headers: Record<string, string> = {\n \"WorkOS-Widgets-Version\": WIDGETS_API_VERSION,\n \"WorkOS-Widgets-Type\": widgetType,\n };\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n return headers;\n };\n\n const refetchToken = async (\n currentWidgetType: WidgetType,\n ): Promise<string | undefined> => {\n const tokenQueryKey = authTokenQueryKey(currentWidgetType);\n await queryClient.refetchQueries({ queryKey: tokenQueryKey });\n const refreshed =\n queryClient.getQueryData<AuthTokenQueryData>(tokenQueryKey);\n return refreshed?.authToken;\n };\n\n const isTokenExpired = (): boolean => {\n const refreshed = queryClient.getQueryData<AuthTokenQueryData>(\n authTokenQueryKey(widgetType),\n );\n const exp = refreshed?.exp;\n // TODO: Fix this!\n // oxlint-disable-next-line react/purity\n return exp !== undefined && exp * 1000 <= Date.now();\n };\n\n const wrapper: SdkFunctionWrapper = async (\n action,\n _operationName,\n operationType,\n ) => {\n const queryType: QueryType =\n operationType === \"mutation\" ? \"mutation\" : \"query\";\n\n try {\n return await action(buildHeaders(authToken));\n } catch (error) {\n if (error instanceof ClientError && isAuthError(error)) {\n let freshToken: string | undefined;\n try {\n freshToken = await refetchToken(widgetType);\n } catch (refetchError) {\n throw new ExpiredTokenError({\n context: { queryType, refetchError },\n });\n }\n\n if (freshToken && freshToken !== authToken) {\n try {\n return await action(buildHeaders(freshToken));\n } catch (retryError) {\n throw toWidgetError(retryError, queryType, isTokenExpired());\n }\n }\n }\n\n throw toWidgetError(error, queryType, isTokenExpired());\n }\n };\n\n return getSdk(client, wrapper);\n }, [authToken, baseUrl, widgetType, queryClient]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,uBAAuB;;;;;;;;;;;AAY7B,SAAS,YAAY,OAA6B;CAChD,MAAM,SAAS,MAAM,SAAS;CAC9B,IAAI,WAAW,OAAO,WAAW,KAC/B,OAAO;CAGT,QAAQ,MAAM,SAAS,UAAU,CAAC,EAAA,CAAG,MAAM,iBAAiB;EAC1D,MAAM,OAAO,aAAa,YAAY;EACtC,OACE,SAAS,qBACT,SAAS,eACT,aAAa,YAAY;CAE7B,CAAC;AACH;;;;;;;AAQA,SAAS,q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,CAAA,EAAW;EACpB;EAEA,MAAM,uBAAgC;GAIpC,MAAM,MAHY,YAAY,aAC5BA,yBAAAA,kBAAkB,UAAU,CAElB,CAAA,EAAW;GAGvB,OAAO,QAAQ,UAAa,MAAM,OAAQ,KAAK,IAAI;EACrD;EAEA,MAAM,UAA8B,OAClC,QACA,gBACA,kBACG;GACH,MAAM,YACJ,kBAAkB,aAAa,aAAa;GAE9C,IAAI;IACF,OAAO,MAAM,OAAO,aAAa,SAAS,CAAC;GAC7C,SAAS,OAAO;IACd,IAAI,iBAAiBV,gBAAAA,eAAe,YAAY,KAAK,GAAG;KACtD,IAAI;KACJ,IAAI;MACF,aAAa,MAAM,aAAa,UAAU;KAC5C,SAAS,cAAc;MACrB,MAAM,IAAIC,mBAAAA,kBAAkB,EAC1B,SAAS;OAAE;OAAW;MAAa,EACrC,CAAC;KACH;KAEA,IAAI,cAAc,eAAe,WAC/B,IAAI;MACF,OAAO,MAAM,OAAO,aAAa,UAAU,CAAC;KAC9C,SAAS,YAAY;MACnB,MAAM,cAAc,YAAY,WAAW,eAAe,CAAC;KAC7D;IAEJ;IAEA,MAAM,cAAc,OAAO,WAAW,eAAe,CAAC;GACxD;EACF;EAEA,OAAOU,qCAAAA,OAAO,QAAQ,OAAO;CAC/B,GAAG;EAAC;EAAW;EAAS;EAAY;CAAW,CAAC;AAClD"}
1
+ {"version":3,"file":"client.cjs","names":["ClientError","ExpiredTokenError","IncorrectPermissionsError","ApiError","FetchError","useApi","useQueryClient","React","CLIENT_API_GRAPHQL_PATH","GraphQLClient","authTokenQueryKey","getSdk"],"sources":["../../../../src/api/client-graphql/client.ts"],"sourcesContent":["import { useQueryClient } from \"@tanstack/react-query\";\nimport { ClientError, GraphQLClient } from \"graphql-request\";\nimport * as React from \"react\";\nimport {\n AuthTokenQueryData,\n authTokenQueryKey,\n useApi,\n WidgetType,\n} from \"../api-provider.js\";\nimport { WIDGETS_API_VERSION } from \"../constants.js\";\nimport { ApiError, FetchError } from \"../errors.js\";\nimport {\n ExpiredTokenError,\n IncorrectPermissionsError,\n} from \"../../lib/errors.js\";\nimport { getSdk, Sdk, SdkFunctionWrapper } from \"./generated.js\";\nimport { CLIENT_API_GRAPHQL_PATH } from \"./constants.js\";\n\ntype QueryType = \"query\" | \"mutation\";\n\n/**\n * A GraphQL request failed because the request was unauthenticated or the token\n * no longer carries the required permissions.\n *\n * Both surface as an HTTP 200 whose `errors[].extensions.code` is\n * `\"UNAUTHENTICATED\"` (token rejected by the auth guard) or `\"FORBIDDEN\"`\n * (permission denied). The HTTP-status check is only a safety net for\n * transport-level rejections (proxies, gateways) that never reach GraphQL.\n */\nfunction isAuthError(error: ClientError): boolean {\n const status = error.response.status;\n if (status === 401 || status === 403) {\n return true;\n }\n\n return (error.response.errors ?? []).some((graphQlError) => {\n const code = graphQlError.extensions?.code;\n return code === \"UNAUTHENTICATED\" || code === \"FORBIDDEN\";\n });\n}\n\n/**\n * The Client API returns GraphQL-level errors (validation, not-found, etc.) as\n * an HTTP 200 with an `errors` array. Surfacing that raw `200` on an `ApiError`\n * is misleading for downstream consumers and telemetry, so normalize any\n * non-error HTTP status to a 500.\n */\nfunction normalizeErrorStatus(status: number): number {\n return status >= 400 ? status : 500;\n}\n\n/**\n * Translate a graphql-request failure into the same error classes the REST\n * Widgets client throws, so presentational components and error boundaries can\n * handle both transports uniformly.\n */\nfunction toWidgetError(\n error: unknown,\n queryType: QueryType,\n isExpiredToken: boolean,\n): Error {\n if (error instanceof ClientError) {\n if (isAuthError(error)) {\n const context = { status: error.response.status, queryType } as const;\n return isExpiredToken\n ? new ExpiredTokenError({ context })\n : new IncorrectPermissionsError({ context });\n }\n\n const firstError = error.response.errors?.[0];\n return new ApiError({\n message: firstError?.message ?? error.message,\n status: normalizeErrorStatus(error.response.status),\n queryType,\n context: { errors: error.response.errors },\n });\n }\n\n return new FetchError({\n message: error instanceof Error ? error.message : \"GraphQL request failed\",\n queryType,\n context: { error },\n });\n}\n\n/**\n * Returns a typed SDK for the WorkOS Client GraphQL API, wired up to the same\n * `ApiProvider` auth plumbing the REST Widgets client uses:\n *\n * - Sends the current bearer token plus the widget-type / version headers.\n * - On an auth failure, re-mints the token via the shared `authToken` query and\n * retries the operation once (mirrors the REST client's 403 retry).\n * - Maps GraphQL/network failures onto the widget error classes.\n *\n * Elevated-access tokens are intentionally not attached here; the Client API\n * takes them as mutation input fields, so call sites read them from\n * `useElevatedAccessToken` and pass them through the relevant inputs.\n */\nexport function useClientGraphql(): Sdk {\n const { authToken, baseUrl, widgetType } = useApi();\n const queryClient = useQueryClient();\n\n return React.useMemo(() => {\n const endpoint = new URL(baseUrl);\n endpoint.pathname = CLIENT_API_GRAPHQL_PATH;\n const client = new GraphQLClient(endpoint.toString());\n\n const buildHeaders = (\n token: string | undefined,\n ): Record<string, string> => {\n const headers: Record<string, string> = {\n \"WorkOS-Widgets-Version\": WIDGETS_API_VERSION,\n \"WorkOS-Widgets-Type\": widgetType,\n };\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n return headers;\n };\n\n const refetchToken = async (\n currentWidgetType: WidgetType,\n ): Promise<string | undefined> => {\n const tokenQueryKey = authTokenQueryKey(currentWidgetType);\n await queryClient.refetchQueries({ queryKey: tokenQueryKey });\n const refreshed =\n queryClient.getQueryData<AuthTokenQueryData>(tokenQueryKey);\n return refreshed?.authToken;\n };\n\n const isTokenExpired = (): boolean => {\n const refreshed = queryClient.getQueryData<AuthTokenQueryData>(\n authTokenQueryKey(widgetType),\n );\n const exp = refreshed?.exp;\n // TODO: Fix this!\n // oxlint-disable-next-line react/purity\n return exp !== undefined && exp * 1000 <= Date.now();\n };\n\n const wrapper: SdkFunctionWrapper = async (\n action,\n _operationName,\n operationType,\n ) => {\n const queryType: QueryType =\n operationType === \"mutation\" ? \"mutation\" : \"query\";\n\n try {\n return await action(buildHeaders(authToken));\n } catch (error) {\n if (error instanceof ClientError && isAuthError(error)) {\n let freshToken: string | undefined;\n try {\n freshToken = await refetchToken(widgetType);\n } catch (refetchError) {\n throw new ExpiredTokenError({\n context: { queryType, refetchError },\n });\n }\n\n if (freshToken && freshToken !== authToken) {\n try {\n return await action(buildHeaders(freshToken));\n } catch (retryError) {\n throw toWidgetError(retryError, queryType, isTokenExpired());\n }\n }\n }\n\n throw toWidgetError(error, queryType, isTokenExpired());\n }\n };\n\n return getSdk(client, wrapper);\n }, [authToken, baseUrl, widgetType, queryClient]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,YAAY,OAA6B;CAChD,MAAM,SAAS,MAAM,SAAS;CAC9B,IAAI,WAAW,OAAO,WAAW,KAC/B,OAAO;CAGT,QAAQ,MAAM,SAAS,UAAU,CAAC,EAAA,CAAG,MAAM,iBAAiB;EAC1D,MAAM,OAAO,aAAa,YAAY;EACtC,OAAO,SAAS,qBAAqB,SAAS;CAChD,CAAC;AACH;;;;;;;AAQA,SAAS,qBAAqB,QAAwB;CACpD,OAAO,UAAU,MAAM,SAAS;AAClC;;;;;;AAOA,SAAS,cACP,OACA,WACA,gBACO;CACP,IAAI,iBAAiBA,gBAAAA,aAAa;EAChC,IAAI,YAAY,KAAK,GAAG;GACtB,MAAM,UAAU;IAAE,QAAQ,MAAM,SAAS;IAAQ;GAAU;GAC3D,OAAO,iBACH,IAAIC,mBAAAA,kBAAkB,EAAE,QAAQ,CAAC,IACjC,IAAIC,mBAAAA,0BAA0B,EAAE,QAAQ,CAAC;EAC/C;EAEA,MAAM,aAAa,MAAM,SAAS,SAAS;EAC3C,OAAO,IAAIC,mBAAAA,SAAS;GAClB,SAAS,YAAY,WAAW,MAAM;GACtC,QAAQ,qBAAqB,MAAM,SAAS,MAAM;GAClD;GACA,SAAS,EAAE,QAAQ,MAAM,SAAS,OAAO;EAC3C,CAAC;CACH;CAEA,OAAO,IAAIC,mBAAAA,WAAW;EACpB,SAAS,iBAAiB,QAAQ,MAAM,UAAU;EAClD;EACA,SAAS,EAAE,MAAM;CACnB,CAAC;AACH;;;;;;;;;;;;;;AAeA,S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D;IAEJ;IAEA,MAAM,cAAc,OAAO,WAAW,eAAe,CAAC;GACxD;EACF;EAEA,OAAOU,qCAAAA,OAAO,QAAQ,OAAO;CAC/B,GAAG;EAAC;EAAW;EAAS;EAAY;CAAW,CAAC;AAClD"}
@@ -189,6 +189,10 @@ const DataProviderFieldsFragmentDoc = `
189
189
  iconSlug
190
190
  iconUrl
191
191
  iconDarkUrl
192
+ capabilities {
193
+ canAddConnection
194
+ addConnectionMethods
195
+ }
192
196
  configFields {
193
197
  ...DataProviderConfigFieldFields
194
198
  }
@@ -245,6 +249,10 @@ const DataProviderConnectionFieldsFragmentDoc = `
245
249
  scopes
246
250
  state
247
251
  availability
252
+ capabilities {
253
+ canReauthorize
254
+ canUpdateCredentials
255
+ }
248
256
  apiKeyLast4
249
257
  clientId
250
258
  clientSecretLast4
@@ -291,6 +299,8 @@ const OrganizationDataProviderFieldsFragmentDoc = `
291
299
  canDisconnect
292
300
  canReauthorize
293
301
  canUpdateCredentials
302
+ canAddConnection
303
+ addConnectionMethods
294
304
  }
295
305
  configFields {
296
306
  ...DataProviderConfigFieldFields
@@ -310,6 +320,17 @@ const OrganizationDataProviderFieldsFragmentDoc = `
310
320
  }
311
321
  ${DataProviderConfigFieldFieldsFragmentDoc}
312
322
  ${DataProviderConnectionFieldsFragmentDoc}`;
323
+ const DataProviderConnectionLabelResultFieldsFragmentDoc = `
324
+ fragment DataProviderConnectionLabelResultFields on UpdateDataProviderConnectionLabelResult {
325
+ connection {
326
+ ...DataProviderConnectionFields
327
+ }
328
+ warnings {
329
+ code
330
+ message
331
+ }
332
+ }
333
+ ${DataProviderConnectionFieldsFragmentDoc}`;
313
334
  const SharedDataProviderFieldsFragmentDoc = `
314
335
  fragment SharedDataProviderFields on SharedDataProvider {
315
336
  id
@@ -952,6 +973,20 @@ const DeleteOrganizationDataProviderConnectionDocument = `
952
973
  deleteOrganizationDataProviderConnection(id: $id)
953
974
  }
954
975
  `;
976
+ const UpdateDataProviderConnectionLabelDocument = `
977
+ mutation UpdateDataProviderConnectionLabel($input: UpdateDataProviderConnectionLabelInput!) {
978
+ updateDataProviderConnectionLabel(input: $input) {
979
+ ...DataProviderConnectionLabelResultFields
980
+ }
981
+ }
982
+ ${DataProviderConnectionLabelResultFieldsFragmentDoc}`;
983
+ const UpdateOrganizationDataProviderConnectionLabelDocument = `
984
+ mutation UpdateOrganizationDataProviderConnectionLabel($input: UpdateDataProviderConnectionLabelInput!) {
985
+ updateOrganizationDataProviderConnectionLabel(input: $input) {
986
+ ...DataProviderConnectionLabelResultFields
987
+ }
988
+ }
989
+ ${DataProviderConnectionLabelResultFieldsFragmentDoc}`;
955
990
  const RegisterPasskeyDocument = `
956
991
  mutation RegisterPasskey($input: RegisterPasskeyInput!) {
957
992
  registerPasskey(input: $input) {
@@ -1815,6 +1850,28 @@ function getSdk(client, withWrapper = defaultWrapper) {
1815
1850
  signal
1816
1851
  }), "DeleteOrganizationDataProviderConnection", "mutation", variables);
1817
1852
  },
1853
+ UpdateDataProviderConnectionLabel(variables, requestHeaders, signal) {
1854
+ return withWrapper((wrappedRequestHeaders) => client.request({
1855
+ document: UpdateDataProviderConnectionLabelDocument,
1856
+ variables,
1857
+ requestHeaders: {
1858
+ ...requestHeaders,
1859
+ ...wrappedRequestHeaders
1860
+ },
1861
+ signal
1862
+ }), "UpdateDataProviderConnectionLabel", "mutation", variables);
1863
+ },
1864
+ UpdateOrganizationDataProviderConnectionLabel(variables, requestHeaders, signal) {
1865
+ return withWrapper((wrappedRequestHeaders) => client.request({
1866
+ document: UpdateOrganizationDataProviderConnectionLabelDocument,
1867
+ variables,
1868
+ requestHeaders: {
1869
+ ...requestHeaders,
1870
+ ...wrappedRequestHeaders
1871
+ },
1872
+ signal
1873
+ }), "UpdateOrganizationDataProviderConnectionLabel", "mutation", variables);
1874
+ },
1818
1875
  RegisterPasskey(variables, requestHeaders, signal) {
1819
1876
  return withWrapper((wrappedRequestHeaders) => client.request({
1820
1877
  document: RegisterPasskeyDocument,
@@ -2063,6 +2120,7 @@ exports.DataProviderAuthorizationStatusDocument = DataProviderAuthorizationStatu
2063
2120
  exports.DataProviderConfigFieldFieldsFragmentDoc = DataProviderConfigFieldFieldsFragmentDoc;
2064
2121
  exports.DataProviderConfigurationFieldsFragmentDoc = DataProviderConfigurationFieldsFragmentDoc;
2065
2122
  exports.DataProviderConnectionFieldsFragmentDoc = DataProviderConnectionFieldsFragmentDoc;
2123
+ exports.DataProviderConnectionLabelResultFieldsFragmentDoc = DataProviderConnectionLabelResultFieldsFragmentDoc;
2066
2124
  exports.DataProviderFieldsFragmentDoc = DataProviderFieldsFragmentDoc;
2067
2125
  exports.DeleteDataProviderConnectionDocument = DeleteDataProviderConnectionDocument;
2068
2126
  exports.DeleteOrganizationApiKeyDocument = DeleteOrganizationApiKeyDocument;
@@ -2118,7 +2176,9 @@ exports.SetDataProviderConfigurationDocument = SetDataProviderConfigurationDocum
2118
2176
  exports.SetDataProviderEnabledDocument = SetDataProviderEnabledDocument;
2119
2177
  exports.SetOrganizationDataProviderConfigurationDocument = SetOrganizationDataProviderConfigurationDocument;
2120
2178
  exports.SharedDataProviderFieldsFragmentDoc = SharedDataProviderFieldsFragmentDoc;
2179
+ exports.UpdateDataProviderConnectionLabelDocument = UpdateDataProviderConnectionLabelDocument;
2121
2180
  exports.UpdateMemberRoleDocument = UpdateMemberRoleDocument;
2181
+ exports.UpdateOrganizationDataProviderConnectionLabelDocument = UpdateOrganizationDataProviderConnectionLabelDocument;
2122
2182
  exports.UpdatePasswordDocument = UpdatePasswordDocument;
2123
2183
  exports.UpdateProfileDocument = UpdateProfileDocument;
2124
2184
  exports.UserApiKeyFieldsFragmentDoc = UserApiKeyFieldsFragmentDoc;