nvent 0.4.2 → 0.4.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.
@@ -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,3 +1,4 @@
1
+ import { type Ref } from 'vue';
1
2
  /**
2
3
  * Composable for managing a single flow run's timeline and state
3
4
  *
@@ -7,9 +8,73 @@
7
8
  * - Fresh WebSocket connection on each mount = clean, predictable behavior
8
9
  */
9
10
  export declare function useFlowRunTimeline(flowId: Ref<string>, runId: Ref<string>): {
10
- flowState: any;
11
- isConnected: any;
12
- isReconnecting: any;
11
+ flowState: {
12
+ events: Ref<import("~~/.nuxt/imports").EventRecord[], import("~~/.nuxt/imports").EventRecord[]>;
13
+ state: import("vue").ComputedRef<import("~~/.nuxt/imports").FlowState>;
14
+ addEvent: (event: import("~~/.nuxt/imports").EventRecord) => void;
15
+ addEvents: (newEvents: import("~~/.nuxt/imports").EventRecord[]) => void;
16
+ reset: (newEvents?: import("~~/.nuxt/imports").EventRecord[]) => void;
17
+ isRunning: import("vue").ComputedRef<boolean>;
18
+ isCompleted: import("vue").ComputedRef<boolean>;
19
+ isFailed: import("vue").ComputedRef<boolean>;
20
+ stepList: import("vue").ComputedRef<{
21
+ status: "pending" | "running" | "completed" | "failed" | "retrying" | "waiting" | "timeout";
22
+ attempt: number;
23
+ startedAt?: string;
24
+ completedAt?: string;
25
+ error?: string;
26
+ awaitType?: "time" | "event" | "trigger";
27
+ awaitData?: any;
28
+ result?: any;
29
+ key: string;
30
+ }[]>;
31
+ runningSteps: import("vue").ComputedRef<{
32
+ status: "pending" | "running" | "completed" | "failed" | "retrying" | "waiting" | "timeout";
33
+ attempt: number;
34
+ startedAt?: string;
35
+ completedAt?: string;
36
+ error?: string;
37
+ awaitType?: "time" | "event" | "trigger";
38
+ awaitData?: any;
39
+ result?: any;
40
+ key: string;
41
+ }[]>;
42
+ waitingSteps: import("vue").ComputedRef<{
43
+ status: "pending" | "running" | "completed" | "failed" | "retrying" | "waiting" | "timeout";
44
+ attempt: number;
45
+ startedAt?: string;
46
+ completedAt?: string;
47
+ error?: string;
48
+ awaitType?: "time" | "event" | "trigger";
49
+ awaitData?: any;
50
+ result?: any;
51
+ key: string;
52
+ }[]>;
53
+ failedSteps: import("vue").ComputedRef<{
54
+ status: "pending" | "running" | "completed" | "failed" | "retrying" | "waiting" | "timeout";
55
+ attempt: number;
56
+ startedAt?: string;
57
+ completedAt?: string;
58
+ error?: string;
59
+ awaitType?: "time" | "event" | "trigger";
60
+ awaitData?: any;
61
+ result?: any;
62
+ key: string;
63
+ }[]>;
64
+ completedSteps: import("vue").ComputedRef<{
65
+ status: "pending" | "running" | "completed" | "failed" | "retrying" | "waiting" | "timeout";
66
+ attempt: number;
67
+ startedAt?: string;
68
+ completedAt?: string;
69
+ error?: string;
70
+ awaitType?: "time" | "event" | "trigger";
71
+ awaitData?: any;
72
+ result?: any;
73
+ key: string;
74
+ }[]>;
75
+ };
76
+ isConnected: import("vue").ComputedRef<boolean>;
77
+ isReconnecting: import("vue").ComputedRef<boolean>;
13
78
  loadRun: () => Promise<void>;
14
79
  stopStream: () => void;
15
80
  };
@@ -1,4 +1,6 @@
1
1
  import { useFlowWebSocket } from "./useFlowWebSocket.js";
