@elqnt/workflow 2.1.4 → 2.2.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.
- package/README.md +6 -0
- package/SKILL.md +442 -0
- package/dist/api/index.js +3 -4
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +1 -2
- package/dist/chunk-3GG6KTGJ.js +998 -0
- package/dist/chunk-3GG6KTGJ.js.map +1 -0
- package/dist/{chunk-UE4ZBFLG.mjs → chunk-4AUWFGQK.mjs} +1 -3
- package/dist/{chunk-UE4ZBFLG.mjs.map → chunk-4AUWFGQK.mjs.map} +1 -1
- package/dist/{chunk-H24IF5AA.js → chunk-6DV2LPSN.js} +2 -4
- package/dist/chunk-6DV2LPSN.js.map +1 -0
- package/dist/chunk-AXXQSYT7.mjs +998 -0
- package/dist/chunk-AXXQSYT7.mjs.map +1 -0
- package/dist/{chunk-YCEGKVXP.mjs → chunk-IY5JCMLA.mjs} +1 -3
- package/dist/{chunk-YCEGKVXP.mjs.map → chunk-IY5JCMLA.mjs.map} +1 -1
- package/dist/{chunk-JES2EBNO.js → chunk-YCO5IFZK.js} +2 -4
- package/dist/chunk-YCO5IFZK.js.map +1 -0
- package/dist/components/index.d.mts +245 -0
- package/dist/components/index.d.ts +245 -0
- package/dist/components/index.js +10 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +10 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/hooks/index.d.mts +72 -27
- package/dist/hooks/index.d.ts +72 -27
- package/dist/hooks/index.js +397 -5
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +401 -9
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -246
- package/dist/index.d.ts +4 -246
- package/dist/index.js +8 -1012
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1009
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.js +3 -4
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +1 -2
- package/package.json +12 -6
- package/dist/chunk-H24IF5AA.js.map +0 -1
- package/dist/chunk-JES2EBNO.js.map +0 -1
- package/dist/chunk-KWWX35B4.js +0 -413
- package/dist/chunk-KWWX35B4.js.map +0 -1
- package/dist/chunk-WDERYFU3.mjs +0 -413
- package/dist/chunk-WDERYFU3.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../components/dynamic-schema-form.tsx","../components/schema-builder.tsx"],"sourcesContent":["\"use client\";\n\nimport { JSONSchema } from \"@elqnt/types\";\nimport { useState, useMemo } from \"react\";\n\n// UI Components - these will be imported from the app's components\n// We use a render props pattern to allow apps to provide their own UI components\nexport interface DynamicSchemaFormUIComponents {\n Input: React.ComponentType<{\n type?: string;\n value: any;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n disabled?: boolean;\n className?: string;\n placeholder?: string;\n min?: number;\n max?: number;\n step?: string | number;\n }>;\n Label: React.ComponentType<{\n htmlFor?: string;\n className?: string;\n children: React.ReactNode;\n }>;\n Textarea: React.ComponentType<{\n value: any;\n onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;\n disabled?: boolean;\n rows?: number;\n className?: string;\n placeholder?: string;\n }>;\n Checkbox: React.ComponentType<{\n id?: string;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n disabled?: boolean;\n }>;\n Select: React.ComponentType<{\n value: string;\n onValueChange: (value: string) => void;\n disabled?: boolean;\n children: React.ReactNode;\n }>;\n SelectTrigger: React.ComponentType<{\n className?: string;\n children: React.ReactNode;\n }>;\n SelectValue: React.ComponentType<{\n placeholder?: string;\n }>;\n SelectContent: React.ComponentType<{\n children: React.ReactNode;\n }>;\n SelectItem: React.ComponentType<{\n value: string;\n className?: string;\n children: React.ReactNode;\n }>;\n Button: React.ComponentType<{\n type?: \"button\" | \"submit\" | \"reset\";\n variant?: string;\n size?: string;\n className?: string;\n onClick?: () => void;\n disabled?: boolean;\n children: React.ReactNode;\n }>;\n Card: React.ComponentType<{\n className?: string;\n children: React.ReactNode;\n }>;\n // Icons\n PlusIcon: React.ComponentType<{ className?: string }>;\n TrashIcon: React.ComponentType<{ className?: string }>;\n ChevronDownIcon: React.ComponentType<{ className?: string }>;\n ChevronRightIcon: React.ComponentType<{ className?: string }>;\n VariableIcon?: React.ComponentType<{ className?: string }>;\n CheckIcon?: React.ComponentType<{ className?: string }>;\n EditIcon?: React.ComponentType<{ className?: string }>;\n // Popover components for variable picker (optional)\n Popover?: React.ComponentType<{ open?: boolean; onOpenChange?: (open: boolean) => void; children: React.ReactNode }>;\n PopoverTrigger?: React.ComponentType<{ asChild?: boolean; children: React.ReactNode }>;\n PopoverContent?: React.ComponentType<{ className?: string; align?: \"start\" | \"center\" | \"end\"; children: React.ReactNode }>;\n // Dialog components for rich text editor (optional)\n Dialog?: React.ComponentType<{ open?: boolean; onOpenChange?: (open: boolean) => void; children: React.ReactNode }>;\n DialogContent?: React.ComponentType<{ className?: string; children: React.ReactNode }>;\n DialogHeader?: React.ComponentType<{ className?: string; children: React.ReactNode }>;\n DialogTitle?: React.ComponentType<{ className?: string; children: React.ReactNode }>;\n DialogFooter?: React.ComponentType<{ className?: string; children: React.ReactNode }>;\n // ScrollArea for variable picker in dialog\n ScrollArea?: React.ComponentType<{ className?: string; children: React.ReactNode }>;\n // MarkdownEditor for richtext fields\n MarkdownEditor?: React.ComponentType<{\n content: string;\n onChange: (markdown: string) => void;\n placeholder?: string;\n className?: string;\n readOnly?: boolean;\n minHeight?: string;\n variables?: Array<{ name: string; path: string; title?: string }>;\n }>;\n // Utility\n cn: (...classes: (string | undefined | null | false)[]) => string;\n}\n\n/**\n * Variable definition for workflow variables\n */\nexport interface WorkflowVariable {\n name: string;\n type: string; // JSON Schema type: \"string\", \"number\", \"boolean\", \"object\", \"array\"\n title?: string;\n path: string; // Full path like \"variables.customerEmail\" or \"input.recordId\"\n}\n\nexport interface DynamicSchemaFormProps {\n schema: JSONSchema;\n value: any;\n onChange: (value: any) => void;\n disabled?: boolean;\n path?: string[];\n components: DynamicSchemaFormUIComponents;\n /** Workflow variables available for selection */\n variables?: WorkflowVariable[];\n /** Whether to show variable picker buttons */\n showVariablePicker?: boolean;\n}\n\nexport function DynamicSchemaForm({\n schema,\n value = {},\n onChange,\n disabled = false,\n path = [],\n components,\n variables = [],\n showVariablePicker = false,\n}: DynamicSchemaFormProps) {\n const [collapsedSections, setCollapsedSections] = useState<Set<string>>(\n new Set()\n );\n const [openVariablePickers, setOpenVariablePickers] = useState<Set<string>>(\n new Set()\n );\n const [openRichTextDialogs, setOpenRichTextDialogs] = useState<Set<string>>(\n new Set()\n );\n const [richTextDraftValues, setRichTextDraftValues] = useState<Record<string, string>>({});\n\n const {\n Input,\n Label,\n Textarea,\n Checkbox,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Button,\n Card,\n PlusIcon,\n TrashIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n VariableIcon,\n CheckIcon,\n EditIcon,\n Popover,\n PopoverTrigger,\n PopoverContent,\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogFooter,\n ScrollArea,\n MarkdownEditor,\n cn,\n } = components;\n\n // Check if a value is a variable reference (e.g., \"{{variables.email}}\")\n const isVariableReference = (val: any): boolean => {\n return typeof val === \"string\" && val.startsWith(\"{{\") && val.endsWith(\"}}\");\n };\n\n // Get variables that match a specific JSON Schema type\n const getMatchingVariables = (fieldType: string | undefined): WorkflowVariable[] => {\n if (!fieldType) return variables;\n\n // Type compatibility mapping\n const compatibleTypes: Record<string, string[]> = {\n string: [\"string\"],\n number: [\"number\", \"integer\"],\n integer: [\"number\", \"integer\"],\n boolean: [\"boolean\"],\n object: [\"object\"],\n array: [\"array\"],\n };\n\n const compatible = compatibleTypes[fieldType] || [fieldType];\n return variables.filter((v) => compatible.includes(v.type));\n };\n\n // Toggle variable picker for a field\n const toggleVariablePicker = (fieldPath: string) => {\n setOpenVariablePickers((prev) => {\n const next = new Set(prev);\n if (next.has(fieldPath)) {\n next.delete(fieldPath);\n } else {\n next.add(fieldPath);\n }\n return next;\n });\n };\n\n // Render a variable picker button for a field\n const renderVariablePicker = (\n fieldName: string,\n fieldType: string | undefined,\n fieldPath: string,\n onSelect: (variablePath: string) => void\n ) => {\n // Don't render if showVariablePicker is false\n if (!showVariablePicker) {\n return null;\n }\n\n // Need at least VariableIcon and Popover components to render\n if (!VariableIcon || !Popover || !PopoverTrigger || !PopoverContent) {\n return null;\n }\n\n const matchingVars = getMatchingVariables(fieldType);\n const isOpen = openVariablePickers.has(fieldPath);\n const currentValue = value[fieldName];\n const isVariable = isVariableReference(currentValue);\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={(open) => {\n if (open) {\n setOpenVariablePickers((prev) => new Set(prev).add(fieldPath));\n } else {\n setOpenVariablePickers((prev) => {\n const next = new Set(prev);\n next.delete(fieldPath);\n return next;\n });\n }\n }}\n >\n <PopoverTrigger asChild>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className={cn(\n \"h-8 px-2 shrink-0\",\n isVariable && \"border-primary text-primary\"\n )}\n disabled={disabled}\n >\n <VariableIcon className=\"h-3.5 w-3.5\" />\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-56 p-1\" align=\"end\">\n <div className=\"text-xs font-medium text-muted-foreground px-2 py-1.5\">\n Select Variable ({fieldType || \"any\"})\n </div>\n <div className=\"max-h-48 overflow-y-auto\">\n {matchingVars.length === 0 ? (\n <div className=\"px-2 py-3 text-xs text-muted-foreground text-center\">\n No variables available.\n <br />\n <span className=\"text-[10px]\">\n Add variables in Workflow Settings → Variables\n </span>\n </div>\n ) : (\n matchingVars.map((variable) => {\n const varRef = `{{${variable.path}}}`;\n const isSelected = currentValue === varRef;\n return (\n <button\n key={variable.path}\n type=\"button\"\n className={cn(\n \"w-full text-left px-2 py-1.5 text-xs rounded hover:bg-accent flex items-center justify-between\",\n isSelected && \"bg-accent\"\n )}\n onClick={() => {\n onSelect(varRef);\n setOpenVariablePickers((prev) => {\n const next = new Set(prev);\n next.delete(fieldPath);\n return next;\n });\n }}\n >\n <div>\n <div className=\"font-medium\">{variable.title || variable.name}</div>\n <div className=\"text-[10px] text-muted-foreground font-mono\">\n {variable.path}\n </div>\n </div>\n {isSelected && CheckIcon && <CheckIcon className=\"h-3 w-3\" />}\n </button>\n );\n })\n )}\n </div>\n </PopoverContent>\n </Popover>\n );\n };\n\n const toggleSection = (key: string) => {\n setCollapsedSections((prev) => {\n const next = new Set(prev);\n if (next.has(key)) {\n next.delete(key);\n } else {\n next.add(key);\n }\n return next;\n });\n };\n\n const handleFieldChange = (fieldName: string, fieldValue: any) => {\n onChange({\n ...value,\n [fieldName]: fieldValue,\n });\n };\n\n const renderField = (\n fieldSchema: JSONSchema,\n fieldName: string,\n fieldValue: any\n ) => {\n const fieldPath = [...path, fieldName].join(\".\");\n const isRequired = schema.required?.includes(fieldName);\n\n // Handle enum (dropdown)\n if (fieldSchema.enum) {\n const labels =\n (fieldSchema as any)[\"x-enumLabels\"] || fieldSchema.enum;\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <Select\n value={fieldValue || \"\"}\n onValueChange={(v) => handleFieldChange(fieldName, v)}\n disabled={disabled}\n >\n <SelectTrigger className=\"h-8 text-xs\">\n <SelectValue\n placeholder={`Select ${fieldSchema.title || fieldName}`}\n />\n </SelectTrigger>\n <SelectContent>\n {fieldSchema.enum.map((option: any, idx: number) => (\n <SelectItem key={option} value={option} className=\"text-xs\">\n {labels[idx] || option}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {fieldSchema.description && (\n <p className=\"text-[10px] text-muted-foreground\">\n {fieldSchema.description}\n </p>\n )}\n </div>\n );\n }\n\n // Handle nested objects\n if (fieldSchema.type === \"object\" && fieldSchema.properties) {\n const isCollapsed = collapsedSections.has(fieldPath);\n return (\n <div key={fieldPath} className=\"space-y-2\">\n <button\n type=\"button\"\n onClick={() => toggleSection(fieldPath)}\n className=\"flex items-center gap-1 text-xs font-medium text-gray-700 hover:text-gray-900\"\n >\n {isCollapsed ? (\n <ChevronRightIcon className=\"h-3 w-3\" />\n ) : (\n <ChevronDownIcon className=\"h-3 w-3\" />\n )}\n {fieldSchema.title || fieldName}\n </button>\n {!isCollapsed && (\n <Card className=\"p-3 bg-gray-50/50\">\n <DynamicSchemaForm\n schema={fieldSchema}\n value={fieldValue || {}}\n onChange={(v) => handleFieldChange(fieldName, v)}\n disabled={disabled}\n path={[...path, fieldName]}\n components={components}\n variables={variables}\n showVariablePicker={showVariablePicker}\n />\n </Card>\n )}\n </div>\n );\n }\n\n // Handle arrays\n if (fieldSchema.type === \"array\" && fieldSchema.items) {\n const arrayValue = Array.isArray(fieldValue) ? fieldValue : [];\n const itemSchema = fieldSchema.items as JSONSchema;\n\n return (\n <div key={fieldPath} className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-6 text-xs px-2\"\n onClick={() => {\n const newItem = itemSchema.type === \"object\" ? {} : \"\";\n handleFieldChange(fieldName, [...arrayValue, newItem]);\n }}\n disabled={disabled}\n >\n <PlusIcon className=\"h-3 w-3 mr-1\" />\n Add\n </Button>\n </div>\n {fieldSchema.description && (\n <p className=\"text-[10px] text-muted-foreground\">\n {fieldSchema.description}\n </p>\n )}\n <div className=\"space-y-2\">\n {arrayValue.map((item: any, index: number) => (\n <div key={index} className=\"flex gap-2 items-start\">\n <div className=\"flex-1\">\n {itemSchema.type === \"object\" ? (\n <Card className=\"p-2 bg-gray-50/50\">\n <DynamicSchemaForm\n schema={itemSchema}\n value={item}\n onChange={(v) => {\n const newArray = [...arrayValue];\n newArray[index] = v;\n handleFieldChange(fieldName, newArray);\n }}\n disabled={disabled}\n path={[...path, fieldName, String(index)]}\n components={components}\n variables={variables}\n showVariablePicker={showVariablePicker}\n />\n </Card>\n ) : (\n <Input\n value={item || \"\"}\n onChange={(e) => {\n const newArray = [...arrayValue];\n newArray[index] = e.target.value;\n handleFieldChange(fieldName, newArray);\n }}\n disabled={disabled}\n className=\"h-8 text-xs\"\n />\n )}\n </div>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 w-8 p-0 text-red-500 hover:text-red-700\"\n onClick={() => {\n const newArray = arrayValue.filter(\n (_: any, i: number) => i !== index\n );\n handleFieldChange(fieldName, newArray);\n }}\n disabled={disabled}\n >\n <TrashIcon className=\"h-3 w-3\" />\n </Button>\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n // Handle boolean\n if (fieldSchema.type === \"boolean\") {\n return (\n <div key={fieldPath} className=\"flex items-center space-x-2\">\n <Checkbox\n id={fieldPath}\n checked={!!fieldValue}\n onCheckedChange={(checked) => handleFieldChange(fieldName, checked)}\n disabled={disabled}\n />\n <Label htmlFor={fieldPath} className=\"text-xs font-normal\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n {fieldSchema.description && (\n <span className=\"text-[10px] text-muted-foreground ml-2\">\n ({fieldSchema.description})\n </span>\n )}\n </div>\n );\n }\n\n // Handle number/integer\n if (fieldSchema.type === \"number\" || fieldSchema.type === \"integer\") {\n const isVarValue = isVariableReference(fieldValue);\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <div className=\"flex gap-1.5\">\n <Input\n type={isVarValue ? \"text\" : \"number\"}\n value={fieldValue ?? \"\"}\n onChange={(e) => {\n if (isVariableReference(e.target.value)) {\n handleFieldChange(fieldName, e.target.value);\n } else {\n const val =\n e.target.value === \"\" ? undefined : Number(e.target.value);\n handleFieldChange(fieldName, val);\n }\n }}\n min={fieldSchema.minimum}\n max={fieldSchema.maximum}\n step={fieldSchema.type === \"integer\" ? 1 : \"any\"}\n disabled={disabled}\n className={cn(\"h-8 text-xs flex-1\", isVarValue && \"font-mono text-primary\")}\n />\n {renderVariablePicker(fieldName, fieldSchema.type, fieldPath, (varPath) =>\n handleFieldChange(fieldName, varPath)\n )}\n </div>\n {fieldSchema.description && (\n <p className=\"text-[10px] text-muted-foreground\">\n {fieldSchema.description}\n </p>\n )}\n </div>\n );\n }\n\n // Handle string with format\n if (fieldSchema.type === \"string\") {\n // Rich text editor - opens in dialog\n if (fieldSchema.format === \"richtext\") {\n const isDialogOpen = openRichTextDialogs.has(fieldPath);\n const draftValue = richTextDraftValues[fieldPath] ?? fieldValue ?? \"\";\n const previewText = (fieldValue || \"\").replace(/<[^>]*>/g, \"\").slice(0, 50);\n const matchingVars = getMatchingVariables(\"string\");\n\n // Check if Dialog components are available\n if (!Dialog || !DialogContent || !DialogHeader || !DialogTitle || !DialogFooter) {\n // Fallback to regular textarea if Dialog not provided\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <div className=\"flex items-center justify-between\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n {renderVariablePicker(fieldName, \"string\", fieldPath, (varPath) =>\n handleFieldChange(fieldName, (fieldValue || \"\") + varPath)\n )}\n </div>\n <Textarea\n value={fieldValue || \"\"}\n onChange={(e) => handleFieldChange(fieldName, e.target.value)}\n disabled={disabled}\n rows={3}\n className=\"text-xs\"\n placeholder={fieldSchema.description}\n />\n </div>\n );\n }\n\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <div className=\"flex gap-1.5\">\n <div className=\"flex-1 min-w-0 px-2 py-1.5 bg-muted/50 rounded text-xs text-muted-foreground truncate border\">\n {previewText || <span className=\"italic\">Click edit to add content...</span>}\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 px-2 shrink-0\"\n onClick={() => {\n setRichTextDraftValues((prev) => ({ ...prev, [fieldPath]: fieldValue || \"\" }));\n setOpenRichTextDialogs((prev) => new Set(prev).add(fieldPath));\n }}\n disabled={disabled}\n >\n {EditIcon ? <EditIcon className=\"h-3.5 w-3.5\" /> : \"Edit\"}\n </Button>\n </div>\n\n <Dialog\n open={isDialogOpen}\n onOpenChange={(open) => {\n if (!open) {\n setOpenRichTextDialogs((prev) => {\n const next = new Set(prev);\n next.delete(fieldPath);\n return next;\n });\n }\n }}\n >\n <DialogContent className=\"max-w-3xl max-h-[85vh] flex flex-col\">\n <DialogHeader>\n <DialogTitle>Edit {fieldSchema.title || fieldName}</DialogTitle>\n </DialogHeader>\n <div className=\"flex-1 overflow-hidden flex flex-col min-h-0\">\n {MarkdownEditor ? (\n <MarkdownEditor\n content={draftValue}\n onChange={(value) => {\n setRichTextDraftValues((prev) => ({ ...prev, [fieldPath]: value }));\n }}\n placeholder=\"Enter content... Use {{variables.name}} for dynamic values\"\n minHeight=\"300px\"\n variables={showVariablePicker ? matchingVars : []}\n />\n ) : (\n <>\n <Textarea\n value={draftValue}\n onChange={(e) => {\n setRichTextDraftValues((prev) => ({ ...prev, [fieldPath]: e.target.value }));\n }}\n rows={12}\n className=\"flex-1 text-sm font-mono resize-none\"\n placeholder=\"Enter content... Use {{variables.name}} for dynamic values\"\n />\n\n {/* Variable picker in dialog (fallback when no MarkdownEditor) */}\n {showVariablePicker && matchingVars.length > 0 && (\n <div className=\"border rounded-md p-2 bg-muted/30 mt-3\">\n <p className=\"text-xs font-medium mb-2\">Insert Variable:</p>\n <div className=\"flex flex-wrap gap-1\">\n {matchingVars.map((variable) => (\n <Button\n key={variable.path}\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-6 text-xs px-2\"\n onClick={() => {\n const varRef = `{{${variable.path}}}`;\n setRichTextDraftValues((prev) => ({\n ...prev,\n [fieldPath]: (prev[fieldPath] || \"\") + varRef,\n }));\n }}\n >\n {variable.title || variable.name}\n </Button>\n ))}\n </div>\n </div>\n )}\n </>\n )}\n </div>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => {\n setOpenRichTextDialogs((prev) => {\n const next = new Set(prev);\n next.delete(fieldPath);\n return next;\n });\n }}\n >\n Cancel\n </Button>\n <Button\n type=\"button\"\n onClick={() => {\n handleFieldChange(fieldName, draftValue);\n setOpenRichTextDialogs((prev) => {\n const next = new Set(prev);\n next.delete(fieldPath);\n return next;\n });\n }}\n >\n Save\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </div>\n );\n }\n\n // Multiline / textarea\n if (\n fieldSchema.format === \"multiline\" ||\n fieldSchema.format === \"textarea\"\n ) {\n const isVarValue = isVariableReference(fieldValue);\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <div className=\"flex items-center justify-between\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n {renderVariablePicker(fieldName, \"string\", fieldPath, (varPath) =>\n handleFieldChange(fieldName, (fieldValue || \"\") + varPath)\n )}\n </div>\n <Textarea\n value={fieldValue || \"\"}\n onChange={(e) => handleFieldChange(fieldName, e.target.value)}\n disabled={disabled}\n rows={3}\n className={cn(\"text-xs\", isVarValue && \"font-mono text-primary\")}\n placeholder={fieldSchema.description}\n />\n {fieldSchema.description && (\n <p className=\"text-[10px] text-muted-foreground\">\n {fieldSchema.description}\n </p>\n )}\n </div>\n );\n }\n\n // Regular string input\n const inputType =\n fieldSchema.format === \"email\"\n ? \"email\"\n : fieldSchema.format === \"uri\" || fieldSchema.format === \"url\"\n ? \"url\"\n : fieldSchema.format === \"password\"\n ? \"password\"\n : \"text\";\n\n const isVarValue = isVariableReference(fieldValue);\n\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <div className=\"flex gap-1.5\">\n <Input\n type={inputType}\n value={fieldValue || \"\"}\n onChange={(e) => handleFieldChange(fieldName, e.target.value)}\n disabled={disabled}\n className={cn(\"h-8 text-xs flex-1\", isVarValue && \"font-mono text-primary\")}\n placeholder={fieldSchema.description}\n />\n {renderVariablePicker(fieldName, \"string\", fieldPath, (varPath) =>\n handleFieldChange(fieldName, (fieldValue || \"\") + varPath)\n )}\n </div>\n {fieldSchema.description && (\n <p className=\"text-[10px] text-muted-foreground\">\n {fieldSchema.description}\n </p>\n )}\n </div>\n );\n }\n\n // Fallback for unknown types\n return (\n <div key={fieldPath} className=\"space-y-1.5\">\n <Label className=\"text-xs font-medium\">\n {fieldSchema.title || fieldName}\n {isRequired && <span className=\"text-red-500 ml-0.5\">*</span>}\n </Label>\n <Input\n value={\n typeof fieldValue === \"object\"\n ? JSON.stringify(fieldValue)\n : fieldValue || \"\"\n }\n onChange={(e) => {\n try {\n const parsed = JSON.parse(e.target.value);\n handleFieldChange(fieldName, parsed);\n } catch {\n handleFieldChange(fieldName, e.target.value);\n }\n }}\n disabled={disabled}\n className=\"h-8 text-xs font-mono\"\n />\n <p className=\"text-[10px] text-muted-foreground\">\n Type: {fieldSchema.type || \"unknown\"}\n </p>\n </div>\n );\n };\n\n // Render root object properties\n if (schema.type === \"object\" && schema.properties) {\n const sortedProperties = Object.entries(schema.properties).sort(\n ([, a], [, b]) => {\n const orderA = (a as any)[\"x-displayOrder\"] ?? 999;\n const orderB = (b as any)[\"x-displayOrder\"] ?? 999;\n return orderA - orderB;\n }\n );\n\n return (\n <div className=\"space-y-3\">\n {sortedProperties.map(([fieldName, fieldSchema]) =>\n renderField(fieldSchema as JSONSchema, fieldName, value[fieldName])\n )}\n </div>\n );\n }\n\n // If schema is not an object with properties, show message\n return (\n <p className=\"text-xs text-muted-foreground text-center py-4\">\n No configuration required for this node.\n </p>\n );\n}\n","\"use client\";\n\nimport { JSONSchema } from \"@elqnt/types\";\nimport { useState } from \"react\";\n\n// UI Components interface - same pattern as DynamicSchemaForm\nexport interface SchemaBuilderUIComponents {\n Input: React.ComponentType<{\n value: any;\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n disabled?: boolean;\n className?: string;\n placeholder?: string;\n }>;\n Label: React.ComponentType<{\n htmlFor?: string;\n className?: string;\n children: React.ReactNode;\n }>;\n Checkbox: React.ComponentType<{\n id?: string;\n checked: boolean;\n onCheckedChange: (checked: boolean) => void;\n disabled?: boolean;\n }>;\n Select: React.ComponentType<{\n value: string;\n onValueChange: (value: string) => void;\n disabled?: boolean;\n children: React.ReactNode;\n }>;\n SelectTrigger: React.ComponentType<{\n className?: string;\n children: React.ReactNode;\n }>;\n SelectValue: React.ComponentType<{\n placeholder?: string;\n }>;\n SelectContent: React.ComponentType<{\n children: React.ReactNode;\n }>;\n SelectItem: React.ComponentType<{\n value: string;\n className?: string;\n children: React.ReactNode;\n }>;\n Button: React.ComponentType<{\n type?: \"button\" | \"submit\" | \"reset\";\n variant?: string;\n size?: string;\n className?: string;\n onClick?: () => void;\n disabled?: boolean;\n children: React.ReactNode;\n }>;\n Card: React.ComponentType<{\n className?: string;\n children: React.ReactNode;\n }>;\n // Icons\n PlusIcon: React.ComponentType<{ className?: string }>;\n TrashIcon: React.ComponentType<{ className?: string }>;\n GripVerticalIcon: React.ComponentType<{ className?: string }>;\n ChevronDownIcon: React.ComponentType<{ className?: string }>;\n ChevronRightIcon: React.ComponentType<{ className?: string }>;\n // Utility\n cn: (...classes: (string | undefined | null | false)[]) => string;\n}\n\nexport interface SchemaBuilderProps {\n schema: JSONSchema;\n onChange: (schema: JSONSchema) => void;\n disabled?: boolean;\n components: SchemaBuilderUIComponents;\n}\n\ninterface FieldDefinition {\n name: string;\n type: string;\n title: string;\n description: string;\n required: boolean;\n format?: string;\n enum?: string[];\n items?: { type: string };\n}\n\nconst FIELD_TYPES = [\n { value: \"string\", label: \"Text\" },\n { value: \"number\", label: \"Number\" },\n { value: \"integer\", label: \"Integer\" },\n { value: \"boolean\", label: \"Boolean\" },\n { value: \"array\", label: \"Array\" },\n { value: \"object\", label: \"Object\" },\n];\n\nconst STRING_FORMATS = [\n { value: \"plain\", label: \"Plain Text\" },\n { value: \"email\", label: \"Email\" },\n { value: \"uri\", label: \"URL\" },\n { value: \"date\", label: \"Date\" },\n { value: \"date-time\", label: \"Date & Time\" },\n { value: \"multiline\", label: \"Multiline Text\" },\n];\n\nexport function SchemaBuilder({\n schema,\n onChange,\n disabled = false,\n components,\n}: SchemaBuilderProps) {\n const [expandedFields, setExpandedFields] = useState<Set<string>>(new Set());\n\n const {\n Input,\n Label,\n Checkbox,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Button,\n Card,\n PlusIcon,\n TrashIcon,\n GripVerticalIcon,\n ChevronDownIcon,\n ChevronRightIcon,\n } = components;\n\n // Convert schema to field definitions\n const getFieldsFromSchema = (): FieldDefinition[] => {\n if (!schema?.properties) return [];\n\n return Object.entries(schema.properties).map(([name, prop]) => {\n const fieldSchema = prop as JSONSchema;\n return {\n name,\n type: fieldSchema.type || \"string\",\n title: fieldSchema.title || name,\n description: fieldSchema.description || \"\",\n required: schema.required?.includes(name) || false,\n format: fieldSchema.format,\n enum: fieldSchema.enum,\n items: fieldSchema.items as { type: string } | undefined,\n };\n });\n };\n\n const fields = getFieldsFromSchema();\n\n // Convert field definitions back to schema\n const updateSchema = (newFields: FieldDefinition[]) => {\n const properties: Record<string, JSONSchema> = {};\n const required: string[] = [];\n\n newFields.forEach((field) => {\n if (!field.name) return;\n\n const fieldSchema: JSONSchema = {\n type: field.type,\n title: field.title || field.name,\n };\n\n if (field.description) {\n fieldSchema.description = field.description;\n }\n\n if (field.format && field.format !== \"plain\") {\n fieldSchema.format = field.format;\n }\n\n if (field.enum && field.enum.length > 0) {\n fieldSchema.enum = field.enum;\n }\n\n if (field.type === \"array\" && field.items) {\n fieldSchema.items = field.items;\n }\n\n properties[field.name] = fieldSchema;\n\n if (field.required) {\n required.push(field.name);\n }\n });\n\n onChange({\n type: \"object\",\n properties,\n required: required.length > 0 ? required : undefined,\n });\n };\n\n const addField = () => {\n const newFieldName = `field_${fields.length + 1}`;\n const newFields: FieldDefinition[] = [\n ...fields,\n {\n name: newFieldName,\n type: \"string\",\n title: \"\",\n description: \"\",\n required: false,\n },\n ];\n updateSchema(newFields);\n setExpandedFields((prev) => new Set([...prev, newFieldName]));\n };\n\n const updateField = (index: number, updates: Partial<FieldDefinition>) => {\n const newFields = [...fields];\n newFields[index] = { ...newFields[index], ...updates };\n updateSchema(newFields);\n };\n\n const removeField = (index: number) => {\n const newFields = fields.filter((_, i) => i !== index);\n updateSchema(newFields);\n };\n\n const toggleExpand = (name: string) => {\n setExpandedFields((prev) => {\n const next = new Set(prev);\n if (next.has(name)) {\n next.delete(name);\n } else {\n next.add(name);\n }\n return next;\n });\n };\n\n return (\n <div className=\"space-y-2\">\n {fields.length === 0 ? (\n <p className=\"text-xs text-muted-foreground italic py-3\">\n No fields defined. Click "Add Field" to create one.\n </p>\n ) : (\n <div className=\"space-y-3\">\n {fields.map((field, index) => {\n const isExpanded = expandedFields.has(field.name);\n return (\n <Card key={index} className=\"p-3 bg-gray-50/50\">\n {/* Field Header Row 1: Name and Delete */}\n <div className=\"flex items-center gap-2 mb-2\">\n <GripVerticalIcon className=\"h-4 w-4 text-gray-300 flex-shrink-0 cursor-grab\" />\n\n <button\n type=\"button\"\n onClick={() => toggleExpand(field.name)}\n className=\"flex-shrink-0 p-1 hover:bg-gray-200 rounded\"\n >\n {isExpanded ? (\n <ChevronDownIcon className=\"h-4 w-4 text-gray-500\" />\n ) : (\n <ChevronRightIcon className=\"h-4 w-4 text-gray-500\" />\n )}\n </button>\n\n {/* Field Name */}\n <div className=\"flex-1\">\n <Input\n value={field.name}\n onChange={(e) => {\n const oldName = field.name;\n const newName = e.target.value\n .toLowerCase()\n .replace(/\\s+/g, \"_\")\n .replace(/[^a-z0-9_]/g, \"\");\n updateField(index, { name: newName });\n if (expandedFields.has(oldName)) {\n setExpandedFields((prev) => {\n const next = new Set(prev);\n next.delete(oldName);\n next.add(newName);\n return next;\n });\n }\n }}\n placeholder=\"field_name\"\n className=\"h-9 text-sm font-mono\"\n disabled={disabled}\n />\n </div>\n\n {/* Delete button */}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-9 w-9 p-0 text-red-500 hover:text-red-700 hover:bg-red-50 flex-shrink-0\"\n onClick={() => removeField(index)}\n disabled={disabled}\n >\n <TrashIcon className=\"h-4 w-4\" />\n </Button>\n </div>\n\n {/* Field Header Row 2: Type and Required */}\n <div className=\"flex items-center gap-3 pl-10\">\n {/* Field Type */}\n <div className=\"flex-1\">\n <Select\n value={field.type}\n onValueChange={(v) => updateField(index, { type: v })}\n disabled={disabled}\n >\n <SelectTrigger className=\"h-9 text-sm\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {FIELD_TYPES.map((type) => (\n <SelectItem key={type.value} value={type.value}>\n {type.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n {/* Required checkbox */}\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <Checkbox\n id={`required-${index}`}\n checked={field.required}\n onCheckedChange={(checked) =>\n updateField(index, { required: !!checked })\n }\n disabled={disabled}\n />\n <Label\n htmlFor={`required-${index}`}\n className=\"text-sm text-muted-foreground\"\n >\n Required\n </Label>\n </div>\n </div>\n\n {/* Expanded Details */}\n {isExpanded && (\n <div className=\"mt-3 pt-3 border-t space-y-3 pl-10\">\n {/* Title */}\n <div className=\"space-y-1\">\n <Label className=\"text-xs text-muted-foreground\">\n Display Title\n </Label>\n <Input\n value={field.title}\n onChange={(e) =>\n updateField(index, { title: e.target.value })\n }\n placeholder=\"Human readable title\"\n className=\"h-9 text-sm\"\n disabled={disabled}\n />\n </div>\n\n {/* Description */}\n <div className=\"space-y-1\">\n <Label className=\"text-xs text-muted-foreground\">\n Description\n </Label>\n <Input\n value={field.description}\n onChange={(e) =>\n updateField(index, { description: e.target.value })\n }\n placeholder=\"Help text for this field\"\n className=\"h-9 text-sm\"\n disabled={disabled}\n />\n </div>\n\n {/* String Format */}\n {field.type === \"string\" && (\n <div className=\"space-y-1\">\n <Label className=\"text-xs text-muted-foreground\">\n Format\n </Label>\n <Select\n value={field.format || \"plain\"}\n onValueChange={(v) =>\n updateField(index, { format: v })\n }\n disabled={disabled}\n >\n <SelectTrigger className=\"h-9 text-sm\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {STRING_FORMATS.map((format) => (\n <SelectItem key={format.value} value={format.value}>\n {format.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n {/* Array Item Type */}\n {field.type === \"array\" && (\n <div className=\"space-y-1\">\n <Label className=\"text-xs text-muted-foreground\">\n Item Type\n </Label>\n <Select\n value={field.items?.type || \"string\"}\n onValueChange={(v) =>\n updateField(index, { items: { type: v } })\n }\n disabled={disabled}\n >\n <SelectTrigger className=\"h-9 text-sm\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {FIELD_TYPES.filter((t) => t.value !== \"array\").map(\n (type) => (\n <SelectItem key={type.value} value={type.value}>\n {type.label}\n </SelectItem>\n )\n )}\n </SelectContent>\n </Select>\n </div>\n )}\n\n {/* Enum Options (for dropdowns) */}\n {field.type === \"string\" && (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between\">\n <Label className=\"text-xs text-muted-foreground\">\n Dropdown Options (optional)\n </Label>\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"h-7 text-xs\"\n onClick={() => {\n const currentEnum = field.enum || [];\n updateField(index, {\n enum: [\n ...currentEnum,\n `option_${currentEnum.length + 1}`,\n ],\n });\n }}\n disabled={disabled}\n >\n <PlusIcon className=\"h-3 w-3 mr-1\" />\n Add Option\n </Button>\n </div>\n {field.enum && field.enum.length > 0 && (\n <div className=\"space-y-2\">\n {field.enum.map((option, optIdx) => (\n <div key={optIdx} className=\"flex items-center gap-2\">\n <Input\n value={option}\n onChange={(e) => {\n const newEnum = [...(field.enum || [])];\n newEnum[optIdx] = e.target.value;\n updateField(index, { enum: newEnum });\n }}\n placeholder={`Option ${optIdx + 1}`}\n className=\"h-8 text-sm flex-1\"\n disabled={disabled}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"h-8 w-8 p-0 text-red-400 hover:text-red-600\"\n onClick={() => {\n const newEnum = (field.enum || []).filter(\n (_, i) => i !== optIdx\n );\n updateField(index, {\n enum:\n newEnum.length > 0 ? newEnum : undefined,\n });\n }}\n disabled={disabled}\n >\n <TrashIcon className=\"h-3 w-3\" />\n </Button>\n </div>\n ))}\n </div>\n )}\n </div>\n )}\n </div>\n )}\n </Card>\n );\n })}\n </div>\n )}\n\n {/* Add Field Button */}\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n className=\"w-full h-9 text-sm\"\n onClick={addField}\n disabled={disabled}\n >\n <PlusIcon className=\"h-4 w-4 mr-2\" />\n Add Field\n </Button>\n </div>\n );\n}\n"],"mappings":";AAGA,SAAS,gBAAyB;AAuQtB,SAyYQ,UAzYR,KAIF,YAJE;AAzIL,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,QAAQ,CAAC;AAAA,EACT;AAAA,EACA,WAAW;AAAA,EACX,OAAO,CAAC;AAAA,EACR;AAAA,EACA,YAAY,CAAC;AAAA,EACb,qBAAqB;AACvB,GAA2B;AACzB,QAAM,CAAC,mBAAmB,oBAAoB,IAAI;AAAA,IAChD,oBAAI,IAAI;AAAA,EACV;AACA,QAAM,CAAC,qBAAqB,sBAAsB,IAAI;AAAA,IACpD,oBAAI,IAAI;AAAA,EACV;AACA,QAAM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AEvC;AAAA,KACF;AAEJ;","names":["value","isVarValue","useState","jsx","jsxs"]}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
// models/workflow.ts
|
|
4
2
|
var NodeTypeTrigger = "trigger";
|
|
5
3
|
var NodeTypeHumanAction = "humanAction";
|
|
@@ -304,4 +302,4 @@ export {
|
|
|
304
302
|
WorkflowExecutionCompleted,
|
|
305
303
|
WorkflowExecutionFailed
|
|
306
304
|
};
|
|
307
|
-
//# sourceMappingURL=chunk-
|
|
305
|
+
//# sourceMappingURL=chunk-IY5JCMLA.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../models/workflow.ts","../models/subjects.ts"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\nimport { EntityFilterOperatorTS } from \"@elqnt/entity\";\nimport { JSONSchema, ResponseMetadata } from \"@elqnt/types\";\nimport { NodeSubTypeTS, WorkflowTypeTS, WorkflowNodeTypeTS, WorkflowNodeSubTypeTS, WorkflowEdgeTypeTS } from \"../schema/schemas\";\n\n//////////\n// source: constants.go\n\n/**\n * NodeType represents the primary type of a workflow node\n */\nexport type NodeType = string;\nexport const NodeTypeTrigger: NodeType = \"trigger\";\nexport const NodeTypeHumanAction: NodeType = \"humanAction\";\nexport const NodeTypeAgent: NodeType = \"agent\";\nexport const NodeTypeAction: NodeType = \"action\";\nexport const NodeTypeLogic: NodeType = \"logic\";\nexport const NodeTypeLoop: NodeType = \"loop\";\nexport const NodeTypeParallel: NodeType = \"parallel\";\nexport const NodeTypeDelay: NodeType = \"delay\";\nexport const NodeTypeData: NodeType = \"data\";\nexport const NodeTypeIntegration: NodeType = \"integration\";\nexport const NodeTypeTimer: NodeType = \"timer\";\nexport const NodeTypeSubflow: NodeType = \"subflow\";\nexport const NodeTypeCustom: NodeType = \"custom\";\nexport const NodeTypeAccounting: NodeType = \"accounting\";\nexport const NodeTypeDocumentExtraction: NodeType = \"documentExtraction\";\n/**\n * NodeSubType represents the subtype of a workflow node\n * All node subtypes are unified under this single type\n */\nexport type NodeSubType = string;\n/**\n * Trigger subtypes\n */\nexport const NodeSubTypeTriggerStart: NodeSubType = \"triggerStart\";\nexport const NodeSubTypeTriggerEntityRecordCreated: NodeSubType = \"triggerEntityRecordCreated\";\nexport const NodeSubTypeTriggerEntityRecordUpdated: NodeSubType = \"triggerEntityRecordUpdated\";\nexport const NodeSubTypeTriggerEntityRecordDeleted: NodeSubType = \"triggerEntityRecordDeleted\";\nexport const NodeSubTypeTriggerSLAWarning: NodeSubType = \"triggerSLAWarning\";\nexport const NodeSubTypeTriggerSLABreach: NodeSubType = \"triggerSLABreach\";\nexport const NodeSubTypeTriggerEscalation: NodeSubType = \"triggerEscalation\";\nexport const NodeSubTypeTriggerWebhookReceived: NodeSubType = \"triggerWebhookReceived\";\n/**\n * Human action subtypes\n */\nexport const NodeSubTypeHumanActionReview: NodeSubType = \"humanActionReview\"; // review means will be able to edit the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionApproval: NodeSubType = \"humanActionApproval\"; // approval means will be able to edit the fields and move to next node (with approval)\nexport const NodeSubTypeHumanActionDataEntry: NodeSubType = \"humanActionDataEntry\"; // data entry means will be able to fill the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionAssignment: NodeSubType = \"humanActionAssignment\"; // assignment means will be able to only assign the task to a user (no approval)\n/**\n * Agent subtypes\n */\nexport const NodeSubTypeAgentChat: NodeSubType = \"agentChat\";\nexport const NodeSubTypeAgentIntentDetector: NodeSubType = \"agentIntentDetector\";\nexport const NodeSubTypeAgentKnowledgeGraph: NodeSubType = \"agentKnowledgeGraph\";\nexport const NodeSubTypeAgentClientApiCall: NodeSubType = \"clientApiCall\";\nexport const NodeSubTypeAgentTransferToHuman: NodeSubType = \"agentTransferToHuman\";\nexport const NodeSubTypeAgentOpenTicket: NodeSubType = \"agentOpenTicket\";\nexport const NodeSubTypeAgentApiIntegration: NodeSubType = \"agentApiIntegration\";\nexport const NodeSubTypeAgentCustomResponse: NodeSubType = \"agentCustomResponse\";\nexport const NodeSubTypeAgentStructuredOutput: NodeSubType = \"agentStructuredOutput\"; // Generic structured output using OpenAI with dynamic input/output schemas\n/**\n * Action subtypes\n */\nexport const NodeSubTypeActionApiCall: NodeSubType = \"actionApiCall\";\nexport const NodeSubTypeActionDocumentExtraction: NodeSubType = \"actionDocumentExtraction\";\nexport const NodeSubTypeActionSendEmail: NodeSubType = \"actionSendEmail\";\nexport const NodeSubTypeActionSendSMS: NodeSubType = \"actionSendSMS\";\nexport const NodeSubTypeActionGenerateDocument: NodeSubType = \"actionGenerateDocument\";\nexport const NodeSubTypeActionProcessPayment: NodeSubType = \"actionProcessPayment\";\nexport const NodeSubTypeActionCreateEntityRecord: NodeSubType = \"actionCreateEntityRecord\";\nexport const NodeSubTypeActionUpdateEntityRecord: NodeSubType = \"actionUpdateEntityRecord\";\nexport const NodeSubTypeActionDeleteEntityRecord: NodeSubType = \"actionDeleteEntityRecord\";\nexport const NodeSubTypeActionMergeEntityRecords: NodeSubType = \"actionMergeEntityRecords\";\nexport const NodeSubTypeActionAssignSLAPolicy: NodeSubType = \"actionAssignSLAPolicy\";\nexport const NodeSubTypeActionChangeSLAStatus: NodeSubType = \"actionChangeSLAAssignmentStatus\";\nexport const NodeSubTypeActionEscalateSLA: NodeSubType = \"actionEscalateSLAAssignment\";\nexport const NodeSubTypeActionCSATSurvey: NodeSubType = \"actionCSATSurvey\";\nexport const NodeSubTypeActionSetVariables: NodeSubType = \"actionSetVariables\"; // Passthrough node that sets variables from config values\nexport const NodeSubTypeActionQueryEntityRecords: NodeSubType = \"actionQueryEntityRecords\"; // Query entity records with filters\nexport const NodeSubTypeActionNatsRequest: NodeSubType = \"actionNatsRequest\"; // Execute a NATS request-reply call\n/**\n * Logic subtypes\n */\nexport const NodeSubTypeLogicIf: NodeSubType = \"logicIf\";\nexport const NodeSubTypeLogicSwitch: NodeSubType = \"logicSwitch\";\nexport const NodeSubTypeLogicFor: NodeSubType = \"logicFor\";\nexport const NodeSubTypeLogicParallel: NodeSubType = \"logicParallel\";\n/**\n * Loop subtypes\n */\nexport const NodeSubTypeLoopData: NodeSubType = \"loopData\";\n/**\n * Delay subtypes\n */\nexport const NodeSubTypeDelay: NodeSubType = \"delay\";\n/**\n * Data subtypes\n */\nexport const NodeSubTypeDataFilter: NodeSubType = \"dataFilter\";\nexport const NodeSubTypeDataMap: NodeSubType = \"dataMap\";\nexport const NodeSubTypeDataCalculate: NodeSubType = \"dataCalculate\";\nexport const NodeSubTypeDataValidate: NodeSubType = \"dataValidate\";\n/**\n * Timer subtypes\n */\nexport const NodeSubTypeTimerDelay: NodeSubType = \"timerDelay\";\nexport const NodeSubTypeTimerSchedule: NodeSubType = \"timerSchedule\";\nexport const NodeSubTypeTimerBusinessHours: NodeSubType = \"timerBusinessHours\";\n/**\n * ExpressionType defines the type of expression evaluation to be used\n */\nexport type ExpressionType = string;\n/**\n * Simple filter-based expressions using predefined operators\n */\nexport const ExpressionTypeFilter: ExpressionType = \"filter\";\n/**\n * JavaScript-like expressions with full language features\n */\nexport const ExpressionTypeJavaScript: ExpressionType = \"javascript\";\n/**\n * Template expressions with variable interpolation\n */\nexport const ExpressionTypeTemplate: ExpressionType = \"template\";\n/**\n * Custom domain-specific language expressions\n */\nexport const ExpressionTypeDSL: ExpressionType = \"dsl\";\n/**\n * Complex rule-based expressions (e.g., business rules)\n */\nexport const ExpressionTypeRules: ExpressionType = \"rules\";\n/**\n * EdgeType defines the type and behavior of workflow edges\n */\nexport type EdgeType = string;\n/**\n * Standard flow between nodes\n */\nexport const EdgeTypeNormal: EdgeType = \"normal\";\n/**\n * Loop back to previous node\n */\nexport const EdgeTypeLoopBack: EdgeType = \"loopBack\";\n/**\n * Error handling path\n */\nexport const EdgeTypeError: EdgeType = \"error\";\n/**\n * Fallback/default path when no other conditions match\n */\nexport const EdgeTypeDefault: EdgeType = \"default\";\n/**\n * Path for parallel execution branch\n */\nexport const EdgeTypeParallel: EdgeType = \"parallel\";\n/**\n * Path for conditional branching\n */\nexport const EdgeTypeConditional: EdgeType = \"conditional\";\n/**\n * Path for merging parallel branches\n */\nexport const EdgeTypeMerge: EdgeType = \"merge\";\n/**\n * Compensating/rollback path\n */\nexport const EdgeTypeCompensation: EdgeType = \"compensation\";\n/**\n * Path for timeout/deadline handling\n */\nexport const EdgeTypeTimeout: EdgeType = \"timeout\";\nexport type WorkflowType = string;\nexport const WorkflowTypeEntity: WorkflowType = \"entity\";\nexport const WorkflowTypeDocument: WorkflowType = \"document\";\nexport const WorkflowTypeChat: WorkflowType = \"chat\";\nexport const WorkflowTypeAgent: WorkflowType = \"agent\";\nexport const WorkflowTypeProductivity: WorkflowType = \"productivity\";\n\n//////////\n// source: node-definitions.go\n\n/**\n * NodeDefinition is the design-time template for creating WorkflowNode instances.\n * This is the single source of truth for all node types in the workflow system.\n * Generated to TypeScript via schema-generator for use in the workflow designer UI.\n */\nexport interface NodeDefinition {\n type: NodeType;\n subType: NodeSubTypeTS;\n label: string;\n icon: string;\n description: string;\n category: string;\n config: JSONSchema;\n input: JSONSchema;\n output: JSONSchema;\n}\n/**\n * EdgeTypeDefinition defines metadata for an edge type\n */\nexport interface EdgeTypeDefinition {\n value: string;\n label: string;\n}\n/**\n * WorkflowTypeDefinition defines metadata for a workflow type\n */\nexport interface WorkflowTypeDefinition {\n value: string;\n label: string;\n}\n\n//////////\n// source: workflow-helper-models.go\n\nexport interface LogicPath {\n id: string;\n nodeId: string;\n condition: string; // \"true\"/\"false\" for if, value for switch\n priority: number /* int */; // For ordering multiple possible paths\n}\nexport interface Intent {\n id: string;\n nodeId: string;\n name: string;\n description: string;\n}\n\n//////////\n// source: workflows-base-models.go\n\nexport interface Metadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n}\nexport interface CreateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface UpdateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface WorkflowDefinitionResponse {\n definition: WorkflowDefinition;\n metadata: ResponseMetadata;\n}\nexport interface GetWorkflowDefinitionRequest {\n id?: string /* uuid */; // Lookup by ID\n name?: string; // Or lookup by name (normalized: lowercase, dashes)\n title?: string; // Or lookup by title (deprecated, use name)\n type?: string; // Optional: filter by type when looking up by name/title\n orgId: string;\n}\n/**\n * GetWorkflowDefinitionByTitleRequest is used for the legacy workflow.definition.get.by.title endpoint\n * Kept for backward compatibility - prefer using GetWorkflowDefinitionRequest with Name field\n */\nexport interface GetWorkflowDefinitionByTitleRequest {\n title: string;\n name?: string; // Preferred over Title\n type?: string; // Optional: filter by type\n orgId: string;\n}\nexport interface ListWorkflowDefinitionsRequest {\n orgId: string;\n status?: string; // Optional: active, inactive, etc\n}\nexport interface ListWorkflowDefinitionsResponse {\n definitions: WorkflowDefinition[];\n metadata: ResponseMetadata;\n}\nexport interface DeleteWorkflowDefinitionRequest {\n id: string;\n orgId: string;\n}\n/**\n * Workflow Definition models\n */\nexport interface WorkflowDefinition {\n /**\n * Core Identity\n */\n id?: string /* uuid */;\n name: string; // Normalized name: lowercase, spaces replaced with dashes (auto-generated from Title)\n title: string;\n description: string;\n type: WorkflowTypeTS; // entity, chat, document, etc.\n /**\n * Graph Structure\n */\n nodes: { [key: string]: WorkflowNode};\n edges: WorkflowEdge[];\n entryPoints: string[]; // List of start node IDs, currently only one\n /**\n * Data Management\n */\n variables: WorkflowVariables;\n constants?: { [key: string]: any};\n /**\n * Runtime Configuration\n */\n persistence?: PersistenceType;\n /**\n * Validation and Constraints\n */\n rules?: WorkflowRule[];\n permissions: WorkflowPermissions;\n /**\n * Metadata and Tracking\n */\n metadata: WorkflowMetadata;\n}\nexport interface WorkflowVariables {\n schema: JSONSchema;\n scope: { [key: string]: string}; // Variable visibility\n defaultValues: { [key: string]: any}; // Default values\n computed: { [key: string]: string}; // Expressions for computed variables\n}\nexport interface WorkflowRule {\n name: string;\n description: string;\n condition: string; // Expression\n action: string; // What to do if condition is met\n level: RuleLevel; // error, warning, info\n}\nexport type RuleLevel = string;\nexport const RuleLevelError: RuleLevel = \"error\";\nexport const RuleLevelWarning: RuleLevel = \"warning\";\nexport const RuleLevelInfo: RuleLevel = \"info\";\nexport interface WorkflowPermissions {\n roles: { [key: string]: string[]}; // Role-based permissions\n accessLevel: string; // public, private, restricted\n editableBy: string[]; // User/Role IDs\n viewableBy: string[]; // User/Role IDs\n}\nexport interface WorkflowMetadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n tags?: string[];\n category?: string;\n labels?: string[];\n}\nexport type PersistenceType = string;\nexport const PersistenceTypeEphemeral: PersistenceType = \"ephemeral\";\nexport const PersistenceTypePermanent: PersistenceType = \"permanent\";\n/**\n * todo: validate default values against schema\n */\nexport interface NodeInput {\n schema: JSONSchema;\n defaultValues?: { [key: string]: any};\n}\nexport interface NodeOutput {\n schema: JSONSchema;\n /**\n * Mapping map[string]string `json:\"mapping,omitempty\"`\n */\n values?: { [key: string]: any};\n}\nexport interface NodeConfig {\n schema: JSONSchema; // config schema, the ui must validate against this\n values: { [key: string]: any}; // actual config values\n promoteToVariables?: string[]; // output fields to promote to workflow-level variables\n}\nexport interface WorkflowNode {\n id: string;\n title: string;\n name: string; // ** normalized function name, for example: find_products **\n label?: string;\n description?: string;\n type: WorkflowNodeTypeTS;\n subType?: WorkflowNodeSubTypeTS;\n config: NodeConfig;\n settings: NodeSettings;\n input: NodeInput;\n output: NodeOutput;\n isStart: boolean;\n}\n/**\n * NodeSettings contains type-specific configuration\n */\nexport interface NodeSettings {\n /**\n * Shared configs\n */\n execution?: ExecutionConfig;\n retry?: RetryConfig;\n}\nexport interface ExecutionConfig {\n timeoutSeconds: number /* int */;\n priority: number /* int */;\n subject?: string;\n}\nexport interface RetryConfig {\n maxAttempts: number /* int */;\n initialDelay: any /* time.Duration */;\n maxDelay: any /* time.Duration */;\n backoffMultiplier: number /* float64 */;\n}\n/**\n * CacheConfig defines caching behavior for expression results\n */\nexport interface CacheConfig {\n enabled: boolean;\n ttl: any /* time.Duration */; // How long to cache\n key?: string; // Custom cache key\n tags?: string[];\n}\nexport interface ExpressionConfig {\n type: ExpressionType;\n expression: string;\n variables?: string[]; // Referenced variables\n timeout?: any /* time.Duration */; // Evaluation timeout\n cache?: CacheConfig; // Expression result caching\n}\n/**\n * Example usage in full edge structure\n */\nexport interface WorkflowEdge {\n id: string;\n fromNodeId: string;\n toNodeId: string;\n type: WorkflowEdgeTypeTS;\n label?: string;\n expression?: ExpressionConfig;\n priority: number /* int */;\n retry?: RetryConfig;\n timeout?: TimeoutConfig;\n properties?: { [key: string]: string};\n}\n/**\n * TimeoutConfig defines timeout behavior for nodes and edges\n */\nexport interface TimeoutConfig {\n duration: any /* time.Duration */; // How long to wait\n action: TimeoutAction; // What to do on timeout\n retryPolicy?: RetryConfig; // Optional retry on timeout\n}\nexport type TimeoutAction = string;\nexport const TimeoutActionFail: TimeoutAction = \"fail\"; // Mark as failed\nexport const TimeoutActionSkip: TimeoutAction = \"skip\"; // Skip and continue\nexport const TimeoutActionRetry: TimeoutAction = \"retry\"; // Attempt retry\nexport const TimeoutActionAlt: TimeoutAction = \"alt\"; // Take alternate path\nexport interface CreateWorkflowInstanceRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variables: { [key: string]: any};\n autoExecute: boolean;\n}\nexport interface WorkflowInstanceResponse {\n instance?: WorkflowInstance;\n metadata: ResponseMetadata;\n}\nexport interface WorkflowInstanceExecuteNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n input: { [key: string]: any};\n}\nexport interface WorkflowInstanceResumeNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n result: { [key: string]: any};\n}\nexport interface WorkflowInstanceExecuteNodeLeanRequest {\n orgId: string;\n nodeDef: WorkflowNode;\n input: { [key: string]: any};\n}\nexport interface UpdateInstanceNodeMetadataRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n metadataKey: string;\n payload: any;\n}\nexport interface GetWorkflowInstanceRequest {\n orgId: string;\n instanceId: string /* uuid */;\n}\n/**\n * GetInstanceByStateVariableRequest finds an instance by a variable stored in state.variables\n */\nexport interface GetInstanceByStateVariableRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variableKey: string; // e.g., \"orgId\"\n variableValue: string; // e.g., \"019bf2bf-e713-7936-8a4d-daeb67742a4d\"\n}\nexport interface ListWorkflowInstancesRequest {\n orgId: string;\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status?: string; // Optional: filter by instance status\n}\nexport interface ListWorkflowInstancesResponse {\n instances: WorkflowInstance[];\n metadata: ResponseMetadata;\n}\nexport interface UpdateInstanceStatusRequest {\n orgId: string;\n instanceId: string /* uuid */;\n status: InstanceStatus;\n}\nexport interface RetryNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n}\nexport interface ListInstancesOptions {\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status: InstanceStatus;\n limit: number /* int */;\n offset: number /* int */;\n}\nexport interface InstanceState {\n variables: { [key: string]: any};\n constants: { [key: string]: any};\n nodeStates: { [key: string]: NodeState};\n edgeStates: { [key: string]: EdgeState};\n}\nexport interface ExecutionContext {\n currentNodes: string[];\n path: ExecutionPathEntry[];\n errors: ExecutionError[];\n}\n/**\n * Workflow Instance models\n */\nexport interface WorkflowInstance {\n id?: string /* uuid */;\n orgId?: string /* uuid */;\n definitionId: string /* uuid */;\n definitionName?: string; // Normalized name from definition (lowercase, dashes)\n title?: string;\n description?: string;\n type?: WorkflowType;\n definitionVersion: number /* int */;\n status: InstanceStatus;\n state: InstanceState;\n context: ExecutionContext;\n persistence?: PersistenceType;\n metadata: WorkflowMetadata;\n}\nexport interface NodeState {\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n /**\n * Variables map[string]interface{} `json:\"variables,omitempty\"`\n */\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport interface EdgeState {\n status: EdgeStatus;\n timestamp: string /* RFC3339 */;\n error?: string;\n}\nexport interface ExecutionPathEntry {\n nodeId: string;\n edgeId: string;\n type: string; // node_enter, node_exit, edge_traverse\n timestamp: string /* RFC3339 */;\n data?: { [key: string]: any};\n}\nexport interface ExecutionError {\n nodeId?: string;\n edgeId?: string;\n error: string;\n timestamp: string /* RFC3339 */;\n retryable: boolean;\n}\nexport type InstanceStatus = string;\nexport const InstanceStatusNew: InstanceStatus = \"NEW\";\nexport const InstanceStatusRunning: InstanceStatus = \"RUNNING\";\nexport const InstanceStatusWaiting: InstanceStatus = \"WAITING\";\nexport const InstanceStatusPaused: InstanceStatus = \"PAUSED\";\nexport const InstanceStatusCompleted: InstanceStatus = \"COMPLETED\";\nexport const InstanceStatusFailed: InstanceStatus = \"FAILED\";\nexport interface NodeInstance {\n nodeId: string;\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport type NodeStatus = string;\nexport const NodeStatusPending: NodeStatus = \"PENDING\";\nexport const NodeStatusRunning: NodeStatus = \"RUNNING\";\nexport const NodeStatusCompleted: NodeStatus = \"COMPLETED\";\nexport const NodeStatusFailed: NodeStatus = \"FAILED\";\nexport const NodeStatusWaiting: NodeStatus = \"WAITING\";\nexport const NodeStatusSkipped: NodeStatus = \"SKIPPED\";\nexport type EdgeStatus = string;\nexport const EdgeStatusPending: EdgeStatus = \"PENDING\";\nexport const EdgeStatusCompleted: EdgeStatus = \"COMPLETED\";\nexport const EdgeStatusSkipped: EdgeStatus = \"SKIPPED\";\n/**\n * WorkflowDefinitionInfo holds summarized info about an active workflow definition\n * Used by schedulers and services that need to process workflows without full definition details\n */\nexport interface WorkflowDefinitionInfo {\n id: string; // Workflow definition ID\n orgId: string; // Organization ID\n title: string;\n type: string; // e.g., \"productivity\", \"entity\"\n category: string; // e.g., \"email\" (from metadata)\n isActive: boolean;\n createdBy: string; // User who created this workflow\n /**\n * User config from definition.variables.defaultValues (workflow-specific)\n */\n provider?: string; // e.g., \"google\" or \"microsoft\" for email workflows\n userEmail?: string; // User's email address\n userId?: string; // User ID who owns this workflow\n}\n","// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: subjects.go\n\nexport const WorkflowDefinitionCreate = \"workflow.definition.create\";\nexport const WorkflowDefinitionCreated = \"workflow.definition.created\";\nexport const WorkflowDefinitionUpdate = \"workflow.definition.update\";\nexport const WorkflowDefinitionUpdated = \"workflow.definition.updated\";\nexport const WorkflowDefinitionGet = \"workflow.definition.get\";\nexport const WorkflowDefinitionGetServer = \"workflow.definition.get.server\";\nexport const WorkflowDefinitionGetByTitle = \"workflow.definition.get.by.title\";\nexport const WorkflowDefinitionList = \"workflow.definition.list\";\nexport const WorkflowDefinitionDelete = \"workflow.definition.delete\";\nexport const WorkflowDefinitionDeleted = \"workflow.definition.deleted\";\nexport const WorkflowInstanceCreate = \"workflow.instance.create\";\nexport const WorkflowInstanceExecuteNode = \"workflow.instance.execute.node\";\nexport const WorkflowInstanceResumeNode = \"workflow.instance.resume.node\";\nexport const WorkflowInstanceExecuteNodeServer = \"workflow.instance.execute.node.server\";\nexport const WorkflowInstanceResumeNodeServer = \"workflow.instance.resume.node.server\";\nexport const WorkflowInstanceExecuteNodeLean = \"workflow.instance.execute.node.lean\";\nexport const WorkflowInstanceExecuteNodeLeanServer = \"workflow.instance.execute.node.lean.server\";\nexport const WorkflowInstanceGet = \"workflow.instance.get\";\nexport const WorkflowInstanceGetByStateVariable = \"workflow.instance.get.by.state.variable\";\nexport const WorkflowInstanceList = \"workflow.instance.list\";\nexport const WorkflowInstanceUpdate = \"workflow.instance.update\";\nexport const WorkflowInstanceUpdated = \"workflow.instance.updated\";\nexport const WorkflowInstanceUpdateNodeMetadata = \"workflow.instance.update.node.metadata\";\n/**\n * Template management\n */\nexport const WorkflowTemplateList = \"workflow.template.list\";\nexport const WorkflowTemplateGet = \"workflow.template.get\";\nexport const WorkflowTemplateInstantiate = \"workflow.template.instantiate\";\n/**\n * Schedule management\n */\nexport const WorkflowScheduleCreate = \"workflow.schedule.create\";\nexport const WorkflowScheduleUpdate = \"workflow.schedule.update\";\nexport const WorkflowScheduleDelete = \"workflow.schedule.delete\";\nexport const WorkflowScheduleList = \"workflow.schedule.list\";\nexport const WorkflowSchedulePause = \"workflow.schedule.pause\";\nexport const WorkflowScheduleResume = \"workflow.schedule.resume\";\n/**\n * Trigger management\n */\nexport const WorkflowTriggerRegister = \"workflow.trigger.register\";\nexport const WorkflowTriggerPause = \"workflow.trigger.pause\";\nexport const WorkflowTriggerResume = \"workflow.trigger.resume\";\nexport const WorkflowTriggerStatus = \"workflow.trigger.status\";\nexport const WorkflowTriggerFired = \"workflow.trigger.fired\";\n/**\n * Execution events\n */\nexport const WorkflowExecutionStarted = \"workflow.execution.started\";\nexport const WorkflowExecutionCompleted = \"workflow.execution.completed\";\nexport const WorkflowExecutionFailed = \"workflow.execution.failed\";\n"],"mappings":";;;AAYO,IAAM,kBAA4B;AAClC,IAAM,sBAAgC;AACtC,IAAM,gBAA0B;AAChC,IAAM,iBAA2B;AACjC,IAAM,gBAA0B;AAChC,IAAM,eAAyB;AAC/B,IAAM,mBAA6B;AACnC,IAAM,gBAA0B;AAChC,IAAM,eAAyB;AAC/B,IAAM,sBAAgC;AACtC,IAAM,gBAA0B;AAChC,IAAM,kBAA4B;AAClC,IAAM,iBAA2B;AACjC,IAAM,qBAA+B;AACrC,IAAM,6BAAuC;AAS7C,IAAM,0BAAuC;AAC7C,IAAM,wCAAqD;AAC3D,IAAM,wCAAqD;AAC3D,IAAM,wCA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AAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,uBAAuB;AAC7B,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;AAI/B,IAAM,0BAA0B;AAChC,IAAM,uBAAuB;AAC7B,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAC9B,IAAM,uBAAuB;AAI7B,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,0BAA0B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../models/workflow.ts","../models/subjects.ts"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\nimport { EntityFilterOperatorTS } from \"@elqnt/entity\";\nimport { JSONSchema, ResponseMetadata } from \"@elqnt/types\";\nimport { NodeSubTypeTS, WorkflowTypeTS, WorkflowNodeTypeTS, WorkflowNodeSubTypeTS, WorkflowEdgeTypeTS } from \"../schema/schemas\";\n\n//////////\n// source: constants.go\n\n/**\n * NodeType represents the primary type of a workflow node\n */\nexport type NodeType = string;\nexport const NodeTypeTrigger: NodeType = \"trigger\";\nexport const NodeTypeHumanAction: NodeType = \"humanAction\";\nexport const NodeTypeAgent: NodeType = \"agent\";\nexport const NodeTypeAction: NodeType = \"action\";\nexport const NodeTypeLogic: NodeType = \"logic\";\nexport const NodeTypeLoop: NodeType = \"loop\";\nexport const NodeTypeParallel: NodeType = \"parallel\";\nexport const NodeTypeDelay: NodeType = \"delay\";\nexport const NodeTypeData: NodeType = \"data\";\nexport const NodeTypeIntegration: NodeType = \"integration\";\nexport const NodeTypeTimer: NodeType = \"timer\";\nexport const NodeTypeSubflow: NodeType = \"subflow\";\nexport const NodeTypeCustom: NodeType = \"custom\";\nexport const NodeTypeAccounting: NodeType = \"accounting\";\nexport const NodeTypeDocumentExtraction: NodeType = \"documentExtraction\";\n/**\n * NodeSubType represents the subtype of a workflow node\n * All node subtypes are unified under this single type\n */\nexport type NodeSubType = string;\n/**\n * Trigger subtypes\n */\nexport const NodeSubTypeTriggerStart: NodeSubType = \"triggerStart\";\nexport const NodeSubTypeTriggerEntityRecordCreated: NodeSubType = \"triggerEntityRecordCreated\";\nexport const NodeSubTypeTriggerEntityRecordUpdated: NodeSubType = \"triggerEntityRecordUpdated\";\nexport const NodeSubTypeTriggerEntityRecordDeleted: NodeSubType = \"triggerEntityRecordDeleted\";\nexport const NodeSubTypeTriggerSLAWarning: NodeSubType = \"triggerSLAWarning\";\nexport const NodeSubTypeTriggerSLABreach: NodeSubType = \"triggerSLABreach\";\nexport const NodeSubTypeTriggerEscalation: NodeSubType = \"triggerEscalation\";\nexport const NodeSubTypeTriggerWebhookReceived: NodeSubType = \"triggerWebhookReceived\";\n/**\n * Human action subtypes\n */\nexport const NodeSubTypeHumanActionReview: NodeSubType = \"humanActionReview\"; // review means will be able to edit the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionApproval: NodeSubType = \"humanActionApproval\"; // approval means will be able to edit the fields and move to next node (with approval)\nexport const NodeSubTypeHumanActionDataEntry: NodeSubType = \"humanActionDataEntry\"; // data entry means will be able to fill the fields and move to next node (no approval)\nexport const NodeSubTypeHumanActionAssignment: NodeSubType = \"humanActionAssignment\"; // assignment means will be able to only assign the task to a user (no approval)\n/**\n * Agent subtypes\n */\nexport const NodeSubTypeAgentChat: NodeSubType = \"agentChat\";\nexport const NodeSubTypeAgentIntentDetector: NodeSubType = \"agentIntentDetector\";\nexport const NodeSubTypeAgentKnowledgeGraph: NodeSubType = \"agentKnowledgeGraph\";\nexport const NodeSubTypeAgentClientApiCall: NodeSubType = \"clientApiCall\";\nexport const NodeSubTypeAgentTransferToHuman: NodeSubType = \"agentTransferToHuman\";\nexport const NodeSubTypeAgentOpenTicket: NodeSubType = \"agentOpenTicket\";\nexport const NodeSubTypeAgentApiIntegration: NodeSubType = \"agentApiIntegration\";\nexport const NodeSubTypeAgentCustomResponse: NodeSubType = \"agentCustomResponse\";\nexport const NodeSubTypeAgentStructuredOutput: NodeSubType = \"agentStructuredOutput\"; // Generic structured output using OpenAI with dynamic input/output schemas\n/**\n * Action subtypes\n */\nexport const NodeSubTypeActionApiCall: NodeSubType = \"actionApiCall\";\nexport const NodeSubTypeActionDocumentExtraction: NodeSubType = \"actionDocumentExtraction\";\nexport const NodeSubTypeActionSendEmail: NodeSubType = \"actionSendEmail\";\nexport const NodeSubTypeActionSendSMS: NodeSubType = \"actionSendSMS\";\nexport const NodeSubTypeActionGenerateDocument: NodeSubType = \"actionGenerateDocument\";\nexport const NodeSubTypeActionProcessPayment: NodeSubType = \"actionProcessPayment\";\nexport const NodeSubTypeActionCreateEntityRecord: NodeSubType = \"actionCreateEntityRecord\";\nexport const NodeSubTypeActionUpdateEntityRecord: NodeSubType = \"actionUpdateEntityRecord\";\nexport const NodeSubTypeActionDeleteEntityRecord: NodeSubType = \"actionDeleteEntityRecord\";\nexport const NodeSubTypeActionMergeEntityRecords: NodeSubType = \"actionMergeEntityRecords\";\nexport const NodeSubTypeActionAssignSLAPolicy: NodeSubType = \"actionAssignSLAPolicy\";\nexport const NodeSubTypeActionChangeSLAStatus: NodeSubType = \"actionChangeSLAAssignmentStatus\";\nexport const NodeSubTypeActionEscalateSLA: NodeSubType = \"actionEscalateSLAAssignment\";\nexport const NodeSubTypeActionCSATSurvey: NodeSubType = \"actionCSATSurvey\";\nexport const NodeSubTypeActionSetVariables: NodeSubType = \"actionSetVariables\"; // Passthrough node that sets variables from config values\nexport const NodeSubTypeActionQueryEntityRecords: NodeSubType = \"actionQueryEntityRecords\"; // Query entity records with filters\nexport const NodeSubTypeActionNatsRequest: NodeSubType = \"actionNatsRequest\"; // Execute a NATS request-reply call\n/**\n * Logic subtypes\n */\nexport const NodeSubTypeLogicIf: NodeSubType = \"logicIf\";\nexport const NodeSubTypeLogicSwitch: NodeSubType = \"logicSwitch\";\nexport const NodeSubTypeLogicFor: NodeSubType = \"logicFor\";\nexport const NodeSubTypeLogicParallel: NodeSubType = \"logicParallel\";\n/**\n * Loop subtypes\n */\nexport const NodeSubTypeLoopData: NodeSubType = \"loopData\";\n/**\n * Delay subtypes\n */\nexport const NodeSubTypeDelay: NodeSubType = \"delay\";\n/**\n * Data subtypes\n */\nexport const NodeSubTypeDataFilter: NodeSubType = \"dataFilter\";\nexport const NodeSubTypeDataMap: NodeSubType = \"dataMap\";\nexport const NodeSubTypeDataCalculate: NodeSubType = \"dataCalculate\";\nexport const NodeSubTypeDataValidate: NodeSubType = \"dataValidate\";\n/**\n * Timer subtypes\n */\nexport const NodeSubTypeTimerDelay: NodeSubType = \"timerDelay\";\nexport const NodeSubTypeTimerSchedule: NodeSubType = \"timerSchedule\";\nexport const NodeSubTypeTimerBusinessHours: NodeSubType = \"timerBusinessHours\";\n/**\n * ExpressionType defines the type of expression evaluation to be used\n */\nexport type ExpressionType = string;\n/**\n * Simple filter-based expressions using predefined operators\n */\nexport const ExpressionTypeFilter: ExpressionType = \"filter\";\n/**\n * JavaScript-like expressions with full language features\n */\nexport const ExpressionTypeJavaScript: ExpressionType = \"javascript\";\n/**\n * Template expressions with variable interpolation\n */\nexport const ExpressionTypeTemplate: ExpressionType = \"template\";\n/**\n * Custom domain-specific language expressions\n */\nexport const ExpressionTypeDSL: ExpressionType = \"dsl\";\n/**\n * Complex rule-based expressions (e.g., business rules)\n */\nexport const ExpressionTypeRules: ExpressionType = \"rules\";\n/**\n * EdgeType defines the type and behavior of workflow edges\n */\nexport type EdgeType = string;\n/**\n * Standard flow between nodes\n */\nexport const EdgeTypeNormal: EdgeType = \"normal\";\n/**\n * Loop back to previous node\n */\nexport const EdgeTypeLoopBack: EdgeType = \"loopBack\";\n/**\n * Error handling path\n */\nexport const EdgeTypeError: EdgeType = \"error\";\n/**\n * Fallback/default path when no other conditions match\n */\nexport const EdgeTypeDefault: EdgeType = \"default\";\n/**\n * Path for parallel execution branch\n */\nexport const EdgeTypeParallel: EdgeType = \"parallel\";\n/**\n * Path for conditional branching\n */\nexport const EdgeTypeConditional: EdgeType = \"conditional\";\n/**\n * Path for merging parallel branches\n */\nexport const EdgeTypeMerge: EdgeType = \"merge\";\n/**\n * Compensating/rollback path\n */\nexport const EdgeTypeCompensation: EdgeType = \"compensation\";\n/**\n * Path for timeout/deadline handling\n */\nexport const EdgeTypeTimeout: EdgeType = \"timeout\";\nexport type WorkflowType = string;\nexport const WorkflowTypeEntity: WorkflowType = \"entity\";\nexport const WorkflowTypeDocument: WorkflowType = \"document\";\nexport const WorkflowTypeChat: WorkflowType = \"chat\";\nexport const WorkflowTypeAgent: WorkflowType = \"agent\";\nexport const WorkflowTypeProductivity: WorkflowType = \"productivity\";\n\n//////////\n// source: node-definitions.go\n\n/**\n * NodeDefinition is the design-time template for creating WorkflowNode instances.\n * This is the single source of truth for all node types in the workflow system.\n * Generated to TypeScript via schema-generator for use in the workflow designer UI.\n */\nexport interface NodeDefinition {\n type: NodeType;\n subType: NodeSubTypeTS;\n label: string;\n icon: string;\n description: string;\n category: string;\n config: JSONSchema;\n input: JSONSchema;\n output: JSONSchema;\n}\n/**\n * EdgeTypeDefinition defines metadata for an edge type\n */\nexport interface EdgeTypeDefinition {\n value: string;\n label: string;\n}\n/**\n * WorkflowTypeDefinition defines metadata for a workflow type\n */\nexport interface WorkflowTypeDefinition {\n value: string;\n label: string;\n}\n\n//////////\n// source: workflow-helper-models.go\n\nexport interface LogicPath {\n id: string;\n nodeId: string;\n condition: string; // \"true\"/\"false\" for if, value for switch\n priority: number /* int */; // For ordering multiple possible paths\n}\nexport interface Intent {\n id: string;\n nodeId: string;\n name: string;\n description: string;\n}\n\n//////////\n// source: workflows-base-models.go\n\nexport interface Metadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n}\nexport interface CreateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface UpdateWorkflowDefinitionRequest {\n definition: WorkflowDefinition;\n orgId: string;\n}\nexport interface WorkflowDefinitionResponse {\n definition: WorkflowDefinition;\n metadata: ResponseMetadata;\n}\nexport interface GetWorkflowDefinitionRequest {\n id?: string /* uuid */; // Lookup by ID\n name?: string; // Or lookup by name (normalized: lowercase, dashes)\n title?: string; // Or lookup by title (deprecated, use name)\n type?: string; // Optional: filter by type when looking up by name/title\n orgId: string;\n}\n/**\n * GetWorkflowDefinitionByTitleRequest is used for the legacy workflow.definition.get.by.title endpoint\n * Kept for backward compatibility - prefer using GetWorkflowDefinitionRequest with Name field\n */\nexport interface GetWorkflowDefinitionByTitleRequest {\n title: string;\n name?: string; // Preferred over Title\n type?: string; // Optional: filter by type\n orgId: string;\n}\nexport interface ListWorkflowDefinitionsRequest {\n orgId: string;\n status?: string; // Optional: active, inactive, etc\n}\nexport interface ListWorkflowDefinitionsResponse {\n definitions: WorkflowDefinition[];\n metadata: ResponseMetadata;\n}\nexport interface DeleteWorkflowDefinitionRequest {\n id: string;\n orgId: string;\n}\n/**\n * Workflow Definition models\n */\nexport interface WorkflowDefinition {\n /**\n * Core Identity\n */\n id?: string /* uuid */;\n name: string; // Normalized name: lowercase, spaces replaced with dashes (auto-generated from Title)\n title: string;\n description: string;\n type: WorkflowTypeTS; // entity, chat, document, etc.\n /**\n * Graph Structure\n */\n nodes: { [key: string]: WorkflowNode};\n edges: WorkflowEdge[];\n entryPoints: string[]; // List of start node IDs, currently only one\n /**\n * Data Management\n */\n variables: WorkflowVariables;\n constants?: { [key: string]: any};\n /**\n * Runtime Configuration\n */\n persistence?: PersistenceType;\n /**\n * Validation and Constraints\n */\n rules?: WorkflowRule[];\n permissions: WorkflowPermissions;\n /**\n * Metadata and Tracking\n */\n metadata: WorkflowMetadata;\n}\nexport interface WorkflowVariables {\n schema: JSONSchema;\n scope: { [key: string]: string}; // Variable visibility\n defaultValues: { [key: string]: any}; // Default values\n computed: { [key: string]: string}; // Expressions for computed variables\n}\nexport interface WorkflowRule {\n name: string;\n description: string;\n condition: string; // Expression\n action: string; // What to do if condition is met\n level: RuleLevel; // error, warning, info\n}\nexport type RuleLevel = string;\nexport const RuleLevelError: RuleLevel = \"error\";\nexport const RuleLevelWarning: RuleLevel = \"warning\";\nexport const RuleLevelInfo: RuleLevel = \"info\";\nexport interface WorkflowPermissions {\n roles: { [key: string]: string[]}; // Role-based permissions\n accessLevel: string; // public, private, restricted\n editableBy: string[]; // User/Role IDs\n viewableBy: string[]; // User/Role IDs\n}\nexport interface WorkflowMetadata {\n createdBy: string;\n createdAt: string /* RFC3339 */;\n updatedBy?: string;\n updatedAt?: string /* RFC3339 */;\n isActive: boolean;\n version: number /* int */;\n tags?: string[];\n category?: string;\n labels?: string[];\n}\nexport type PersistenceType = string;\nexport const PersistenceTypeEphemeral: PersistenceType = \"ephemeral\";\nexport const PersistenceTypePermanent: PersistenceType = \"permanent\";\n/**\n * todo: validate default values against schema\n */\nexport interface NodeInput {\n schema: JSONSchema;\n defaultValues?: { [key: string]: any};\n}\nexport interface NodeOutput {\n schema: JSONSchema;\n /**\n * Mapping map[string]string `json:\"mapping,omitempty\"`\n */\n values?: { [key: string]: any};\n}\nexport interface NodeConfig {\n schema: JSONSchema; // config schema, the ui must validate against this\n values: { [key: string]: any}; // actual config values\n promoteToVariables?: string[]; // output fields to promote to workflow-level variables\n}\nexport interface WorkflowNode {\n id: string;\n title: string;\n name: string; // ** normalized function name, for example: find_products **\n label?: string;\n description?: string;\n type: WorkflowNodeTypeTS;\n subType?: WorkflowNodeSubTypeTS;\n config: NodeConfig;\n settings: NodeSettings;\n input: NodeInput;\n output: NodeOutput;\n isStart: boolean;\n}\n/**\n * NodeSettings contains type-specific configuration\n */\nexport interface NodeSettings {\n /**\n * Shared configs\n */\n execution?: ExecutionConfig;\n retry?: RetryConfig;\n}\nexport interface ExecutionConfig {\n timeoutSeconds: number /* int */;\n priority: number /* int */;\n subject?: string;\n}\nexport interface RetryConfig {\n maxAttempts: number /* int */;\n initialDelay: any /* time.Duration */;\n maxDelay: any /* time.Duration */;\n backoffMultiplier: number /* float64 */;\n}\n/**\n * CacheConfig defines caching behavior for expression results\n */\nexport interface CacheConfig {\n enabled: boolean;\n ttl: any /* time.Duration */; // How long to cache\n key?: string; // Custom cache key\n tags?: string[];\n}\nexport interface ExpressionConfig {\n type: ExpressionType;\n expression: string;\n variables?: string[]; // Referenced variables\n timeout?: any /* time.Duration */; // Evaluation timeout\n cache?: CacheConfig; // Expression result caching\n}\n/**\n * Example usage in full edge structure\n */\nexport interface WorkflowEdge {\n id: string;\n fromNodeId: string;\n toNodeId: string;\n type: WorkflowEdgeTypeTS;\n label?: string;\n expression?: ExpressionConfig;\n priority: number /* int */;\n retry?: RetryConfig;\n timeout?: TimeoutConfig;\n properties?: { [key: string]: string};\n}\n/**\n * TimeoutConfig defines timeout behavior for nodes and edges\n */\nexport interface TimeoutConfig {\n duration: any /* time.Duration */; // How long to wait\n action: TimeoutAction; // What to do on timeout\n retryPolicy?: RetryConfig; // Optional retry on timeout\n}\nexport type TimeoutAction = string;\nexport const TimeoutActionFail: TimeoutAction = \"fail\"; // Mark as failed\nexport const TimeoutActionSkip: TimeoutAction = \"skip\"; // Skip and continue\nexport const TimeoutActionRetry: TimeoutAction = \"retry\"; // Attempt retry\nexport const TimeoutActionAlt: TimeoutAction = \"alt\"; // Take alternate path\nexport interface CreateWorkflowInstanceRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variables: { [key: string]: any};\n autoExecute: boolean;\n}\nexport interface WorkflowInstanceResponse {\n instance?: WorkflowInstance;\n metadata: ResponseMetadata;\n}\nexport interface WorkflowInstanceExecuteNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n input: { [key: string]: any};\n}\nexport interface WorkflowInstanceResumeNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n result: { [key: string]: any};\n}\nexport interface WorkflowInstanceExecuteNodeLeanRequest {\n orgId: string;\n nodeDef: WorkflowNode;\n input: { [key: string]: any};\n}\nexport interface UpdateInstanceNodeMetadataRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n metadataKey: string;\n payload: any;\n}\nexport interface GetWorkflowInstanceRequest {\n orgId: string;\n instanceId: string /* uuid */;\n}\n/**\n * GetInstanceByStateVariableRequest finds an instance by a variable stored in state.variables\n */\nexport interface GetInstanceByStateVariableRequest {\n orgId: string;\n definitionId: string /* uuid */;\n variableKey: string; // e.g., \"orgId\"\n variableValue: string; // e.g., \"019bf2bf-e713-7936-8a4d-daeb67742a4d\"\n}\nexport interface ListWorkflowInstancesRequest {\n orgId: string;\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status?: string; // Optional: filter by instance status\n}\nexport interface ListWorkflowInstancesResponse {\n instances: WorkflowInstance[];\n metadata: ResponseMetadata;\n}\nexport interface UpdateInstanceStatusRequest {\n orgId: string;\n instanceId: string /* uuid */;\n status: InstanceStatus;\n}\nexport interface RetryNodeRequest {\n orgId: string;\n instanceId: string /* uuid */;\n nodeId: string;\n}\nexport interface ListInstancesOptions {\n definitionId: string /* uuid */;\n userId?: string; // Optional: filter by state.variables.userId\n status: InstanceStatus;\n limit: number /* int */;\n offset: number /* int */;\n}\nexport interface InstanceState {\n variables: { [key: string]: any};\n constants: { [key: string]: any};\n nodeStates: { [key: string]: NodeState};\n edgeStates: { [key: string]: EdgeState};\n}\nexport interface ExecutionContext {\n currentNodes: string[];\n path: ExecutionPathEntry[];\n errors: ExecutionError[];\n}\n/**\n * Workflow Instance models\n */\nexport interface WorkflowInstance {\n id?: string /* uuid */;\n orgId?: string /* uuid */;\n definitionId: string /* uuid */;\n definitionName?: string; // Normalized name from definition (lowercase, dashes)\n title?: string;\n description?: string;\n type?: WorkflowType;\n definitionVersion: number /* int */;\n status: InstanceStatus;\n state: InstanceState;\n context: ExecutionContext;\n persistence?: PersistenceType;\n metadata: WorkflowMetadata;\n}\nexport interface NodeState {\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n /**\n * Variables map[string]interface{} `json:\"variables,omitempty\"`\n */\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport interface EdgeState {\n status: EdgeStatus;\n timestamp: string /* RFC3339 */;\n error?: string;\n}\nexport interface ExecutionPathEntry {\n nodeId: string;\n edgeId: string;\n type: string; // node_enter, node_exit, edge_traverse\n timestamp: string /* RFC3339 */;\n data?: { [key: string]: any};\n}\nexport interface ExecutionError {\n nodeId?: string;\n edgeId?: string;\n error: string;\n timestamp: string /* RFC3339 */;\n retryable: boolean;\n}\nexport type InstanceStatus = string;\nexport const InstanceStatusNew: InstanceStatus = \"NEW\";\nexport const InstanceStatusRunning: InstanceStatus = \"RUNNING\";\nexport const InstanceStatusWaiting: InstanceStatus = \"WAITING\";\nexport const InstanceStatusPaused: InstanceStatus = \"PAUSED\";\nexport const InstanceStatusCompleted: InstanceStatus = \"COMPLETED\";\nexport const InstanceStatusFailed: InstanceStatus = \"FAILED\";\nexport interface NodeInstance {\n nodeId: string;\n status: NodeStatus;\n input?: { [key: string]: any};\n output?: { [key: string]: any};\n error?: string;\n startTime?: string /* RFC3339 */;\n endTime?: string /* RFC3339 */;\n retryCount: number /* int */;\n nextRetryAt?: string /* RFC3339 */;\n}\nexport type NodeStatus = string;\nexport const NodeStatusPending: NodeStatus = \"PENDING\";\nexport const NodeStatusRunning: NodeStatus = \"RUNNING\";\nexport const NodeStatusCompleted: NodeStatus = \"COMPLETED\";\nexport const NodeStatusFailed: NodeStatus = \"FAILED\";\nexport const NodeStatusWaiting: NodeStatus = \"WAITING\";\nexport const NodeStatusSkipped: NodeStatus = \"SKIPPED\";\nexport type EdgeStatus = string;\nexport const EdgeStatusPending: EdgeStatus = \"PENDING\";\nexport const EdgeStatusCompleted: EdgeStatus = \"COMPLETED\";\nexport const EdgeStatusSkipped: EdgeStatus = \"SKIPPED\";\n/**\n * WorkflowDefinitionInfo holds summarized info about an active workflow definition\n * Used by schedulers and services that need to process workflows without full definition details\n */\nexport interface WorkflowDefinitionInfo {\n id: string; // Workflow definition ID\n orgId: string; // Organization ID\n title: string;\n type: string; // e.g., \"productivity\", \"entity\"\n category: string; // e.g., \"email\" (from metadata)\n isActive: boolean;\n createdBy: string; // User who created this workflow\n /**\n * User config from definition.variables.defaultValues (workflow-specific)\n */\n provider?: string; // e.g., \"google\" or \"microsoft\" for email workflows\n userEmail?: string; // User's email address\n userId?: string; // User ID who owns this workflow\n}\n","// Code generated by tygo. DO NOT EDIT.\n\n//////////\n// source: subjects.go\n\nexport const WorkflowDefinitionCreate = \"workflow.definition.create\";\nexport const WorkflowDefinitionCreated = \"workflow.definition.created\";\nexport const WorkflowDefinitionUpdate = \"workflow.definition.update\";\nexport const WorkflowDefinitionUpdated = \"workflow.definition.updated\";\nexport const WorkflowDefinitionGet = \"workflow.definition.get\";\nexport const WorkflowDefinitionGetServer = \"workflow.definition.get.server\";\nexport const WorkflowDefinitionGetByTitle = \"workflow.definition.get.by.title\";\nexport const WorkflowDefinitionList = \"workflow.definition.list\";\nexport const WorkflowDefinitionDelete = \"workflow.definition.delete\";\nexport const WorkflowDefinitionDeleted = \"workflow.definition.deleted\";\nexport const WorkflowInstanceCreate = \"workflow.instance.create\";\nexport const WorkflowInstanceExecuteNode = \"workflow.instance.execute.node\";\nexport const WorkflowInstanceResumeNode = \"workflow.instance.resume.node\";\nexport const WorkflowInstanceExecuteNodeServer = \"workflow.instance.execute.node.server\";\nexport const WorkflowInstanceResumeNodeServer = \"workflow.instance.resume.node.server\";\nexport const WorkflowInstanceExecuteNodeLean = \"workflow.instance.execute.node.lean\";\nexport const WorkflowInstanceExecuteNodeLeanServer = \"workflow.instance.execute.node.lean.server\";\nexport const WorkflowInstanceGet = \"workflow.instance.get\";\nexport const WorkflowInstanceGetByStateVariable = \"workflow.instance.get.by.state.variable\";\nexport const WorkflowInstanceList = \"workflow.instance.list\";\nexport const WorkflowInstanceUpdate = \"workflow.instance.update\";\nexport const WorkflowInstanceUpdated = \"workflow.instance.updated\";\nexport const WorkflowInstanceUpdateNodeMetadata = \"workflow.instance.update.node.metadata\";\n/**\n * Template management\n */\nexport const WorkflowTemplateList = \"workflow.template.list\";\nexport const WorkflowTemplateGet = \"workflow.template.get\";\nexport const WorkflowTemplateInstantiate = \"workflow.template.instantiate\";\n/**\n * Schedule management\n */\nexport const WorkflowScheduleCreate = \"workflow.schedule.create\";\nexport const WorkflowScheduleUpdate = \"workflow.schedule.update\";\nexport const WorkflowScheduleDelete = \"workflow.schedule.delete\";\nexport const WorkflowScheduleList = \"workflow.schedule.list\";\nexport const WorkflowSchedulePause = \"workflow.schedule.pause\";\nexport const WorkflowScheduleResume = \"workflow.schedule.resume\";\n/**\n * Trigger management\n */\nexport const WorkflowTriggerRegister = \"workflow.trigger.register\";\nexport const WorkflowTriggerPause = \"workflow.trigger.pause\";\nexport const WorkflowTriggerResume = \"workflow.trigger.resume\";\nexport const WorkflowTriggerStatus = \"workflow.trigger.status\";\nexport const WorkflowTriggerFired = \"workflow.trigger.fired\";\n/**\n * Execution events\n */\nexport const WorkflowExecutionStarted = \"workflow.execution.started\";\nexport const WorkflowExecutionCompleted = \"workflow.execution.completed\";\nexport const WorkflowExecutionFailed = \"workflow.execution.failed\";\n"],"mappings":";AAYO,IAAM,kBAA4B;AAClC,IAAM,sBAAgC;AACtC,IAAM,gBAA0B;AAChC,IAAM,iBAA2B;AACjC,IAAM,gBAA0B;AAChC,IAAM,eAAyB;AAC/B,IAAM,mBAA6B;AACnC,IAAM,gBAA0B;AAChC,IAAM,eAAyB;AAC/B,IAAM,sBAAgC;AACtC,IAAM,gBAA0B;AAChC,IAAM,kBAA4B;AAClC,IAAM,iBAA2B;AACjC,IAAM,qBAA+B;AACrC,IAAM,6BAAuC;AAS7C,IAAM,0BAAuC;AAC7C,IAAM,wCAAqD;AAC3D,IAAM,wCAAqD;AAC3D,IAAM,wCAAqD;AAC3D,IAAM,+BAA4C;AAClD,IAAM,8BAA2C;AACjD,IAAM,+BAA4C;AAClD,IAAM,oCAAiD;AAIvD,IAAM,+BAA4C;AAClD,IAAM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,IAAM,0BAA0B;AAChC,IAAM,uBAAuB;AAC7B,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAC9B,IAAM,uBAAuB;AAI7B,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,0BAA0B;","names":[]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
|
|
3
|
-
// api/index.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// api/index.ts
|
|
4
2
|
var _browser = require('@elqnt/api-client/browser');
|
|
5
3
|
async function listWorkflowsApi(options) {
|
|
6
4
|
return _browser.browserApiRequest.call(void 0, "/api/v1/workflows", { method: "GET", ...options });
|
|
@@ -102,4 +100,4 @@ async function instantiateWorkflowTemplateApi(templateId, params, options) {
|
|
|
102
100
|
|
|
103
101
|
|
|
104
102
|
exports.listWorkflowsApi = listWorkflowsApi; exports.getWorkflowApi = getWorkflowApi; exports.createWorkflowApi = createWorkflowApi; exports.updateWorkflowApi = updateWorkflowApi; exports.deleteWorkflowApi = deleteWorkflowApi; exports.createWorkflowInstanceApi = createWorkflowInstanceApi; exports.getWorkflowInstanceApi = getWorkflowInstanceApi; exports.listWorkflowInstancesApi = listWorkflowInstancesApi; exports.updateWorkflowInstanceStatusApi = updateWorkflowInstanceStatusApi; exports.executeWorkflowNodeApi = executeWorkflowNodeApi; exports.resumeWorkflowNodeApi = resumeWorkflowNodeApi; exports.retryWorkflowNodeApi = retryWorkflowNodeApi; exports.listWorkflowTemplatesApi = listWorkflowTemplatesApi; exports.getWorkflowTemplateApi = getWorkflowTemplateApi; exports.instantiateWorkflowTemplateApi = instantiateWorkflowTemplateApi;
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
103
|
+
//# sourceMappingURL=chunk-YCO5IFZK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-YCO5IFZK.js","../api/index.ts"],"names":[],"mappings":"AAAA;ACOA,oDAAkC;AA+ClC,MAAA,SAAsB,gBAAA,CACpB,OAAA,EACuD;AACvD,EAAA,OAAO,wCAAA,mBAAkB,EAAqB,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAC7E;AAEA,MAAA,SAAsB,cAAA,CACpB,UAAA,EACA,OAAA,EACkD;AAClD,EAAA,OAAO,wCAAA,CAAkB,kBAAA,EAAqB,UAAU,CAAA,CAAA;AAC1D;AAKsE;AACZ,EAAA;AAC1D;AAKE;AAEwD,EAAA;AAC1D;AAK0E;AAChB,EAAA;AAC1D;AAQE;AAG8C,EAAA;AACpC,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AAKkD;AACQ,EAAA;AAC1D;AAIE;AAEmC,EAAA;AACoB,EAAA;AACA,EAAA;AACnB,EAAA;AAC7B,EAAA;AACyC,IAAA;AAClB,IAAA;AAC9B,EAAA;AACF;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACM,IAAA;AACX,IAAA;AACJ,EAAA;AACH;AAKE;AAGwD,EAAA;AAC9C,IAAA;AACO,IAAA;AACZ,IAAA;AACJ,EAAA;AACH;AAKE;AAEwD,EAAA;AAC9C,IAAA;AACD,IAAA;AACJ,IAAA;AACJ,EAAA;AACH;AAQuD;AAClB,EAAA;AACkB,EAAA;AACjB,EAAA;AAC7B,EAAA;AAC2C,IAAA;AACpB,IAAA;AAC9B,EAAA;AACF;AAKqD;AACK,EAAA;AAC1D;AAIE;AAGwD,EAAA;AAC9C,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AD7H2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/workflow/dist/chunk-YCO5IFZK.js","sourcesContent":[null,"/**\n * Workflow API functions\n *\n * Browser-side API client for workflow operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n WorkflowDefinition,\n WorkflowInstance,\n ListWorkflowDefinitionsResponse,\n WorkflowDefinitionResponse,\n WorkflowInstanceResponse,\n ListWorkflowInstancesResponse,\n} from \"../models\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport interface WorkflowTemplate {\n id: string;\n name: string;\n title: string;\n description: string;\n category: string;\n variables: Array<{\n name: string;\n type: string;\n required: boolean;\n description?: string;\n }>;\n preview?: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface ListWorkflowTemplatesResponse {\n templates: WorkflowTemplate[];\n metadata: ResponseMetadata;\n}\n\nexport interface GetWorkflowTemplateResponse {\n template: WorkflowTemplate;\n metadata: ResponseMetadata;\n}\n\n// =============================================================================\n// WORKFLOW DEFINITIONS\n// =============================================================================\n\nexport async function listWorkflowsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListWorkflowDefinitionsResponse>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"GET\", ...options });\n}\n\nexport async function getWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"GET\", ...options });\n}\n\nexport async function createWorkflowApi(\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse & { id?: string }>> {\n return browserApiRequest(\"/api/v1/workflows\", { method: \"POST\", body: workflow, ...options });\n}\n\nexport async function updateWorkflowApi(\n workflowId: string,\n workflow: Partial<WorkflowDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"PUT\", body: workflow, ...options });\n}\n\nexport async function deleteWorkflowApi(\n workflowId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/${workflowId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// WORKFLOW INSTANCES\n// =============================================================================\n\nexport async function createWorkflowInstanceApi(\n definitionId: string,\n data: { variables?: Record<string, unknown>; autoExecute?: boolean },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse & { id?: string }>> {\n return browserApiRequest(`/api/v1/workflows/${definitionId}/instances`, {\n method: \"POST\",\n body: data,\n ...options,\n });\n}\n\nexport async function getWorkflowInstanceApi(\n instanceId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}`, { method: \"GET\", ...options });\n}\n\nexport async function listWorkflowInstancesApi(\n definitionId: string,\n options: ApiClientOptions & { userId?: string; status?: string }\n): Promise<ApiResponse<ListWorkflowInstancesResponse>> {\n const params = new URLSearchParams();\n if (options.userId) params.set(\"userId\", options.userId);\n if (options.status) params.set(\"status\", options.status);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/${definitionId}/instances${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function updateWorkflowInstanceStatusApi(\n instanceId: string,\n status: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/status`, {\n method: \"PUT\",\n body: { status },\n ...options,\n });\n}\n\nexport async function executeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n input: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; output?: Record<string, unknown>; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/execute`, {\n method: \"POST\",\n body: { input },\n ...options,\n });\n}\n\nexport async function resumeWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n result: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/resume`, {\n method: \"POST\",\n body: { result },\n ...options,\n });\n}\n\nexport async function retryWorkflowNodeApi(\n instanceId: string,\n nodeId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowInstanceResponse>> {\n return browserApiRequest(`/api/v1/workflows/instances/${instanceId}/nodes/${nodeId}/retry`, {\n method: \"POST\",\n body: {},\n ...options,\n });\n}\n\n// =============================================================================\n// WORKFLOW TEMPLATES\n// =============================================================================\n\nexport async function listWorkflowTemplatesApi(\n options: ApiClientOptions & { category?: string }\n): Promise<ApiResponse<ListWorkflowTemplatesResponse>> {\n const params = new URLSearchParams();\n if (options.category) params.set(\"category\", options.category);\n const queryString = params.toString();\n return browserApiRequest(\n `/api/v1/workflows/templates${queryString ? `?${queryString}` : \"\"}`,\n { method: \"GET\", ...options }\n );\n}\n\nexport async function getWorkflowTemplateApi(\n templateId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<GetWorkflowTemplateResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}`, { method: \"GET\", ...options });\n}\n\nexport async function instantiateWorkflowTemplateApi(\n templateId: string,\n params: { variables: Record<string, unknown>; title?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<WorkflowDefinitionResponse>> {\n return browserApiRequest(`/api/v1/workflows/templates/${templateId}/instantiate`, {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { JSONSchema } from '@elqnt/types';
|
|
3
|
+
|
|
4
|
+
interface DynamicSchemaFormUIComponents {
|
|
5
|
+
Input: React.ComponentType<{
|
|
6
|
+
type?: string;
|
|
7
|
+
value: any;
|
|
8
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
step?: string | number;
|
|
15
|
+
}>;
|
|
16
|
+
Label: React.ComponentType<{
|
|
17
|
+
htmlFor?: string;
|
|
18
|
+
className?: string;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}>;
|
|
21
|
+
Textarea: React.ComponentType<{
|
|
22
|
+
value: any;
|
|
23
|
+
onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
rows?: number;
|
|
26
|
+
className?: string;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
}>;
|
|
29
|
+
Checkbox: React.ComponentType<{
|
|
30
|
+
id?: string;
|
|
31
|
+
checked: boolean;
|
|
32
|
+
onCheckedChange: (checked: boolean) => void;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
Select: React.ComponentType<{
|
|
36
|
+
value: string;
|
|
37
|
+
onValueChange: (value: string) => void;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
}>;
|
|
41
|
+
SelectTrigger: React.ComponentType<{
|
|
42
|
+
className?: string;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}>;
|
|
45
|
+
SelectValue: React.ComponentType<{
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
}>;
|
|
48
|
+
SelectContent: React.ComponentType<{
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
}>;
|
|
51
|
+
SelectItem: React.ComponentType<{
|
|
52
|
+
value: string;
|
|
53
|
+
className?: string;
|
|
54
|
+
children: React.ReactNode;
|
|
55
|
+
}>;
|
|
56
|
+
Button: React.ComponentType<{
|
|
57
|
+
type?: "button" | "submit" | "reset";
|
|
58
|
+
variant?: string;
|
|
59
|
+
size?: string;
|
|
60
|
+
className?: string;
|
|
61
|
+
onClick?: () => void;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
children: React.ReactNode;
|
|
64
|
+
}>;
|
|
65
|
+
Card: React.ComponentType<{
|
|
66
|
+
className?: string;
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
}>;
|
|
69
|
+
PlusIcon: React.ComponentType<{
|
|
70
|
+
className?: string;
|
|
71
|
+
}>;
|
|
72
|
+
TrashIcon: React.ComponentType<{
|
|
73
|
+
className?: string;
|
|
74
|
+
}>;
|
|
75
|
+
ChevronDownIcon: React.ComponentType<{
|
|
76
|
+
className?: string;
|
|
77
|
+
}>;
|
|
78
|
+
ChevronRightIcon: React.ComponentType<{
|
|
79
|
+
className?: string;
|
|
80
|
+
}>;
|
|
81
|
+
VariableIcon?: React.ComponentType<{
|
|
82
|
+
className?: string;
|
|
83
|
+
}>;
|
|
84
|
+
CheckIcon?: React.ComponentType<{
|
|
85
|
+
className?: string;
|
|
86
|
+
}>;
|
|
87
|
+
EditIcon?: React.ComponentType<{
|
|
88
|
+
className?: string;
|
|
89
|
+
}>;
|
|
90
|
+
Popover?: React.ComponentType<{
|
|
91
|
+
open?: boolean;
|
|
92
|
+
onOpenChange?: (open: boolean) => void;
|
|
93
|
+
children: React.ReactNode;
|
|
94
|
+
}>;
|
|
95
|
+
PopoverTrigger?: React.ComponentType<{
|
|
96
|
+
asChild?: boolean;
|
|
97
|
+
children: React.ReactNode;
|
|
98
|
+
}>;
|
|
99
|
+
PopoverContent?: React.ComponentType<{
|
|
100
|
+
className?: string;
|
|
101
|
+
align?: "start" | "center" | "end";
|
|
102
|
+
children: React.ReactNode;
|
|
103
|
+
}>;
|
|
104
|
+
Dialog?: React.ComponentType<{
|
|
105
|
+
open?: boolean;
|
|
106
|
+
onOpenChange?: (open: boolean) => void;
|
|
107
|
+
children: React.ReactNode;
|
|
108
|
+
}>;
|
|
109
|
+
DialogContent?: React.ComponentType<{
|
|
110
|
+
className?: string;
|
|
111
|
+
children: React.ReactNode;
|
|
112
|
+
}>;
|
|
113
|
+
DialogHeader?: React.ComponentType<{
|
|
114
|
+
className?: string;
|
|
115
|
+
children: React.ReactNode;
|
|
116
|
+
}>;
|
|
117
|
+
DialogTitle?: React.ComponentType<{
|
|
118
|
+
className?: string;
|
|
119
|
+
children: React.ReactNode;
|
|
120
|
+
}>;
|
|
121
|
+
DialogFooter?: React.ComponentType<{
|
|
122
|
+
className?: string;
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
}>;
|
|
125
|
+
ScrollArea?: React.ComponentType<{
|
|
126
|
+
className?: string;
|
|
127
|
+
children: React.ReactNode;
|
|
128
|
+
}>;
|
|
129
|
+
MarkdownEditor?: React.ComponentType<{
|
|
130
|
+
content: string;
|
|
131
|
+
onChange: (markdown: string) => void;
|
|
132
|
+
placeholder?: string;
|
|
133
|
+
className?: string;
|
|
134
|
+
readOnly?: boolean;
|
|
135
|
+
minHeight?: string;
|
|
136
|
+
variables?: Array<{
|
|
137
|
+
name: string;
|
|
138
|
+
path: string;
|
|
139
|
+
title?: string;
|
|
140
|
+
}>;
|
|
141
|
+
}>;
|
|
142
|
+
cn: (...classes: (string | undefined | null | false)[]) => string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Variable definition for workflow variables
|
|
146
|
+
*/
|
|
147
|
+
interface WorkflowVariable {
|
|
148
|
+
name: string;
|
|
149
|
+
type: string;
|
|
150
|
+
title?: string;
|
|
151
|
+
path: string;
|
|
152
|
+
}
|
|
153
|
+
interface DynamicSchemaFormProps {
|
|
154
|
+
schema: JSONSchema;
|
|
155
|
+
value: any;
|
|
156
|
+
onChange: (value: any) => void;
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
path?: string[];
|
|
159
|
+
components: DynamicSchemaFormUIComponents;
|
|
160
|
+
/** Workflow variables available for selection */
|
|
161
|
+
variables?: WorkflowVariable[];
|
|
162
|
+
/** Whether to show variable picker buttons */
|
|
163
|
+
showVariablePicker?: boolean;
|
|
164
|
+
}
|
|
165
|
+
declare function DynamicSchemaForm({ schema, value, onChange, disabled, path, components, variables, showVariablePicker, }: DynamicSchemaFormProps): react_jsx_runtime.JSX.Element;
|
|
166
|
+
|
|
167
|
+
interface SchemaBuilderUIComponents {
|
|
168
|
+
Input: React.ComponentType<{
|
|
169
|
+
value: any;
|
|
170
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
171
|
+
disabled?: boolean;
|
|
172
|
+
className?: string;
|
|
173
|
+
placeholder?: string;
|
|
174
|
+
}>;
|
|
175
|
+
Label: React.ComponentType<{
|
|
176
|
+
htmlFor?: string;
|
|
177
|
+
className?: string;
|
|
178
|
+
children: React.ReactNode;
|
|
179
|
+
}>;
|
|
180
|
+
Checkbox: React.ComponentType<{
|
|
181
|
+
id?: string;
|
|
182
|
+
checked: boolean;
|
|
183
|
+
onCheckedChange: (checked: boolean) => void;
|
|
184
|
+
disabled?: boolean;
|
|
185
|
+
}>;
|
|
186
|
+
Select: React.ComponentType<{
|
|
187
|
+
value: string;
|
|
188
|
+
onValueChange: (value: string) => void;
|
|
189
|
+
disabled?: boolean;
|
|
190
|
+
children: React.ReactNode;
|
|
191
|
+
}>;
|
|
192
|
+
SelectTrigger: React.ComponentType<{
|
|
193
|
+
className?: string;
|
|
194
|
+
children: React.ReactNode;
|
|
195
|
+
}>;
|
|
196
|
+
SelectValue: React.ComponentType<{
|
|
197
|
+
placeholder?: string;
|
|
198
|
+
}>;
|
|
199
|
+
SelectContent: React.ComponentType<{
|
|
200
|
+
children: React.ReactNode;
|
|
201
|
+
}>;
|
|
202
|
+
SelectItem: React.ComponentType<{
|
|
203
|
+
value: string;
|
|
204
|
+
className?: string;
|
|
205
|
+
children: React.ReactNode;
|
|
206
|
+
}>;
|
|
207
|
+
Button: React.ComponentType<{
|
|
208
|
+
type?: "button" | "submit" | "reset";
|
|
209
|
+
variant?: string;
|
|
210
|
+
size?: string;
|
|
211
|
+
className?: string;
|
|
212
|
+
onClick?: () => void;
|
|
213
|
+
disabled?: boolean;
|
|
214
|
+
children: React.ReactNode;
|
|
215
|
+
}>;
|
|
216
|
+
Card: React.ComponentType<{
|
|
217
|
+
className?: string;
|
|
218
|
+
children: React.ReactNode;
|
|
219
|
+
}>;
|
|
220
|
+
PlusIcon: React.ComponentType<{
|
|
221
|
+
className?: string;
|
|
222
|
+
}>;
|
|
223
|
+
TrashIcon: React.ComponentType<{
|
|
224
|
+
className?: string;
|
|
225
|
+
}>;
|
|
226
|
+
GripVerticalIcon: React.ComponentType<{
|
|
227
|
+
className?: string;
|
|
228
|
+
}>;
|
|
229
|
+
ChevronDownIcon: React.ComponentType<{
|
|
230
|
+
className?: string;
|
|
231
|
+
}>;
|
|
232
|
+
ChevronRightIcon: React.ComponentType<{
|
|
233
|
+
className?: string;
|
|
234
|
+
}>;
|
|
235
|
+
cn: (...classes: (string | undefined | null | false)[]) => string;
|
|
236
|
+
}
|
|
237
|
+
interface SchemaBuilderProps {
|
|
238
|
+
schema: JSONSchema;
|
|
239
|
+
onChange: (schema: JSONSchema) => void;
|
|
240
|
+
disabled?: boolean;
|
|
241
|
+
components: SchemaBuilderUIComponents;
|
|
242
|
+
}
|
|
243
|
+
declare function SchemaBuilder({ schema, onChange, disabled, components, }: SchemaBuilderProps): react_jsx_runtime.JSX.Element;
|
|
244
|
+
|
|
245
|
+
export { DynamicSchemaForm, type DynamicSchemaFormProps, type DynamicSchemaFormUIComponents, SchemaBuilder, type SchemaBuilderProps, type SchemaBuilderUIComponents, type WorkflowVariable };
|