@nvent-addon/app 0.4.5 → 0.5.0

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 (153) hide show
  1. package/dist/module.d.mts +19 -1
  2. package/dist/module.mjs +21 -4
  3. package/dist/runtime/app/components/{nhealth/component-router.d.vue.ts → ComponentRouter.d.vue.ts} +1 -5
  4. package/dist/runtime/app/components/{nhealth/component-router.vue.d.ts → ComponentRouter.vue.d.ts} +1 -5
  5. package/dist/runtime/app/components/{nhealth/component-shell.d.vue.ts → ComponentShell.d.vue.ts} +4 -9
  6. package/dist/runtime/app/components/ComponentShell.vue +87 -0
  7. package/dist/runtime/app/components/{nhealth/component-shell.vue.d.ts → ComponentShell.vue.d.ts} +4 -9
  8. package/dist/runtime/app/components/ConfirmDialog.d.vue.ts +1 -6
  9. package/dist/runtime/app/components/ConfirmDialog.vue.d.ts +1 -6
  10. package/dist/runtime/app/components/ListItem.d.vue.ts +3 -6
  11. package/dist/runtime/app/components/ListItem.vue.d.ts +3 -6
  12. package/dist/runtime/app/components/LiveIndicator.d.vue.ts +7 -0
  13. package/dist/runtime/app/components/LiveIndicator.vue +30 -0
  14. package/dist/runtime/app/components/LiveIndicator.vue.d.ts +7 -0
  15. package/dist/runtime/app/components/{QueueConfigDetails.d.vue.ts → QueueConfiguration.d.vue.ts} +1 -10
  16. package/dist/runtime/app/components/QueueConfiguration.vue +387 -0
  17. package/dist/runtime/app/components/{QueueConfigDetails.vue.d.ts → QueueConfiguration.vue.d.ts} +1 -10
  18. package/dist/runtime/app/components/StatCard.d.vue.ts +9 -0
  19. package/dist/runtime/app/components/StatCard.vue +57 -0
  20. package/dist/runtime/app/components/StatCard.vue.d.ts +9 -0
  21. package/dist/runtime/app/components/TimelineList.vue +67 -0
  22. package/dist/runtime/app/components/flow/AwaitNode.d.vue.ts +18 -0
  23. package/dist/runtime/app/components/flow/AwaitNode.vue +91 -0
  24. package/dist/runtime/app/components/flow/AwaitNode.vue.d.ts +18 -0
  25. package/dist/runtime/app/components/{FlowDiagram.d.vue.ts → flow/Diagram.d.vue.ts} +12 -1
  26. package/dist/runtime/app/components/{FlowDiagram.vue → flow/Diagram.vue} +92 -11
  27. package/dist/runtime/app/components/{FlowDiagram.vue.d.ts → flow/Diagram.vue.d.ts} +12 -1
  28. package/dist/runtime/app/components/{FlowRunOverview.d.vue.ts → flow/RunOverview.d.vue.ts} +3 -0
  29. package/dist/runtime/app/components/{FlowRunOverview.vue → flow/RunOverview.vue} +94 -8
  30. package/dist/runtime/app/components/{FlowRunOverview.vue.d.ts → flow/RunOverview.vue.d.ts} +3 -0
  31. package/dist/runtime/app/components/{FlowRunStatusBadge.d.vue.ts → flow/RunStatusBadge.d.vue.ts} +2 -8
  32. package/dist/runtime/app/components/{FlowRunStatusBadge.vue → flow/RunStatusBadge.vue} +8 -1
  33. package/dist/runtime/app/components/{FlowRunStatusBadge.vue.d.ts → flow/RunStatusBadge.vue.d.ts} +2 -8
  34. package/dist/runtime/app/components/{FlowRunTimeline.vue → flow/RunTimeline.vue} +1 -1
  35. package/dist/runtime/app/components/{FlowStepSelector.d.vue.ts → flow/StepSelector.d.vue.ts} +1 -0
  36. package/dist/runtime/app/components/flow/StepSelector.vue +553 -0
  37. package/dist/runtime/app/components/{FlowStepSelector.vue.d.ts → flow/StepSelector.vue.d.ts} +1 -0
  38. package/dist/runtime/app/components/trigger/BasicInfoCard.d.vue.ts +33 -0
  39. package/dist/runtime/app/components/trigger/BasicInfoCard.vue +168 -0
  40. package/dist/runtime/app/components/trigger/BasicInfoCard.vue.d.ts +33 -0
  41. package/dist/runtime/app/components/{FlowSchedulesList.d.vue.ts → trigger/DangerZone.d.vue.ts} +4 -6
  42. package/dist/runtime/app/components/trigger/DangerZone.vue +46 -0
  43. package/dist/runtime/app/components/{FlowSchedulesList.vue.d.ts → trigger/DangerZone.vue.d.ts} +4 -6
  44. package/dist/runtime/app/components/trigger/EditHeader.d.vue.ts +15 -0
  45. package/dist/runtime/app/components/trigger/EditHeader.vue +55 -0
  46. package/dist/runtime/app/components/trigger/EditHeader.vue.d.ts +15 -0
  47. package/dist/runtime/app/components/trigger/EventConfig.d.vue.ts +24 -0
  48. package/dist/runtime/app/components/trigger/EventConfig.vue +68 -0
  49. package/dist/runtime/app/components/trigger/EventConfig.vue.d.ts +24 -0
  50. package/dist/runtime/app/components/trigger/FlowSubscriptions.d.vue.ts +14 -0
  51. package/dist/runtime/app/components/trigger/FlowSubscriptions.vue +128 -0
  52. package/dist/runtime/app/components/trigger/FlowSubscriptions.vue.d.ts +14 -0
  53. package/dist/runtime/app/components/trigger/ScheduleConfig.d.vue.ts +27 -0
  54. package/dist/runtime/app/components/trigger/ScheduleConfig.vue +375 -0
  55. package/dist/runtime/app/components/trigger/ScheduleConfig.vue.d.ts +27 -0
  56. package/dist/runtime/app/components/{FlowScheduleDialog.d.vue.ts → trigger/StatusConfig.d.vue.ts} +6 -6
  57. package/dist/runtime/app/components/trigger/StatusConfig.vue +78 -0
  58. package/dist/runtime/app/components/{FlowScheduleDialog.vue.d.ts → trigger/StatusConfig.vue.d.ts} +6 -6
  59. package/dist/runtime/app/components/trigger/WebhookConfig.d.vue.ts +30 -0
  60. package/dist/runtime/app/components/trigger/WebhookConfig.vue +97 -0
  61. package/dist/runtime/app/components/trigger/WebhookConfig.vue.d.ts +30 -0
  62. package/dist/runtime/app/composables/useAnalyzedFlows.d.ts +5 -0
  63. package/dist/runtime/app/composables/useAnalyzedFlows.js +15 -1
  64. package/dist/runtime/app/composables/useComponentRouter.d.ts +8 -0
  65. package/dist/runtime/app/composables/useComponentRouter.js +10 -2
  66. package/dist/runtime/app/composables/useFlowRunsInfinite.d.ts +1 -1
  67. package/dist/runtime/app/composables/useFlowState.js +65 -0
  68. package/dist/runtime/app/composables/useFlowWebSocket.d.ts +11 -2
  69. package/dist/runtime/app/composables/useFlowWebSocket.js +181 -65
  70. package/dist/runtime/app/composables/useQueueJobs.d.ts +12 -1
  71. package/dist/runtime/app/composables/useQueueJobs.js +13 -7
  72. package/dist/runtime/app/composables/useTrigger.d.ts +137 -0
  73. package/dist/runtime/app/composables/useTrigger.js +116 -0
  74. package/dist/runtime/app/composables/useTriggerWebSocket.d.ts +35 -0
  75. package/dist/runtime/app/composables/useTriggerWebSocket.js +333 -0
  76. package/dist/runtime/app/pages/dashboard.d.vue.ts +3 -0
  77. package/dist/runtime/app/pages/dashboard.vue +738 -0
  78. package/dist/runtime/app/pages/dashboard.vue.d.ts +3 -0
  79. package/dist/runtime/app/pages/flows/[name].d.vue.ts +3 -0
  80. package/dist/runtime/app/pages/flows/[name].vue +680 -0
  81. package/dist/runtime/app/pages/flows/[name].vue.d.ts +3 -0
  82. package/dist/runtime/app/pages/flows/index.vue +321 -620
  83. package/dist/runtime/app/pages/index.vue +39 -9
  84. package/dist/runtime/app/pages/queues/index.vue +202 -194
  85. package/dist/runtime/app/pages/queues/jobs.vue +534 -207
  86. package/dist/runtime/app/pages/settings/scheduler.d.vue.ts +3 -0
  87. package/dist/runtime/app/pages/settings/scheduler.vue +310 -0
  88. package/dist/runtime/app/pages/settings/scheduler.vue.d.ts +3 -0
  89. package/dist/runtime/app/pages/triggers/[name]/edit.d.vue.ts +3 -0
  90. package/dist/runtime/app/pages/triggers/[name]/edit.vue +429 -0
  91. package/dist/runtime/app/pages/triggers/[name]/edit.vue.d.ts +3 -0
  92. package/dist/runtime/app/pages/triggers/[name].d.vue.ts +3 -0
  93. package/dist/runtime/app/pages/triggers/[name].vue +898 -0
  94. package/dist/runtime/app/pages/triggers/[name].vue.d.ts +3 -0
  95. package/dist/runtime/app/pages/triggers/index.d.vue.ts +3 -0
  96. package/dist/runtime/app/pages/triggers/index.vue +528 -0
  97. package/dist/runtime/app/pages/triggers/index.vue.d.ts +3 -0
  98. package/dist/runtime/app/pages/triggers/new.d.vue.ts +3 -0
  99. package/dist/runtime/app/pages/triggers/new.vue +610 -0
  100. package/dist/runtime/app/pages/triggers/new.vue.d.ts +3 -0
  101. package/dist/runtime/server/api/_flows/[name]/clear-history.delete.d.ts +10 -0
  102. package/dist/runtime/server/api/_flows/[name]/clear-history.delete.js +49 -0
  103. package/dist/runtime/server/api/_flows/[name]/runs/[runId]/cancel.post.d.ts +2 -0
  104. package/dist/runtime/server/api/_flows/[name]/runs/[runId]/cancel.post.js +21 -0
  105. package/dist/runtime/server/api/_flows/[name]/runs.get.d.ts +17 -0
  106. package/dist/runtime/server/api/_flows/[name]/runs.get.js +64 -0
  107. package/dist/runtime/server/api/_flows/[name]/start.post.d.ts +2 -0
  108. package/dist/runtime/server/api/_flows/[name]/start.post.js +9 -0
  109. package/dist/runtime/server/api/_flows/index.get.d.ts +7 -0
  110. package/dist/runtime/server/api/_flows/index.get.js +5 -0
  111. package/dist/runtime/server/api/_flows/recent-runs.get.d.ts +15 -0
  112. package/dist/runtime/server/api/_flows/recent-runs.get.js +67 -0
  113. package/dist/runtime/server/api/_flows/ws.d.ts +80 -0
  114. package/dist/runtime/server/api/_flows/ws.js +309 -0
  115. package/dist/runtime/server/api/_queues/[name]/job/[id].get.d.ts +2 -0
  116. package/dist/runtime/server/api/_queues/[name]/job/[id].get.js +14 -0
  117. package/dist/runtime/server/api/_queues/[name]/job/index.get.d.ts +2 -0
  118. package/dist/runtime/server/api/_queues/[name]/job/index.get.js +39 -0
  119. package/dist/runtime/server/api/_queues/index.get.d.ts +2 -0
  120. package/dist/runtime/server/api/_queues/index.get.js +106 -0
  121. package/dist/runtime/server/api/_queues/ws.d.ts +48 -0
  122. package/dist/runtime/server/api/_queues/ws.js +215 -0
  123. package/dist/runtime/server/api/_scheduler/jobs.get.d.ts +19 -0
  124. package/dist/runtime/server/api/_scheduler/jobs.get.js +36 -0
  125. package/dist/runtime/server/api/_triggers/[name]/events.get.d.ts +6 -0
  126. package/dist/runtime/server/api/_triggers/[name]/events.get.js +43 -0
  127. package/dist/runtime/server/api/_triggers/[name]/index.get.d.ts +6 -0
  128. package/dist/runtime/server/api/_triggers/[name]/index.get.js +76 -0
  129. package/dist/runtime/server/api/_triggers/[name].delete.d.ts +7 -0
  130. package/dist/runtime/server/api/_triggers/[name].delete.js +37 -0
  131. package/dist/runtime/server/api/_triggers/[name].patch.d.ts +7 -0
  132. package/dist/runtime/server/api/_triggers/[name].patch.js +117 -0
  133. package/dist/runtime/server/api/_triggers/index.get.d.ts +6 -0
  134. package/dist/runtime/server/api/_triggers/index.get.js +44 -0
  135. package/dist/runtime/server/api/_triggers/index.post.d.ts +7 -0
  136. package/dist/runtime/server/api/_triggers/index.post.js +124 -0
  137. package/dist/runtime/server/api/_triggers/stats.get.d.ts +6 -0
  138. package/dist/runtime/server/api/_triggers/stats.get.js +41 -0
  139. package/dist/runtime/server/api/_triggers/ws.d.ts +74 -0
  140. package/dist/runtime/server/api/_triggers/ws.js +315 -0
  141. package/dist/runtime/server/tsconfig.json +7 -0
  142. package/package.json +8 -8
  143. package/dist/runtime/app/components/FlowScheduleDialog.vue +0 -226
  144. package/dist/runtime/app/components/FlowSchedulesList.vue +0 -99
  145. package/dist/runtime/app/components/FlowStepSelector.vue +0 -238
  146. package/dist/runtime/app/components/QueueConfigDetails.vue +0 -412
  147. package/dist/runtime/app/components/nhealth/component-shell.vue +0 -89
  148. /package/dist/runtime/app/components/{nhealth/component-router.vue → ComponentRouter.vue} +0 -0
  149. /package/dist/runtime/app/components/{FlowNodeCard.d.vue.ts → flow/NodeCard.d.vue.ts} +0 -0
  150. /package/dist/runtime/app/components/{FlowNodeCard.vue → flow/NodeCard.vue} +0 -0
  151. /package/dist/runtime/app/components/{FlowNodeCard.vue.d.ts → flow/NodeCard.vue.d.ts} +0 -0
  152. /package/dist/runtime/app/components/{FlowRunTimeline.d.vue.ts → flow/RunTimeline.d.vue.ts} +0 -0
  153. /package/dist/runtime/app/components/{FlowRunTimeline.vue.d.ts → flow/RunTimeline.vue.d.ts} +0 -0