2
+ import { useFlowState } from "./useFlowState.js";
3
+ import { computed, nextTick, onBeforeUnmount, watch } from "vue";
2
4
  export function useFlowRunTimeline(flowId, runId) {
3
5
  const flowState = useFlowState();
4
6
  const flowWs = useFlowWebSocket();
@@ -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: Ref<FlowRun[] | null | undefined>;
8
14
  refresh: () => Promise<void>;
9
- status: any;
10
- error: any;
15
+ status: Ref<'idle' | 'pending' | 'success' | 'error'>;
16
+ error: 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,4 +1,5 @@
1
1
  import { type Ref } from '#imports';
2
+ import type { FetchError } from 'ofetch';
2
3
  export interface Job {
3
4
  id: string;
4
5
  name: string;
@@ -17,4 +18,9 @@ export interface JobsResponse {
17
18
  * Composable for fetching jobs for a queue
18
19
  * Client-only to avoid hydration mismatches
19
20
  */
20
- export declare function useQueueJobs(queueName: Ref<string>, state?: Ref<string | null>): any;
21
+ export declare function useQueueJobs(queueName: Ref<string>, state?: Ref<string | null>): {
22
+ data: Ref<JobsResponse | null | undefined>;
23
+ refresh: () => Promise<void>;
24
+ status: Ref<'idle' | 'pending' | 'success' | 'error'>;
25
+ error: Ref<FetchError | null | undefined>;
26
+ };
@@ -1,4 +1,4 @@
1
- import { ref } from "#imports";
1
+ import { ref, useFetch } from "#imports";
2
2
  export function useQueueJobs(queueName, state = ref(null)) {
3
3
  return useFetch(
4
4
  () => {
@@ -1,3 +1,5 @@
1
+ import { type Ref } from '#imports';
2
+ import type { FetchError } from 'ofetch';
1
3
  export interface QueueCounts {
2
4
  active: number;
3
5
  completed: number;
@@ -36,8 +38,8 @@ export interface QueueInfo {
36
38
  * Client-only to avoid hydration mismatches
37
39
  */
38
40
  export declare function useQueues(): {
39
- queues: any;
41
+ queues: Ref<QueueInfo[] | null | undefined>;
40
42
  refresh: () => Promise<void>;
41
- status: any;
42
- error: any;
43
+ status: Ref<'idle' | 'pending' | 'success' | 'error'>;
44
+ error: Ref<FetchError | null | undefined>;
43
45
  };
@@ -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(
@@ -97,7 +97,7 @@
97
97
  </template>
98
98
 
99
99
  <script setup>
100
- import { ref } from "#imports";
100
+ import { ref, useTemplateRef, h } from "#imports";
101
101
  import { getPaginationRowModel } from "@tanstack/table-core";
102
102
  import { UTable, UButton, UPagination } from "#components";
103
103
  import { useQueues } from "../../composables/useQueues";
@@ -204,7 +204,7 @@
204
204
  </template>
205
205
 
206
206
  <script setup>
207
- import { computed } from "#imports";
207
+ import { computed, useFetch } from "#imports";
208
208
  import { UCard, UButton, UBadge } from "#components";
209
209
  import { useComponentRouter } from "../../composables/useComponentRouter";
210
210
  const router = useComponentRouter();
@@ -153,7 +153,7 @@
153
153
  </template>
154
154
 
155
155
  <script setup>
156
- import { ref, computed, watch } from "#imports";
156
+ import { ref, computed, watch, resolveComponent, useTemplateRef, h } from "#imports";
157
157
  import { getPaginationRowModel } from "@tanstack/table-core";
158
158
  import { UTable, UButton, UBadge, UPagination, USelectMenu } from "#components";
159
159
  import { useQueueJobs } from "../../composables/useQueueJobs";
@@ -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.4",
4
4
  "description": "Nuxt queue service based on Bullmq",
5
5
  "repository": "DevJoghurt/nuxt-queue",
6
6
  "license": "MIT",