diff --git a/apps/sim/blocks/blocks/pulse.ts b/apps/sim/blocks/blocks/pulse.ts index 38cbb674c..4edcfe649 100644 --- a/apps/sim/blocks/blocks/pulse.ts +++ b/apps/sim/blocks/blocks/pulse.ts @@ -132,17 +132,34 @@ export const PulseBlock: BlockConfig = { const pulseV2Inputs = PulseBlock.inputs ? Object.fromEntries(Object.entries(PulseBlock.inputs).filter(([key]) => key !== 'filePath')) : {} -const pulseV2SubBlocks = (PulseBlock.subBlocks || []).filter( - (subBlock) => subBlock.id !== 'filePath' -) +const pulseV2SubBlocks = (PulseBlock.subBlocks || []).flatMap((subBlock) => { + if (subBlock.id === 'filePath') { + return [] // Remove the old filePath subblock + } + if (subBlock.id === 'fileUpload') { + // Insert fileReference right after fileUpload + return [ + subBlock, + { + id: 'fileReference', + title: 'Document', + type: 'short-input' as SubBlockType, + canonicalParamId: 'document', + placeholder: 'File reference', + mode: 'advanced' as const, + }, + ] + } + return [subBlock] +}) export const PulseV2Block: BlockConfig = { ...PulseBlock, type: 'pulse_v2', - name: 'Pulse (File Only)', + name: 'Pulse', hideFromToolbar: false, longDescription: - 'Integrate Pulse into the workflow. Extract text from PDF documents, images, and Office files via upload.', + 'Integrate Pulse into the workflow. Extract text from PDF documents, images, and Office files via upload or file references.', subBlocks: pulseV2SubBlocks, tools: { access: ['pulse_parser_v2'], diff --git a/apps/sim/blocks/blocks/reducto.ts b/apps/sim/blocks/blocks/reducto.ts index 1050b3b13..8688341dd 100644 --- a/apps/sim/blocks/blocks/reducto.ts +++ b/apps/sim/blocks/blocks/reducto.ts @@ -138,16 +138,32 @@ export const ReductoBlock: BlockConfig = { const reductoV2Inputs = ReductoBlock.inputs ? Object.fromEntries(Object.entries(ReductoBlock.inputs).filter(([key]) => key !== 'filePath')) : {} -const reductoV2SubBlocks = (ReductoBlock.subBlocks || []).filter( - (subBlock) => subBlock.id !== 'filePath' -) +const reductoV2SubBlocks = (ReductoBlock.subBlocks || []).flatMap((subBlock) => { + if (subBlock.id === 'filePath') { + return [] + } + if (subBlock.id === 'fileUpload') { + return [ + subBlock, + { + id: 'fileReference', + title: 'PDF Document', + type: 'short-input' as SubBlockType, + canonicalParamId: 'document', + placeholder: 'File reference', + mode: 'advanced' as const, + }, + ] + } + return [subBlock] +}) export const ReductoV2Block: BlockConfig = { ...ReductoBlock, type: 'reducto_v2', - name: 'Reducto (File Only)', + name: 'Reducto', hideFromToolbar: false, - longDescription: `Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF documents.`, + longDescription: `Integrate Reducto Parse into the workflow. Can extract text from uploaded PDF documents or file references.`, subBlocks: reductoV2SubBlocks, tools: { access: ['reducto_parser_v2'], diff --git a/apps/sim/blocks/blocks/textract.ts b/apps/sim/blocks/blocks/textract.ts index 51e798970..f3c12c40b 100644 --- a/apps/sim/blocks/blocks/textract.ts +++ b/apps/sim/blocks/blocks/textract.ts @@ -195,14 +195,36 @@ export const TextractBlock: BlockConfig = { const textractV2Inputs = TextractBlock.inputs ? Object.fromEntries(Object.entries(TextractBlock.inputs).filter(([key]) => key !== 'filePath')) : {} -const textractV2SubBlocks = (TextractBlock.subBlocks || []).filter( - (subBlock) => subBlock.id !== 'filePath' -) +const textractV2SubBlocks = (TextractBlock.subBlocks || []).flatMap((subBlock) => { + if (subBlock.id === 'filePath') { + return [] // Remove the old filePath subblock + } + if (subBlock.id === 'fileUpload') { + // Insert fileReference right after fileUpload + return [ + subBlock, + { + id: 'fileReference', + title: 'Document', + type: 'short-input' as SubBlockType, + canonicalParamId: 'document', + placeholder: 'File reference', + condition: { + field: 'processingMode', + value: 'async', + not: true, + }, + mode: 'advanced' as const, + }, + ] + } + return [subBlock] +}) export const TextractV2Block: BlockConfig = { ...TextractBlock, type: 'textract_v2', - name: 'AWS Textract (File Only)', + name: 'AWS Textract', hideFromToolbar: false, subBlocks: textractV2SubBlocks, tools: {