@burdenoff/fluidgrids-fe-sdk 2026.930.3 → 2026.930.4

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.
@@ -2507,6 +2507,24 @@ function SchemaConnectionForm({
2507
2507
  )
2508
2508
  ] });
2509
2509
  }
2510
+
2511
+ // src/modules/connections/utils/connection-submit.ts
2512
+ function resolveConnectionSubmitFlow(provider, authMethodKey) {
2513
+ const methods = provider.authMethods ?? [];
2514
+ const method = methods.find((candidate) => candidate.key === authMethodKey) ?? methods.find((candidate) => candidate.isEnabled) ?? null;
2515
+ if (method) {
2516
+ const flow = method.flow.toUpperCase();
2517
+ if (flow === "OAUTH2" || flow === "MINTED") return flow;
2518
+ return "FIELDS";
2519
+ }
2520
+ return provider.authType === "OAUTH2" ? "OAUTH2" : "FIELDS";
2521
+ }
2522
+ function buildCreateConnectionConfig(flow, values) {
2523
+ if (flow !== "OAUTH2" || !values) return void 0;
2524
+ return Object.keys(values).length > 0 ? values : void 0;
2525
+ }
2526
+
2527
+ // src/modules/connections/hooks/useConnectionDialog.ts
2510
2528
  var GET_PROVIDER_BY_KEY = gql`
2511
2529
  query GetProviderByKey($key: String!) {
2512
2530
  getProviderByKey(key: $key) {
@@ -2733,6 +2751,11 @@ function useConnectionDialog(options) {
2733
2751
  setError(void 0);
2734
2752
  try {
2735
2753
  const client = getFluidGridsClient();
2754
+ const flow = resolveConnectionSubmitFlow(
2755
+ data.provider,
2756
+ data.authMethodKey
2757
+ );
2758
+ const config2 = buildCreateConnectionConfig(flow, data.values);
2736
2759
  const createResult = throwIfResultError(
2737
2760
  await client.mutate({
2738
2761
  mutation: CREATE_CONNECTION_FOR_DIALOG,
@@ -2741,11 +2764,13 @@ function useConnectionDialog(options) {
2741
2764
  name: data.name.trim(),
2742
2765
  description: data.description?.trim(),
2743
2766
  providerId: data.provider.id,
2744
- authMethodKey: data.authMethodKey ?? void 0
2745
- // Field values are NOT written to the plain connection.config
2746
- // column: a method's schema may collect secrets (a
2747
- // service-account key, an API token). They go only to
2748
- // authenticateConnection, which stores them encrypted.
2767
+ authMethodKey: data.authMethodKey ?? void 0,
2768
+ // Only an OAuth method's fields travel with the create: the
2769
+ // handshake reads a Custom OAuth 2.0 client ID from the
2770
+ // connection, and the backend moves the client secret into
2771
+ // its encrypted column. Every other method's values are
2772
+ // credentials and go only to authenticateConnection.
2773
+ ...config2 ? { config: config2 } : {}
2749
2774
  }
2750
2775
  }
2751
2776
  })
@@ -2754,12 +2779,6 @@ function useConnectionDialog(options) {
2754
2779
  if (!connection) {
2755
2780
  throw new Error("Failed to create connection");
2756
2781
  }
2757
- const method = (data.provider.authMethods ?? []).find(
2758
- (candidate) => candidate.key === data.authMethodKey
2759
- ) ?? (data.provider.authMethods ?? []).find(
2760
- (candidate) => candidate.isEnabled
2761
- ) ?? null;
2762
- const flow = method ? method.flow.toUpperCase() : data.provider.authType === "OAUTH2" ? "OAUTH2" : "FIELDS";
2763
2782
  switch (flow) {
2764
2783
  case "OAUTH2": {
2765
2784
  const oauthResult = throwIfResultError(
@@ -26692,5 +26711,5 @@ var FlowBuilderPage = ({
26692
26711
  };
26693
26712
 
26694
26713
  export { Card2 as Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ConnectionFormDialog, ConnectionSelector, EntityTagPicker, FLUIDGRIDS_ENTITY_TYPES, FlowBuilderPage, FluidGridsMark, FluidGridsProvider, ProviderPicker, SchemaConnectionForm, ScopePicker, TemplateCard, buildNodeCheck, buildRequiredNodeTypes, listCustomBlocks, mergeStickyNotes, refetchStoreNodes, registerCustomBlock, resolveUiSpec, stripSubmitActions, tagLabel, useAvailableTags, useConnection, useConnectionDialog, useConnections, useConnectionsByProvider, useCreateConnection, useCreateTag, useDraftEntityTags, useEntityTags, useFluidGridsContext, useImportWorkflowTemplate, useInitiateOAuth, useInstalledNodes, useNodeExecution, useProviderByKey, useProviderCatalog, useProviders, useReplaceEntityTags, useSearchTags, useTagEntity, useUntagEntity, useWorkflowTemplates };
26695
- //# sourceMappingURL=chunk-PVK74X2D.js.map
26696
- //# sourceMappingURL=chunk-PVK74X2D.js.map
26714
+ //# sourceMappingURL=chunk-QM4C7YDK.js.map
26715
+ //# sourceMappingURL=chunk-QM4C7YDK.js.map