@burdenoff/fluidgrids-fe-sdk 2026.915.1 → 2026.915.3

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.
@@ -1,5 +1,5 @@
1
1
  import { throwIfResultError } from './chunk-LMO5ASOE.js';
2
- import { ExecutionDetailDocument, ExecutionStatsDocument, PauseExecutionDocument, ResumeExecutionDocument, CancelExecutionDocument, RetryNodeDocument, TerminateExecutionDocument, ExecutionsListDocument } from './chunk-WO3AHQVD.js';
2
+ import { ExecutionDetailDocument, ExecutionStatsDocument, PauseExecutionDocument, ResumeExecutionDocument, CancelExecutionDocument, RetryNodeDocument, TriggerWorkflowDocument, TerminateExecutionDocument, ExecutionsListDocument } from './chunk-WO3AHQVD.js';
3
3
  import { getFluidGridsClient } from './chunk-5BDQNSP3.js';
4
4
  import { useTr } from './chunk-7YWBH2A5.js';
5
5
  import { Icon } from '@iconify/react';
@@ -2554,6 +2554,32 @@ gql`
2554
2554
  }
2555
2555
  `;
2556
2556
 
2557
+ // src/modules/executions/utils/retry.ts
2558
+ var NON_REPLAYABLE_CONTEXT_KEYS = ["isScheduled", "workspaceId"];
2559
+ function buildRetryTriggerInput(run) {
2560
+ if (!run.workflowKey || !run.version || !run.triggerNodeId) return null;
2561
+ const context = {};
2562
+ const original = run.context;
2563
+ if (original && typeof original === "object" && !Array.isArray(original)) {
2564
+ for (const [key, value] of Object.entries(
2565
+ original
2566
+ )) {
2567
+ if (NON_REPLAYABLE_CONTEXT_KEYS.includes(key)) {
2568
+ continue;
2569
+ }
2570
+ context[key] = value;
2571
+ }
2572
+ }
2573
+ context.retryOfRunId = run.id;
2574
+ return {
2575
+ workflowKey: run.workflowKey,
2576
+ version: run.version,
2577
+ triggerNodeId: run.triggerNodeId,
2578
+ triggerData: run.triggerData ?? void 0,
2579
+ context
2580
+ };
2581
+ }
2582
+
2557
2583
  // src/modules/executions/hooks/useExecutions.ts
2558
2584
  function useExecutions(input = {}) {
2559
2585
  const [executions, setExecutions] = useState([]);
@@ -2743,6 +2769,41 @@ function useExecutionActions() {
2743
2769
  setLoading(false);
2744
2770
  }
2745
2771
  }, []);
2772
+ const retryExecution = useCallback(
2773
+ async (execution) => {
2774
+ const input = buildRetryTriggerInput(execution);
2775
+ if (!input) {
2776
+ const message = "This run has no trigger node, so it cannot be re-run.";
2777
+ setError(new Error(message));
2778
+ return { ok: false, message };
2779
+ }
2780
+ setLoading(true);
2781
+ setError(null);
2782
+ try {
2783
+ const client = getFluidGridsClient();
2784
+ const result = throwIfResultError(
2785
+ await client.mutate({
2786
+ mutation: TriggerWorkflowDocument,
2787
+ variables: { input }
2788
+ })
2789
+ );
2790
+ const run = result.data?.triggerWorkflow;
2791
+ if (!run) {
2792
+ const message = "The workflow did not start.";
2793
+ setError(new Error(message));
2794
+ return { ok: false, message };
2795
+ }
2796
+ return { ok: true, run };
2797
+ } catch (err) {
2798
+ const error2 = err;
2799
+ setError(error2);
2800
+ return { ok: false, message: error2.message };
2801
+ } finally {
2802
+ setLoading(false);
2803
+ }
2804
+ },
2805
+ []
2806
+ );
2746
2807
  const terminateExecution = useCallback(
2747
2808
  async (runId, reason) => {
2748
2809
  setLoading(true);
@@ -2770,13 +2831,23 @@ function useExecutionActions() {
2770
2831
  resumeExecution,
2771
2832
  cancelExecution,
2772
2833
  retryNode,
2834
+ retryExecution,
2773
2835
  terminateExecution,
2774
2836
  loading,
2775
2837
  error
2776
2838
  };
2777
2839
  }
2840
+ var EXECUTIONS_SEARCH_DEBOUNCE_MS = 350;
2778
2841
  function useExecutionsWithStore() {
2779
2842
  const { filter, pagination, setTotal } = useExecutionsStore();
2843
+ const [debouncedSearch, setDebouncedSearch] = useState(filter.search);
2844
+ useEffect(() => {
2845
+ const timer = setTimeout(
2846
+ () => setDebouncedSearch(filter.search),
2847
+ EXECUTIONS_SEARCH_DEBOUNCE_MS
2848
+ );
2849
+ return () => clearTimeout(timer);
2850
+ }, [filter.search]);
2780
2851
  const input = useMemo(() => {
2781
2852
  const baseInput = {
2782
2853
  limit: pagination.pageSize,
@@ -2794,8 +2865,12 @@ function useExecutionsWithStore() {
2794
2865
  if (filter.dateRange.end) {
2795
2866
  baseInput.endDate = filter.dateRange.end.toISOString();
2796
2867
  }
2868
+ const term = debouncedSearch.trim();
2869
+ if (term) {
2870
+ baseInput.search = term;
2871
+ }
2797
2872
  return baseInput;
2798
- }, [filter, pagination.page, pagination.pageSize]);
2873
+ }, [filter, debouncedSearch, pagination.page, pagination.pageSize]);
2799
2874
  const result = useExecutions(input);
2800
2875
  useEffect(() => {
2801
2876
  if (result.total !== pagination.total) {
@@ -2815,5 +2890,5 @@ function useAutoRefresh(refetchFn, enabled = true, interval = 5e3) {
2815
2890
  }
2816
2891
 
2817
2892
  export { ExecutionCards, ExecutionFilters, ExecutionStats, ExecutionStatusBadge, ExecutionTable, ExecutionTimeline, NodeTimeline, Pagination, RunLogViewer, buildNodeDisplayMap, formatRunVersion, useAutoRefresh, useExecution, useExecutionActions, useExecutionStats, useExecutionsStore, useExecutionsWithStore };
2818
- //# sourceMappingURL=chunk-AE7FZRTH.js.map
2819
- //# sourceMappingURL=chunk-AE7FZRTH.js.map
2893
+ //# sourceMappingURL=chunk-LMLFKX3B.js.map
2894
+ //# sourceMappingURL=chunk-LMLFKX3B.js.map