nvent 0.4.2 → 0.4.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,4 +1,5 @@
1
1
  import { analyzedFlows } from "#build/analyzed-flows";
2
+ import { readonly, ref } from "#imports";
2
3
  export function useAnalyzedFlows() {
3
4
  return readonly(ref(analyzedFlows));
4
5
  }
@@ -5,9 +5,9 @@ import {
5
5
  shallowRef,
6
6
  useRoute,
7
7
  useRouter,
8
- watch
8
+ watch,
9
+ defineAsyncComponent
9
10
  } from "#imports";
10
- import { defineAsyncComponent } from "vue";
11
11
  export function useComponentRouter(opts) {
12
12
  const CTX_KEY = "component-router";
13
13
  if (!opts || !("routes" in opts) || !opts.routes) {
@@ -1,11 +1,18 @@
1
+ import { type Ref } from '#imports';
2
+ import type { FetchError } from 'ofetch';
3
+ interface FlowRun {
4
+ id: string;
5
+ [key: string]: any;
6
+ }
1
7
  /**
2
8
  * Composable for fetching and managing flow runs
3
9
  * Simple approach: Fresh fetch on every refresh, no stale cache
4
10
  * Client-only to avoid hydration mismatches
5
11
  */
6
12
  export declare function useFlowRuns(flowId: Ref<string>): {
7
- runs: any;
13
+ runs: globalThis.Ref<FlowRun[] | null | undefined>;
8
14
  refresh: () => Promise<void>;
9
- status: any;
10
- error: any;
15
+ status: globalThis.Ref<'idle' | 'pending' | 'success' | 'error'>;
16
+ error: globalThis.Ref<FetchError | null | undefined>;
11
17
  };
18
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ref, watch, useFetch } from "#imports";
1
2
  export function useFlowRuns(flowId) {
2
3
  const refreshCounter = ref(0);
3
4
  const { data: runs, refresh: _refresh, status, error } = useFetch(
@@ -1,4 +1,4 @@
1
- import type { Ref } from 'vue';
1
+ import { type Ref } from '#imports';
2
2
  /**
3
3
  * Composable for infinite scroll flow runs with pagination
4
4
  */
@@ -1,8 +1,9 @@
1
+ import { type Ref } from '#imports';
1
2
  /**
2
3
  * Composable for auto-polling flow runs list
3
4
  * Polls continuously to keep the list fresh
4
5
  */
5
6
  export declare function useFlowRunsPolling(refresh: () => Promise<void>, shouldPoll: Ref<boolean>, intervalMs?: number): {
6
- pause: import("@vueuse/shared").Fn;
7
- resume: import("@vueuse/shared").Fn;
7
+ pause: () => void;
8
+ resume: () => void;
8
9
  };
@@ -1,14 +1,21 @@
1
- import { useIntervalFn } from "@vueuse/core";
1
+ import { watch, onBeforeUnmount } from "#imports";
2
2
  export function useFlowRunsPolling(refresh, shouldPoll, intervalMs = 3e3) {
3
- const { pause, resume } = useIntervalFn(
4
- async () => {
5
- if (shouldPoll.value) {
6
- await refresh();
7
- }
8
- },
9
- intervalMs,
10
- { immediate: false }
11
- );
3
+ let intervalId = null;
4
+ const pause = () => {
5
+ if (intervalId) {
6
+ clearInterval(intervalId);
7
+ intervalId = null;
8
+ }
9
+ };
10
+ const resume = () => {
11
+ if (!intervalId) {
12
+ intervalId = setInterval(async () => {
13
+ if (shouldPoll.value) {
14
+ await refresh();
15
+ }
16
+ }, intervalMs);
17
+ }
18
+ };
12
19
  watch(shouldPoll, (should) => {
13
20
  if (should) {
14
21
  resume();
@@ -1,4 +1,4 @@
1
- import { type Ref } from 'vue';
1
+ import { type Ref } from '#imports';
2
2
  /**
3
3
  * Client-Side Flow State Reducer
4
4
  *
@@ -1,4 +1,4 @@
1
- import { ref, computed } from "vue";
1
+ import { ref, computed } from "#imports";
2
2
  export function reduceFlowState(events) {
3
3
  const state = {
4
4
  status: "running",
@@ -3,8 +3,8 @@
3
3
  * Uses URL query params for persistence across HMR
4
4
  */
5
5
  export declare function useFlowsNavigation(): {
6
- selectedFlow: any;
7
- selectedRunId: any;
8
- timelineOpen: any;
9
- selectedTab: any;
6
+ selectedFlow: import("vue").WritableComputedRef<string, string>;
7
+ selectedRunId: import("vue").WritableComputedRef<string, string>;
8
+ timelineOpen: import("vue").Ref<boolean, boolean>;
9
+ selectedTab: import("vue").WritableComputedRef<string, string>;
10
10
  };
@@ -1,3 +1,4 @@
1
+ import { computed, ref, watch, useRoute, useRouter } from "#imports";
1
2
  export function useFlowsNavigation() {
2
3
  const route = useRoute();
3
4
  const router = useRouter();
@@ -1,3 +1,4 @@
1
+ import type { FetchError } from 'ofetch';
1
2
  export interface QueueCounts {
2
3
  active: number;
3
4
  completed: number;
@@ -36,8 +37,8 @@ export interface QueueInfo {
36
37
  * Client-only to avoid hydration mismatches
37
38
  */
38
39
  export declare function useQueues(): {
39
- queues: any;
40
+ queues: globalThis.Ref<QueueInfo[] | null | undefined>;
40
41
  refresh: () => Promise<void>;
41
- status: any;
42
- error: any;
42
+ status: globalThis.Ref<'idle' | 'pending' | 'success' | 'error'>;
43
+ error: globalThis.Ref<FetchError | null | undefined>;
43
44
  };
@@ -1,4 +1,4 @@
1
- import { ref } from "#imports";
1
+ import { ref, useFetch } from "#imports";
2
2
  export function useQueues() {
3
3
  const refreshCounter = ref(0);
4
4
  const { data: queues, refresh: _refresh, status, error } = useFetch(
@@ -1,4 +1,4 @@
1
- import { defineNuxtPlugin } from "#app";
1
+ import { defineNuxtPlugin } from "#imports";
2
2
  import { VueFlow } from "@vue-flow/core";
3
3
  import { Controls } from "@vue-flow/controls";
4
4
  import { MiniMap } from "@vue-flow/minimap";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nvent",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Nuxt queue service based on Bullmq",
5
5
  "repository": "DevJoghurt/nuxt-queue",
6
6
  "license": "MIT",