feat(api): added workflows api route for dynamic discovery (#2892)

* feat(api): added workflows api route for dynamic discovery

* added ability to edit parameter and workflow descriptions

* added new rate limit category, ack PR comments

* fix hasChanges logic

* added whitespace trimming before hasChanges check
This commit is contained in:
Waleed
2026-01-19 17:21:51 -08:00
committed by GitHub
parent 9efd3d5b4c
commit 6cbadd7110
7 changed files with 567 additions and 42 deletions

View File

@@ -7,6 +7,7 @@ import type { InputFormatField } from '@/lib/workflows/types'
export interface WorkflowInputField {
name: string
type: string
description?: string
}
/**
@@ -37,7 +38,7 @@ export function extractInputFieldsFromBlocks(
if (Array.isArray(inputFormat)) {
return inputFormat
.filter(
(field: unknown): field is { name: string; type?: string } =>
(field: unknown): field is { name: string; type?: string; description?: string } =>
typeof field === 'object' &&
field !== null &&
'name' in field &&
@@ -47,6 +48,7 @@ export function extractInputFieldsFromBlocks(
.map((field) => ({
name: field.name,
type: field.type || 'string',
...(field.description && { description: field.description }),
}))
}
@@ -57,7 +59,7 @@ export function extractInputFieldsFromBlocks(
if (Array.isArray(legacyFormat)) {
return legacyFormat
.filter(
(field: unknown): field is { name: string; type?: string } =>
(field: unknown): field is { name: string; type?: string; description?: string } =>
typeof field === 'object' &&
field !== null &&
'name' in field &&
@@ -67,6 +69,7 @@ export function extractInputFieldsFromBlocks(
.map((field) => ({
name: field.name,
type: field.type || 'string',
...(field.description && { description: field.description }),
}))
}