feat(scripts): add previewConfigKey to various scripts and enhance UI components
- Added `previewConfigKey` metadata to multiple scripts including fetch-binary, fetch-html, fetch-http, fetch-rss-feed, fingerprint, get-secret, jsonata, ntfy, render-template, and send-email, improving configuration visibility. - Updated the `FieldHelp` and `ScriptCard` components to utilize the new preview configuration, enhancing the user interface for displaying script metadata. - Refactored `TriggerCard` and `WorkflowTestPanel` components to support expanded views, improving user interaction and accessibility of configuration details. - Enhanced the `WorkflowVisualEditor` to manage test panel visibility more effectively. This update improves the overall user experience by providing clearer context and configuration options for scripts and workflows.
This commit is contained in:
@@ -71,6 +71,7 @@ async function fetchBinary(ctx) {
|
||||
|
||||
fetchBinary.meta = {
|
||||
description: "Download a binary URL into ctx.data as a Buffer",
|
||||
previewConfigKey: "url",
|
||||
config: {
|
||||
url: { type: "string", required: false, description: "Direct download URL" },
|
||||
urlVar: { type: "string", required: false, description: "Key in ctx.data that holds the URL" },
|
||||
|
||||
@@ -86,6 +86,7 @@ async function fetchHtml(ctx) {
|
||||
|
||||
fetchHtml.meta = {
|
||||
description: "Fetch HTML and optionally select elements or transform with JSONata",
|
||||
previewConfigKey: "url",
|
||||
config: {
|
||||
url: { type: "string", required: true, description: "Page URL" },
|
||||
selector: { type: "string", required: false, description: "CSS selector" },
|
||||
|
||||
@@ -115,6 +115,7 @@ async function fetchHttp(ctx) {
|
||||
|
||||
fetchHttp.meta = {
|
||||
description: "Fetch a URL and store the response body.",
|
||||
previewConfigKey: "url",
|
||||
config: {
|
||||
url: { type: "string", required: true, description: "Request URL" },
|
||||
method: {
|
||||
|
||||
@@ -68,6 +68,7 @@ async function fetchRssFeed(ctx) {
|
||||
|
||||
fetchRssFeed.meta = {
|
||||
description: "Fetch an RSS/Atom feed and optionally transform it with JSONata",
|
||||
previewConfigKey: "url",
|
||||
config: {
|
||||
url: { type: "string", required: false, description: "Feed URL (or pass data.url)" },
|
||||
outputVar: {
|
||||
|
||||
@@ -56,6 +56,7 @@ async function fingerprint(ctx) {
|
||||
fingerprint.meta = {
|
||||
description:
|
||||
"Hash a value, compare it to the last stored fingerprint, and skip remaining steps when unchanged",
|
||||
previewConfigKey: "key",
|
||||
config: {
|
||||
key: {
|
||||
type: "string",
|
||||
|
||||
@@ -22,6 +22,7 @@ async function getSecret(ctx) {
|
||||
getSecret.meta = {
|
||||
description:
|
||||
"Load a named secret for this workflow owner into ctx.data. The value is wrapped and redacted in logs.",
|
||||
previewConfigKey: "name",
|
||||
config: {
|
||||
name: {
|
||||
type: "string",
|
||||
|
||||
@@ -11,6 +11,7 @@ async function jsonataFn(ctx) {
|
||||
|
||||
jsonataFn.meta = {
|
||||
description: "Evaluate a JSONata expression against ctx.data and return the result as the next context",
|
||||
previewConfigKey: "expression",
|
||||
config: {
|
||||
expression: { type: "string", required: true, description: "JSONata expression" },
|
||||
},
|
||||
|
||||
@@ -131,6 +131,7 @@ async function ntfy(ctx) {
|
||||
|
||||
ntfy.meta = {
|
||||
description: "Send a message or file to an ntfy topic",
|
||||
previewConfigKey: "url",
|
||||
config: {
|
||||
url: {
|
||||
type: "string",
|
||||
|
||||
@@ -79,6 +79,7 @@ async function renderTemplate(ctx) {
|
||||
renderTemplate.meta = {
|
||||
description:
|
||||
"Render an HTML template from Responses (kind: template) with Mustache and return html + plain-text fallback",
|
||||
previewConfigKey: "template",
|
||||
config: {
|
||||
template: {
|
||||
type: "string",
|
||||
|
||||
@@ -230,6 +230,7 @@ async function sendEmail(ctx) {
|
||||
|
||||
sendEmail.meta = {
|
||||
description: "Send an email via SMTP (nodemailer); plain text, HTML, or both",
|
||||
previewConfigKey: "from",
|
||||
config: {
|
||||
service: {
|
||||
type: "string",
|
||||
|
||||
@@ -28,6 +28,7 @@ async function triggerWorkflow(ctx) {
|
||||
triggerWorkflow.meta = {
|
||||
description:
|
||||
"Fire-and-forget another workflow by YAML name (same owner). Destination must declare triggers: [{ type: workflow }]. Optionally reshape ctx.data with JSONata before sending.",
|
||||
previewConfigKey: "name",
|
||||
config: {
|
||||
name: {
|
||||
type: "string",
|
||||
|
||||
@@ -30,3 +30,4 @@ triggers:
|
||||
- type: HTTP
|
||||
method: GET
|
||||
path: /new
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user