@@ -0,0 +1,375 @@
1
+ <template>
2
+ <component :is="noCard ? 'div' : UCard">
3
+ <template
4
+ v-if="!noCard"
5
+ #header
6
+ >
7
+ <div class="flex items-center gap-2">
8
+ <UIcon
9
+ name="i-lucide-clock"
10
+ class="w-5 h-5 text-emerald-500"
11
+ />
12
+ <h2 class="text-lg font-semibold">
13
+ Schedule Configuration
14
+ </h2>
15
+ </div>
16
+ </template>
17
+
18
+ <UForm
19
+ nested
20
+ :name="name"
21
+ :schema="schema"
22
+ :class="noCard ? 'space-y-6' : 'space-y-4'"
23
+ >
24
+ <!-- Schedule Type Toggle -->
25
+ <UFormField
26
+ label="Schedule Type"
27
+ name="scheduleType"
28
+ >
29
+ <URadioGroup
30
+ v-model="scheduleType"
31
+ :items="scheduleTypeOptions"
32
+ />
33
+ </UFormField>
34
+
35
+ <!-- Simple Interval Mode -->
36
+ <template v-if="scheduleType === 'interval'">
37
+ <UFormField
38
+ label="Run Every"
39
+ name="interval"
40
+ required
41
+ >
42
+ <template #hint>
43
+ <span class="text-xs text-gray-500">How often should this trigger run?</span>
44
+ </template>
45
+ <div class="flex gap-2">
46
+ <UInput
47
+ v-model="intervalValue"
48
+ type="number"
49
+ min="1"
50
+ placeholder="5"
51
+ icon="i-lucide-timer"
52
+ class="flex-1"
53
+ />
54
+ <USelectMenu
55
+ v-model="intervalUnit"
56
+ :items="intervalUnitOptions"
57
+ value-key="value"
58
+ class="w-32"
59
+ />
60
+ </div>
61
+ </UFormField>
62
+ </template>
63
+
64
+ <!-- Simple Preset Mode -->
65
+ <template v-if="scheduleType === 'preset'">
66
+ <UFormField
67
+ label="Schedule Preset"
68
+ name="preset"
69
+ required
70
+ >
71
+ <template #hint>
72
+ <span class="text-xs text-gray-500">Choose a common schedule pattern</span>
73
+ </template>
74
+ <USelectMenu
75
+ v-model="selectedPreset"
76
+ :items="presetOptions"
77
+ value-key="value"
78
+ placeholder="Select a preset"
79
+ class="w-full"
80
+ >
81
+ <template #label>
82
+ <div
83
+ v-if="selectedPreset"
84
+ class="flex items-center gap-2"
85
+ >
86
+ <UIcon
87
+ :name="selectedPreset.icon"
88
+ class="w-4 h-4"
89
+ />
90
+ <span>{{ selectedPreset.label }}</span>
91
+ </div>
92
+ <span v-else>Select a preset</span>
93
+ </template>
94
+ <template #option="{ option }">
95
+ <div class="flex items-center justify-between gap-2 w-full">
96
+ <div class="flex items-center gap-2">
97
+ <UIcon
98
+ :name="option.icon"
99
+ class="w-4 h-4"
100
+ />
101
+ <span>{{ option.label }}</span>
102
+ </div>
103
+ <span class="text-xs text-gray-500">{{ option.description }}</span>
104
+ </div>
105
+ </template>
106
+ </USelectMenu>
107
+ </UFormField>
108
+ </template>
109
+
110
+ <!-- Advanced Cron Mode -->
111
+ <template v-if="scheduleType === 'cron'">
112
+ <UFormField
113
+ label="Cron Expression"
114
+ name="cron"
115
+ required
116
+ >
117
+ <template #hint>
118
+ <span class="text-xs text-gray-500">Standard cron format (minute hour day month weekday)</span>
119
+ </template>
120
+ <UInput
121
+ v-model="config.cron"
122
+ placeholder="0 0 * * *"
123
+ icon="i-lucide-clock"
124
+ :hint="cronHint"
125
+ />
126
+ </UFormField>
127
+
128
+ <div
129
+ v-if="config.cron"
130
+ class="p-3 bg-blue-50 dark:bg-blue-900/10 border border-blue-200 dark:border-blue-900/30 rounded-lg"
131
+ >
132
+ <div class="flex items-start gap-2">
133
+ <UIcon
134
+ name="i-lucide-info"
135
+ class="w-4 h-4 text-blue-600 dark:text-blue-400 mt-0.5"
136
+ />
137
+ <div class="text-xs text-blue-600 dark:text-blue-400">
138
+ <div class="font-medium mb-1">
139
+ Cron Pattern: {{ config.cron }}
140
+ </div>
141
+ <div class="text-blue-500 dark:text-blue-500">
142
+ {{ cronDescription }}
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </template>
148
+
149
+ <!-- Timezone Selection -->
150
+ <UFormField
151
+ label="Timezone"
152
+ name="timezone"
153
+ required
154
+ >
155
+ <template #hint>
156
+ <span class="text-xs text-gray-500">Select the timezone for this schedule</span>
157
+ </template>
158
+ <USelectMenu
159
+ v-model="config.timezone"
160
+ :items="timezoneOptions"
161
+ searchable
162
+ placeholder="Search timezone..."
163
+ class="w-full"
164
+ >
165
+ <template #label>
166
+ <div class="flex items-center gap-2">
167
+ <UIcon
168
+ name="i-lucide-globe"
169
+ class="w-4 h-4"
170
+ />
171
+ <span>{{ config.timezone }}</span>
172
+ </div>
173
+ </template>
174
+ </USelectMenu>
175
+ </UFormField>
176
+ </UForm>
177
+ </component>
178
+ </template>
179
+
180
+ <script setup>
181
+ import { ref, computed, watch } from "#imports";
182
+ import { UCard } from "#components";
183
+ import { z } from "zod";
184
+ const { noCard = false, name = "schedule" } = defineProps({
185
+ noCard: { type: Boolean, required: false },
186
+ name: { type: String, required: false }
187
+ });
188
+ const config = defineModel({ type: Object, ...{ required: true } });
189
+ const scheduleType = ref("interval");
190
+ const intervalValue = ref(5);
191
+ const intervalUnit = ref("minutes");
192
+ const scheduleTypeOptions = [
193
+ { value: "interval", label: "Simple Interval", description: "Run every N minutes/hours/days" },
194
+ { value: "preset", label: "Common Patterns", description: "Daily, weekly, monthly, etc." },
195
+ { value: "cron", label: "Advanced (Cron)", description: "Custom cron expression" }
196
+ ];
197
+ const intervalUnitOptions = [
198
+ { label: "Seconds", value: "seconds" },
199
+ { label: "Minutes", value: "minutes" },
200
+ { label: "Hours", value: "hours" },
201
+ { label: "Days", value: "days" }
202
+ ];
203
+ const presetOptions = [
204
+ { value: "* * * * *", label: "Every Minute", description: "* * * * *", icon: "i-lucide-clock" },
205
+ { value: "0 * * * *", label: "Every Hour", description: "0 * * * *", icon: "i-lucide-clock" },
206
+ { value: "0 0 * * *", label: "Daily at Midnight", description: "0 0 * * *", icon: "i-lucide-sun" },
207
+ { value: "0 9 * * *", label: "Daily at 9 AM", description: "0 9 * * *", icon: "i-lucide-sunrise" },
208
+ { value: "0 17 * * *", label: "Daily at 5 PM", description: "0 17 * * *", icon: "i-lucide-sunset" },
209
+ { value: "0 0 * * 0", label: "Weekly (Sunday)", description: "0 0 * * 0", icon: "i-lucide-calendar" },
210
+ { value: "0 0 * * 1", label: "Weekly (Monday)", description: "0 0 * * 1", icon: "i-lucide-calendar" },
211
+ { value: "0 0 1 * *", label: "Monthly (1st)", description: "0 0 1 * *", icon: "i-lucide-calendar-days" },
212
+ { value: "0 0 1 1 *", label: "Yearly (Jan 1st)", description: "0 0 1 1 *", icon: "i-lucide-calendar-clock" }
213
+ ];
214
+ const selectedPreset = ref(presetOptions[0]);
215
+ const timezoneOptions = [
216
+ "UTC",
217
+ "America/New_York",
218
+ "America/Chicago",
219
+ "America/Denver",
220
+ "America/Los_Angeles",
221
+ "America/Toronto",
222
+ "America/Mexico_City",
223
+ "America/Sao_Paulo",
224
+ "Europe/London",
225
+ "Europe/Paris",
226
+ "Europe/Berlin",
227
+ "Europe/Rome",
228
+ "Europe/Madrid",
229
+ "Europe/Amsterdam",
230
+ "Asia/Tokyo",
231
+ "Asia/Shanghai",
232
+ "Asia/Hong_Kong",
233
+ "Asia/Singapore",
234
+ "Asia/Dubai",
235
+ "Asia/Kolkata",
236
+ "Australia/Sydney",
237
+ "Australia/Melbourne",
238
+ "Pacific/Auckland"
239
+ ];
240
+ if (config.value.cron) {
241
+ const matchingPreset = presetOptions.find((p) => p.value === config.value.cron);
242
+ if (matchingPreset) {
243
+ scheduleType.value = "preset";
244
+ selectedPreset.value = matchingPreset;
245
+ } else {
246
+ scheduleType.value = "cron";
247
+ }
248
+ } else if (config.value.interval) {
249
+ scheduleType.value = "interval";
250
+ const seconds = config.value.interval;
251
+ if (seconds % 86400 === 0) {
252
+ intervalValue.value = seconds / 86400;
253
+ intervalUnit.value = "days";
254
+ } else if (seconds % 3600 === 0) {
255
+ intervalValue.value = seconds / 3600;
256
+ intervalUnit.value = "hours";
257
+ } else if (seconds % 60 === 0) {
258
+ intervalValue.value = seconds / 60;
259
+ intervalUnit.value = "minutes";
260
+ } else {
261
+ intervalValue.value = seconds;
262
+ intervalUnit.value = "seconds";
263
+ }
264
+ } else {
265
+ scheduleType.value = "interval";
266
+ intervalValue.value = 5;
267
+ intervalUnit.value = "minutes";
268
+ config.value.interval = 300;
269
+ config.value.cron = void 0;
270
+ }
271
+ watch(intervalUnit, (newUnit, oldUnit) => {
272
+ if (scheduleType.value === "interval" && oldUnit && newUnit !== oldUnit) {
273
+ const multipliers = {
274
+ seconds: 1,
275
+ minutes: 60,
276
+ hours: 3600,
277
+ days: 86400
278
+ };
279
+ const oldMultiplier = multipliers[oldUnit] || 1;
280
+ const newMultiplier = multipliers[newUnit] || 1;
281
+ const currentSeconds = Number(intervalValue.value) * oldMultiplier;
282
+ const newValue = currentSeconds / newMultiplier;
283
+ intervalValue.value = Math.max(1, Math.round(newValue * 100) / 100);
284
+ }
285
+ });
286
+ watch([intervalValue, intervalUnit], () => {
287
+ if (scheduleType.value === "interval") {
288
+ const multiplier = {
289
+ seconds: 1,
290
+ minutes: 60,
291
+ hours: 3600,
292
+ days: 86400
293
+ }[intervalUnit.value] || 1;
294
+ const numValue = Number(intervalValue.value) || 1;
295
+ config.value.interval = numValue * multiplier;
296
+ config.value.cron = void 0;
297
+ }
298
+ }, { immediate: false });
299
+ watch(selectedPreset, (newPreset) => {
300
+ if (scheduleType.value === "preset" && newPreset) {
301
+ config.value.cron = newPreset.value;
302
+ config.value.interval = void 0;
303
+ }
304
+ });
305
+ watch(scheduleType, (newType) => {
306
+ if (newType === "interval") {
307
+ const multiplier = {
308
+ seconds: 1,
309
+ minutes: 60,
310
+ hours: 3600,
311
+ days: 86400
312
+ }[intervalUnit.value] || 1;
313
+ config.value.interval = intervalValue.value * multiplier;
314
+ config.value.cron = void 0;
315
+ } else if (newType === "preset") {
316
+ config.value.cron = selectedPreset.value?.value || "0 0 * * *";
317
+ config.value.interval = void 0;
318
+ } else if (newType === "cron") {
319
+ if (!config.value.cron) {
320
+ config.value.cron = "0 0 * * *";
321
+ }
322
+ config.value.interval = void 0;
323
+ }
324
+ });
325
+ const cronHint = computed(() => {
326
+ return "Format: minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-6)";
327
+ });
328
+ const cronDescription = computed(() => {
329
+ if (!config.value.cron)
330
+ return "";
331
+ const parts = config.value.cron.trim().split(/\s+/);
332
+ if (parts.length !== 5)
333
+ return "Invalid cron expression (must have 5 parts)";
334
+ const [minute = "*", hour = "*", day = "*", month = "*", weekday = "*"] = parts;
335
+ const descriptions = [];
336
+ if (minute === "*")
337
+ descriptions.push("every minute");
338
+ else if (minute.includes("/"))
339
+ descriptions.push(`every ${minute.split("/")[1]} minutes`);
340
+ else descriptions.push(`at minute ${minute}`);
341
+ if (hour === "*")
342
+ descriptions.push("of every hour");
343
+ else if (hour.includes("/"))
344
+ descriptions.push(`every ${hour.split("/")[1]} hours`);
345
+ else descriptions.push(`at ${hour}:00`);
346
+ if (day !== "*") {
347
+ descriptions.push(`on day ${day}`);
348
+ }
349
+ if (month !== "*") {
350
+ const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
351
+ const monthIndex = Number.parseInt(month) - 1;
352
+ if (monthIndex >= 0 && monthIndex < 12) {
353
+ descriptions.push(`in ${months[monthIndex]}`);
354
+ }
355
+ }
356
+ if (weekday !== "*") {
357
+ const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
358
+ const dayIndex = Number.parseInt(weekday);
359
+ if (dayIndex >= 0 && dayIndex < 7) {
360
+ descriptions.push(`on ${days[dayIndex]}`);
361
+ }
362
+ }
363
+ return descriptions.join(", ");
364
+ });
365
+ const schema = z.object({
366
+ cron: z.string().optional(),
367
+ interval: z.number().min(1, "Interval must be at least 1 second").optional(),
368
+ timezone: z.string().min(1, "Timezone is required"),
369
+ scheduleType: z.enum(["interval", "preset", "cron"]).optional(),
370
+ preset: z.string().optional()
371
+ }).refine(
372
+ (data) => data.cron || data.interval,
373
+ { message: "Please configure a schedule", path: ["interval"] }
374
+ );
375
+ </script>
@@ -0,0 +1,27 @@
1
+ type __VLS_Props = {
2
+ noCard?: boolean;
3
+ name?: string;
4
+ };
5
+ type __VLS_ModelProps = {
6
+ modelValue: {
7
+ cron?: string;
8
+ interval?: number;
9
+ timezone: string;
10
+ };
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "update:modelValue": (value: {
15
+ cron?: string;
16
+ interval?: number;
17
+ timezone: string;
18
+ }) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
+ "onUpdate:modelValue"?: ((value: {
21
+ cron?: string;
22
+ interval?: number;
23
+ timezone: string;
24
+ }) => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
@@ -1,16 +1,16 @@
1
1
  type __VLS_Props = {
2
- flowName: string;
2
+ status?: 'active' | 'inactive' | 'retired';
3
+ name?: string;
4
+ nested?: boolean;
3
5
  };
4
6
  type __VLS_ModelProps = {
5
- modelValue?: boolean;
7
+ modelValue?: 'active' | 'inactive' | 'retired';
6
8
  };
7
9
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
- scheduled: () => any;
11
+ "update:modelValue": (value: "active" | "inactive" | "retired") => any;
11
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
- onScheduled?: (() => any) | undefined;
13
+ "onUpdate:modelValue"?: ((value: "active" | "inactive" | "retired") => any) | undefined;
14
14
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  declare const _default: typeof __VLS_export;
16
16
  export default _default;
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <UCard>
3
+ <template #header>
4
+ <div class="flex items-center gap-2">
5
+ <UIcon
6
+ name="i-lucide-power"
7
+ class="w-5 h-5"
8
+ />
9
+ <h3 class="font-semibold">
10
+ Status
11
+ </h3>
12
+ </div>
13
+ </template>
14
+
15
+ <div class="space-y-4">
16
+ <UFormField
17
+ :name="name ? `${name}.status` : 'status'"
18
+ label="Trigger Status"
19
+ description="Control whether this trigger is enabled or disabled"
20
+ >
21
+ <URadioGroup
22
+ v-model="model"
23
+ :items="statusOptions"
24
+ variant="card"
25
+ />
26
+ </UFormField>
27
+
28
+ <UAlert
29
+ v-if="model === 'inactive'"
30
+ color="warning"
31
+ variant="subtle"
32
+ icon="i-lucide-alert-triangle"
33
+ title="Trigger is paused"
34
+ description="This trigger will not fire while inactive. Re-activate it when ready."
35
+ />
36
+
37
+ <UAlert
38
+ v-if="model === 'retired'"
39
+ color="neutral"
40
+ variant="subtle"
41
+ icon="i-lucide-archive"
42
+ title="Trigger is retired"
43
+ description="Retired triggers are permanently disabled but kept for historical reference. Consider deleting if no longer needed."
44
+ />
45
+ </div>
46
+ </UCard>
47
+ </template>
48
+
49
+ <script setup>
50
+ const props = defineProps({
51
+ status: { type: String, required: false },
52
+ name: { type: String, required: false },
53
+ nested: { type: Boolean, required: false }
54
+ });
55
+ const model = defineModel({ type: String, ...{
56
+ default: "active"
57
+ } });
58
+ if (props.status) {
59
+ model.value = props.status;
60
+ }
61
+ const statusOptions = [
62
+ {
63
+ value: "active",
64
+ label: "Active",
65
+ description: "Trigger is enabled and will fire when conditions are met"
66
+ },
67
+ {
68
+ value: "inactive",
69
+ label: "Inactive",
70
+ description: "Trigger is temporarily disabled but can be re-enabled later"
71
+ },
72
+ {
73
+ value: "retired",
74
+ label: "Retired",
75
+ description: "Trigger is permanently disabled but kept for historical reference"
76
+ }
77
+ ];
78
+ </script>
@@ -1,16 +1,16 @@
1
1
  type __VLS_Props = {
2
- flowName: string;
2
+ status?: 'active' | 'inactive' | 'retired';
3
+ name?: string;
4
+ nested?: boolean;
3
5
  };
4
6
  type __VLS_ModelProps = {
5
- modelValue?: boolean;
7
+ modelValue?: 'active' | 'inactive' | 'retired';
6
8
  };
7
9
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
- scheduled: () => any;
11
+ "update:modelValue": (value: "active" | "inactive" | "retired") => any;
11
12
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
- onScheduled?: (() => any) | undefined;
13
+ "onUpdate:modelValue"?: ((value: "active" | "inactive" | "retired") => any) | undefined;
14
14
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  declare const _default: typeof __VLS_export;
16
16
  export default _default;
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ noCard?: boolean;
3
+ name?: string;
4
+ };
5
+ type __VLS_ModelProps = {
6
+ modelValue: {
7
+ path: string;
8
+ method: string;
9
+ requireAuth: boolean;
10
+ authHeader: string;
11
+ };
12
+ };
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: {
16
+ path: string;
17
+ method: string;
18
+ requireAuth: boolean;
19
+ authHeader: string;
20
+ }) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: {
23
+ path: string;
24
+ method: string;
25
+ requireAuth: boolean;
26
+ authHeader: string;
27
+ }) => any) | undefined;
28
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
@@ -0,0 +1,97 @@
1
+ <template>
2
+ <component :is="noCard ? 'div' : UCard">
3
+ <template
4
+ v-if="!noCard"
5
+ #header
6
+ >
7
+ <div class="flex items-center gap-2">
8
+ <UIcon
9
+ name="i-lucide-webhook"
10
+ class="w-5 h-5 text-purple-500"
11
+ />
12
+ <h2 class="text-lg font-semibold">
13
+ Webhook Configuration
14
+ </h2>
15
+ </div>
16
+ </template>
17
+
18
+ <UForm
19
+ nested
20
+ :name="name"
21
+ :schema="schema"
22
+ :class="noCard ? 'space-y-6' : 'space-y-4'"
23
+ >
24
+ <UFormField
25
+ label="Webhook Path"
26
+ name="path"
27
+ required
28
+ >
29
+ <template #hint>
30
+ <span class="text-xs text-gray-500">The URL path where this webhook will listen</span>
31
+ </template>
32
+ <UInput
33
+ v-model="config.path"
34
+ placeholder="/my-trigger-name"
35
+ icon="i-lucide-link"
36
+ />
37
+ </UFormField>
38
+
39
+ <UFormField
40
+ label="HTTP Method"
41
+ name="method"
42
+ >
43
+ <template #hint>
44
+ <span class="text-xs text-gray-500">The HTTP method to accept</span>
45
+ </template>
46
+ <USelectMenu
47
+ v-model="config.method"
48
+ :items="['GET', 'POST', 'PUT', 'PATCH', 'DELETE']"
49
+ placeholder="Select method"
50
+ />
51
+ </UFormField>
52
+
53
+ <UFormField
54
+ label="Authentication"
55
+ name="requireAuth"
56
+ >
57
+ <ClientOnly>
58
+ <UCheckbox
59
+ v-model="config.requireAuth"
60
+ label="Require authentication"
61
+ />
62
+ </ClientOnly>
63
+ </UFormField>
64
+
65
+ <UFormField
66
+ v-if="config.requireAuth"
67
+ label="Auth Header Name"
68
+ name="authHeader"
69
+ >
70
+ <template #hint>
71
+ <span class="text-xs text-gray-500">The header name to check for authentication</span>
72
+ </template>
73
+ <UInput
74
+ v-model="config.authHeader"
75
+ placeholder="X-API-Key"
76
+ icon="i-lucide-key"
77
+ />
78
+ </UFormField>
79
+ </UForm>
80
+ </component>
81
+ </template>
82
+
83
+ <script setup>
84
+ import { UCard } from "#components";
85
+ import { z } from "zod";
86
+ const { noCard = false, name = "webhook" } = defineProps({
87
+ noCard: { type: Boolean, required: false },
88
+ name: { type: String, required: false }
89
+ });
90
+ const config = defineModel({ type: Object, ...{ required: true } });
91
+ const schema = z.object({
92
+ path: z.string().min(1, "Webhook path is required"),
93
+ method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]),
94
+ requireAuth: z.boolean(),
95
+ authHeader: z.string().optional()
96
+ });
97
+ </script>
@@ -0,0 +1,30 @@
1
+ type __VLS_Props = {
2
+ noCard?: boolean;
3
+ name?: string;
4
+ };
5
+ type __VLS_ModelProps = {
6
+ modelValue: {
7
+ path: string;
8
+ method: string;
9
+ requireAuth: boolean;
10
+ authHeader: string;
11
+ };
12
+ };
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ "update:modelValue": (value: {
16
+ path: string;
17
+ method: string;
18
+ requireAuth: boolean;
19
+ authHeader: string;
20
+ }) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
22
+ "onUpdate:modelValue"?: ((value: {
23
+ path: string;
24
+ method: string;
25
+ requireAuth: boolean;
26
+ authHeader: string;
27
+ }) => any) | undefined;
28
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;