@activepieces/piece-forms 0.4.16 → 0.4.17
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/package.json +1 -1
- package/src/index.js +1 -1
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -21,7 +21,7 @@ Use this for production, views the published version of the form.
|
|
|
21
21
|
Use this to generate sample data, views the draft version of the form (the one you are editing now).
|
|
22
22
|
`,$s=`
|
|
23
23
|
If **Wait for Response** is enabled, use **Respond on UI** in your flow to provide a response back to the form.
|
|
24
|
-
`,Ss=o((e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){let r=e.toLowerCase();if(r==="true"||r==="false")return r==="true"}throw new Error(`Field ${t} must be a boolean or 'true'/'false' string`)},"parseBoolean"),wo=Pt({name:"form_submission",displayName:"Web Form",description:"Trigger the flow by submitting a form.",props:{about:H.MarkDown({value:As,variant:"BORDERLESS"}),response:H.MarkDown({value:$s,variant:"WARNING"}),waitForResponse:H.Checkbox({displayName:"Wait for Response",defaultValue:!1,required:!0}),inputs:H.Array({displayName:"Inputs",required:!0,properties:{displayName:H.ShortText({displayName:"Field Name",required:!0}),type:H.StaticDropdown({displayName:"Field Type",required:!0,options:{options:[{value:"text",label:"Text"},{value:"text_area",label:"Text Area"},{value:"file",label:"File"},{value:"toggle",label:"Toggle"}]}}),description:H.ShortText({displayName:"Field Description",required:!1}),required:H.Checkbox({displayName:"Required",required:!0})}})},sampleData:{},type:"WEBHOOK",async onEnable(){},async onDisable(){},async run(e){let t=e.payload.body,r=e.propsValue.inputs,i={};for(let a of r){let l=er(a.displayName),d=t[l];switch(a.type){case"toggle":i[l]=Ss(d,a.displayName);break;case"text":case"text_area":case"file":i[l]=d;break}}return[i]}});var Ko=Te(Zo()),Yo=Te(Wo()),Jo=Nn({audience:"
|
|
24
|
+
`,Ss=o((e,t)=>{if(typeof e=="boolean")return e;if(typeof e=="string"){let r=e.toLowerCase();if(r==="true"||r==="false")return r==="true"}throw new Error(`Field ${t} must be a boolean or 'true'/'false' string`)},"parseBoolean"),wo=Pt({name:"form_submission",displayName:"Web Form",description:"Trigger the flow by submitting a form.",props:{about:H.MarkDown({value:As,variant:"BORDERLESS"}),response:H.MarkDown({value:$s,variant:"WARNING"}),waitForResponse:H.Checkbox({displayName:"Wait for Response",defaultValue:!1,required:!0}),inputs:H.Array({displayName:"Inputs",required:!0,properties:{displayName:H.ShortText({displayName:"Field Name",required:!0}),type:H.StaticDropdown({displayName:"Field Type",required:!0,options:{options:[{value:"text",label:"Text"},{value:"text_area",label:"Text Area"},{value:"file",label:"File"},{value:"toggle",label:"Toggle"}]}}),description:H.ShortText({displayName:"Field Description",required:!1}),required:H.Checkbox({displayName:"Required",required:!0})}})},sampleData:{},type:"WEBHOOK",async onEnable(){},async onDisable(){},async run(e){let t=e.payload.body,r=e.propsValue.inputs,i={};for(let a of r){let l=er(a.displayName),d=t[l];switch(a.type){case"toggle":i[l]=Ss(d,a.displayName);break;case"text":case"text_area":case"file":i[l]=d;break}}return[i]}});var Ko=Te(Zo()),Yo=Te(Wo()),Jo=Nn({audience:"human",name:"return_response",displayName:"Respond on UI",description:"Return a file or text (markdown) as a response.",props:{markdown:H.LongText({displayName:"Text (Markdown)",required:!1}),file:H.File({displayName:"Attachment",required:!1})},errorHandlingOptions:{retryOnFailure:{hide:!0},continueOnFailure:{hide:!0}},async run({propsValue:e,run:t,files:r}){let i=[];if(e.file){let l=e.file.filename,d=e.file.base64,f=Yo.default.lookup(l);i.push({url:await r.write({fileName:l,data:Buffer.from(d,"base64")}),mimeType:f||""})}let a={type:"markdown",value:e.markdown??"",files:i};return t.respond({response:{status:Ko.StatusCodes.OK,body:a,headers:{}}}),a}});var Bs=So({displayName:"Human Input",description:"Trigger a flow through human input.",auth:cr.None(),minimumSupportedRelease:"0.65.0",categories:["CORE"],logoUrl:"https://cdn.activepieces.com/pieces/new-core/human-input.svg",authors:["anasbarg","MoShizzle","abuaboud"],actions:[Jo],triggers:[wo,ko]});0&&(module.exports={forms});
|
|
25
25
|
/*! Bundled license information:
|
|
26
26
|
|
|
27
27
|
mime-types/index.js:
|