@vertesia/workflow 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260227.112605Z
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/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js +33 -0
- package/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js.map +1 -0
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js +73 -0
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +1 -0
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js +19 -0
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js.map +1 -0
- package/lib/cjs/activities/chunkDocument.js +113 -0
- package/lib/cjs/activities/chunkDocument.js.map +1 -0
- package/lib/cjs/activities/copyParentArtifacts.js +127 -0
- package/lib/cjs/activities/copyParentArtifacts.js.map +1 -0
- package/lib/cjs/activities/createDocumentFromOther.js +64 -0
- package/lib/cjs/activities/createDocumentFromOther.js.map +1 -0
- package/lib/cjs/activities/executeInteraction.js +221 -0
- package/lib/cjs/activities/executeInteraction.js.map +1 -0
- package/lib/cjs/activities/extractDocumentText.js +196 -0
- package/lib/cjs/activities/extractDocumentText.js.map +1 -0
- package/lib/cjs/activities/generateDocumentProperties.js +109 -0
- package/lib/cjs/activities/generateDocumentProperties.js.map +1 -0
- package/lib/cjs/activities/generateEmbeddings.js +267 -0
- package/lib/cjs/activities/generateEmbeddings.js.map +1 -0
- package/lib/cjs/activities/generateOrAssignContentType.js +173 -0
- package/lib/cjs/activities/generateOrAssignContentType.js.map +1 -0
- package/lib/cjs/activities/getObjectFromStore.js +20 -0
- package/lib/cjs/activities/getObjectFromStore.js.map +1 -0
- package/lib/cjs/activities/handleError.js +22 -0
- package/lib/cjs/activities/handleError.js.map +1 -0
- package/lib/cjs/activities/index-dsl.js +53 -0
- package/lib/cjs/activities/index-dsl.js.map +1 -0
- package/lib/cjs/activities/index.js +21 -0
- package/lib/cjs/activities/index.js.map +1 -0
- package/lib/cjs/activities/media/prepareAudio.js +239 -0
- package/lib/cjs/activities/media/prepareAudio.js.map +1 -0
- package/lib/cjs/activities/media/prepareVideo.js +429 -0
- package/lib/cjs/activities/media/prepareVideo.js.map +1 -0
- package/lib/cjs/activities/media/processPdfWithTextract.js +103 -0
- package/lib/cjs/activities/media/processPdfWithTextract.js.map +1 -0
- package/lib/cjs/activities/media/saveGladiaTranscription.js +95 -0
- package/lib/cjs/activities/media/saveGladiaTranscription.js.map +1 -0
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js +99 -0
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js.map +1 -0
- package/lib/cjs/activities/mergeChildArtifacts.js +150 -0
- package/lib/cjs/activities/mergeChildArtifacts.js.map +1 -0
- package/lib/cjs/activities/notifyWebhook.js +167 -0
- package/lib/cjs/activities/notifyWebhook.js.map +1 -0
- package/lib/cjs/activities/rateLimiter.js +30 -0
- package/lib/cjs/activities/rateLimiter.js.map +1 -0
- package/lib/cjs/activities/renditions/generateImageRendition.js +66 -0
- package/lib/cjs/activities/renditions/generateImageRendition.js.map +1 -0
- package/lib/cjs/activities/renditions/generateVideoRendition.js +200 -0
- package/lib/cjs/activities/renditions/generateVideoRendition.js.map +1 -0
- package/lib/cjs/activities/setDocumentStatus.js +26 -0
- package/lib/cjs/activities/setDocumentStatus.js.map +1 -0
- package/lib/cjs/conversion/TextractProcessor.js +417 -0
- package/lib/cjs/conversion/TextractProcessor.js.map +1 -0
- package/lib/cjs/conversion/image.js +149 -0
- package/lib/cjs/conversion/image.js.map +1 -0
- package/lib/cjs/conversion/markitdown.js +42 -0
- package/lib/cjs/conversion/markitdown.js.map +1 -0
- package/lib/cjs/conversion/mutool.js +147 -0
- package/lib/cjs/conversion/mutool.js.map +1 -0
- package/lib/cjs/conversion/pandoc.js +39 -0
- package/lib/cjs/conversion/pandoc.js.map +1 -0
- package/lib/cjs/dsl/conditions.js +81 -0
- package/lib/cjs/dsl/conditions.js.map +1 -0
- package/lib/cjs/dsl/dsl-workflow.js +380 -0
- package/lib/cjs/dsl/dsl-workflow.js.map +1 -0
- package/lib/cjs/dsl/dslProxyActivities.js +23 -0
- package/lib/cjs/dsl/dslProxyActivities.js.map +1 -0
- package/lib/cjs/dsl/projections.js +59 -0
- package/lib/cjs/dsl/projections.js.map +1 -0
- package/lib/cjs/dsl/setup/ActivityContext.js +178 -0
- package/lib/cjs/dsl/setup/ActivityContext.js.map +1 -0
- package/lib/cjs/dsl/setup/fetch/DataProvider.js +51 -0
- package/lib/cjs/dsl/setup/fetch/DataProvider.js.map +1 -0
- package/lib/cjs/dsl/setup/fetch/index.js +16 -0
- package/lib/cjs/dsl/setup/fetch/index.js.map +1 -0
- package/lib/cjs/dsl/setup/fetch/providers.js +67 -0
- package/lib/cjs/dsl/setup/fetch/providers.js.map +1 -0
- package/lib/cjs/dsl/test/test-child-workflow.js +10 -0
- package/lib/cjs/dsl/test/test-child-workflow.js.map +1 -0
- package/lib/cjs/dsl/validation.js +122 -0
- package/lib/cjs/dsl/validation.js.map +1 -0
- package/lib/cjs/dsl/vars.js +341 -0
- package/lib/cjs/dsl/vars.js.map +1 -0
- package/lib/cjs/dsl/walk.js +100 -0
- package/lib/cjs/dsl/walk.js.map +1 -0
- package/lib/cjs/dsl.js +20 -0
- package/lib/cjs/dsl.js.map +1 -0
- package/lib/cjs/errors.js +89 -0
- package/lib/cjs/errors.js.map +1 -0
- package/lib/cjs/index.js +57 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/iterative-generation/activities/extractToc.js +47 -0
- package/lib/cjs/iterative-generation/activities/extractToc.js.map +1 -0
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js +72 -0
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js.map +1 -0
- package/lib/cjs/iterative-generation/activities/generatePart.js +78 -0
- package/lib/cjs/iterative-generation/activities/generatePart.js.map +1 -0
- package/lib/cjs/iterative-generation/activities/generateToc.js +86 -0
- package/lib/cjs/iterative-generation/activities/generateToc.js.map +1 -0
- package/lib/cjs/iterative-generation/activities/index.js +12 -0
- package/lib/cjs/iterative-generation/activities/index.js.map +1 -0
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js +56 -0
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js.map +1 -0
- package/lib/cjs/iterative-generation/types.js +5 -0
- package/lib/cjs/iterative-generation/types.js.map +1 -0
- package/lib/cjs/iterative-generation/utils.js +121 -0
- package/lib/cjs/iterative-generation/utils.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/result-types.js +10 -0
- package/lib/cjs/result-types.js.map +1 -0
- package/lib/cjs/system/notifyWebhookWorkflow.js +53 -0
- package/lib/cjs/system/notifyWebhookWorkflow.js.map +1 -0
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js +33 -0
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js.map +1 -0
- package/lib/cjs/utils/auth.js +15 -0
- package/lib/cjs/utils/auth.js.map +1 -0
- package/lib/cjs/utils/blobs.js +64 -0
- package/lib/cjs/utils/blobs.js.map +1 -0
- package/lib/cjs/utils/chunks.js +14 -0
- package/lib/cjs/utils/chunks.js.map +1 -0
- package/lib/cjs/utils/client.js +31 -0
- package/lib/cjs/utils/client.js.map +1 -0
- package/lib/cjs/utils/expand-vars.js +33 -0
- package/lib/cjs/utils/expand-vars.js.map +1 -0
- package/lib/cjs/utils/memory.js +65 -0
- package/lib/cjs/utils/memory.js.map +1 -0
- package/lib/cjs/utils/renditions.js +92 -0
- package/lib/cjs/utils/renditions.js.map +1 -0
- package/lib/cjs/utils/storage.js +54 -0
- package/lib/cjs/utils/storage.js.map +1 -0
- package/lib/cjs/utils/text-preview-utils.js +43 -0
- package/lib/cjs/utils/text-preview-utils.js.map +1 -0
- package/lib/cjs/utils/tokens.js +38 -0
- package/lib/cjs/utils/tokens.js.map +1 -0
- package/lib/cjs/vars.js +20 -0
- package/lib/cjs/vars.js.map +1 -0
- package/lib/cjs/workflows.js +15 -0
- package/lib/cjs/workflows.js.map +1 -0
- package/lib/esm/activities/advanced/createDocumentTypeFromInteractionRun.js +30 -0
- package/lib/esm/activities/advanced/createDocumentTypeFromInteractionRun.js.map +1 -0
- package/lib/esm/activities/advanced/createOrUpdateDocumentFromInteractionRun.js +70 -0
- package/lib/esm/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +1 -0
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js +16 -0
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js.map +1 -0
- package/lib/esm/activities/chunkDocument.js +110 -0
- package/lib/esm/activities/chunkDocument.js.map +1 -0
- package/lib/esm/activities/copyParentArtifacts.js +124 -0
- package/lib/esm/activities/copyParentArtifacts.js.map +1 -0
- package/lib/esm/activities/createDocumentFromOther.js +58 -0
- package/lib/esm/activities/createDocumentFromOther.js.map +1 -0
- package/lib/esm/activities/executeInteraction.js +217 -0
- package/lib/esm/activities/executeInteraction.js.map +1 -0
- package/lib/esm/activities/extractDocumentText.js +193 -0
- package/lib/esm/activities/extractDocumentText.js.map +1 -0
- package/lib/esm/activities/generateDocumentProperties.js +106 -0
- package/lib/esm/activities/generateDocumentProperties.js.map +1 -0
- package/lib/esm/activities/generateEmbeddings.js +264 -0
- package/lib/esm/activities/generateEmbeddings.js.map +1 -0
- package/lib/esm/activities/generateOrAssignContentType.js +170 -0
- package/lib/esm/activities/generateOrAssignContentType.js.map +1 -0
- package/lib/esm/activities/getObjectFromStore.js +17 -0
- package/lib/esm/activities/getObjectFromStore.js.map +1 -0
- package/lib/esm/activities/handleError.js +19 -0
- package/lib/esm/activities/handleError.js.map +1 -0
- package/lib/esm/activities/index-dsl.js +26 -0
- package/lib/esm/activities/index-dsl.js.map +1 -0
- package/lib/esm/activities/index.js +5 -0
- package/lib/esm/activities/index.js.map +1 -0
- package/lib/esm/activities/media/prepareAudio.js +200 -0
- package/lib/esm/activities/media/prepareAudio.js.map +1 -0
- package/lib/esm/activities/media/prepareVideo.js +390 -0
- package/lib/esm/activities/media/prepareVideo.js.map +1 -0
- package/lib/esm/activities/media/processPdfWithTextract.js +99 -0
- package/lib/esm/activities/media/processPdfWithTextract.js.map +1 -0
- package/lib/esm/activities/media/saveGladiaTranscription.js +92 -0
- package/lib/esm/activities/media/saveGladiaTranscription.js.map +1 -0
- package/lib/esm/activities/media/transcribeMediaWithGladia.js +96 -0
- package/lib/esm/activities/media/transcribeMediaWithGladia.js.map +1 -0
- package/lib/esm/activities/mergeChildArtifacts.js +147 -0
- package/lib/esm/activities/mergeChildArtifacts.js.map +1 -0
- package/lib/esm/activities/notifyWebhook.js +164 -0
- package/lib/esm/activities/notifyWebhook.js.map +1 -0
- package/lib/esm/activities/rateLimiter.js +27 -0
- package/lib/esm/activities/rateLimiter.js.map +1 -0
- package/lib/esm/activities/renditions/generateImageRendition.js +63 -0
- package/lib/esm/activities/renditions/generateImageRendition.js.map +1 -0
- package/lib/esm/activities/renditions/generateVideoRendition.js +194 -0
- package/lib/esm/activities/renditions/generateVideoRendition.js.map +1 -0
- package/lib/esm/activities/setDocumentStatus.js +23 -0
- package/lib/esm/activities/setDocumentStatus.js.map +1 -0
- package/lib/esm/conversion/TextractProcessor.js +410 -0
- package/lib/esm/conversion/TextractProcessor.js.map +1 -0
- package/lib/esm/conversion/image.js +143 -0
- package/lib/esm/conversion/image.js.map +1 -0
- package/lib/esm/conversion/markitdown.js +36 -0
- package/lib/esm/conversion/markitdown.js.map +1 -0
- package/lib/esm/conversion/mutool.js +139 -0
- package/lib/esm/conversion/mutool.js.map +1 -0
- package/lib/esm/conversion/pandoc.js +36 -0
- package/lib/esm/conversion/pandoc.js.map +1 -0
- package/lib/esm/dsl/conditions.js +75 -0
- package/lib/esm/dsl/conditions.js.map +1 -0
- package/lib/esm/dsl/dsl-workflow.js +373 -0
- package/lib/esm/dsl/dsl-workflow.js.map +1 -0
- package/lib/esm/dsl/dslProxyActivities.js +20 -0
- package/lib/esm/dsl/dslProxyActivities.js.map +1 -0
- package/lib/esm/dsl/projections.js +55 -0
- package/lib/esm/dsl/projections.js.map +1 -0
- package/lib/esm/dsl/setup/ActivityContext.js +173 -0
- package/lib/esm/dsl/setup/ActivityContext.js.map +1 -0
- package/lib/esm/dsl/setup/fetch/DataProvider.js +47 -0
- package/lib/esm/dsl/setup/fetch/DataProvider.js.map +1 -0
- package/lib/esm/dsl/setup/fetch/index.js +12 -0
- package/lib/esm/dsl/setup/fetch/index.js.map +1 -0
- package/lib/esm/dsl/setup/fetch/providers.js +61 -0
- package/lib/esm/dsl/setup/fetch/providers.js.map +1 -0
- package/lib/esm/dsl/test/test-child-workflow.js +5 -0
- package/lib/esm/dsl/test/test-child-workflow.js.map +1 -0
- package/lib/esm/dsl/validation.js +118 -0
- package/lib/esm/dsl/validation.js.map +1 -0
- package/lib/esm/dsl/vars.js +335 -0
- package/lib/esm/dsl/vars.js.map +1 -0
- package/lib/esm/dsl/walk.js +96 -0
- package/lib/esm/dsl/walk.js.map +1 -0
- package/lib/esm/dsl.js +4 -0
- package/lib/esm/dsl.js.map +1 -0
- package/lib/esm/errors.js +78 -0
- package/lib/esm/errors.js.map +1 -0
- package/lib/esm/index.js +39 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/iterative-generation/activities/extractToc.js +44 -0
- package/lib/esm/iterative-generation/activities/extractToc.js.map +1 -0
- package/lib/esm/iterative-generation/activities/finalizeOutput.js +69 -0
- package/lib/esm/iterative-generation/activities/finalizeOutput.js.map +1 -0
- package/lib/esm/iterative-generation/activities/generatePart.js +75 -0
- package/lib/esm/iterative-generation/activities/generatePart.js.map +1 -0
- package/lib/esm/iterative-generation/activities/generateToc.js +83 -0
- package/lib/esm/iterative-generation/activities/generateToc.js.map +1 -0
- package/lib/esm/iterative-generation/activities/index.js +5 -0
- package/lib/esm/iterative-generation/activities/index.js.map +1 -0
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js +53 -0
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js.map +1 -0
- package/lib/esm/iterative-generation/types.js +2 -0
- package/lib/esm/iterative-generation/types.js.map +1 -0
- package/lib/esm/iterative-generation/utils.js +112 -0
- package/lib/esm/iterative-generation/utils.js.map +1 -0
- package/lib/esm/result-types.js +7 -0
- package/lib/esm/result-types.js.map +1 -0
- package/lib/esm/system/notifyWebhookWorkflow.js +50 -0
- package/lib/esm/system/notifyWebhookWorkflow.js.map +1 -0
- package/lib/esm/system/recalculateEmbeddingsWorkflow.js +30 -0
- package/lib/esm/system/recalculateEmbeddingsWorkflow.js.map +1 -0
- package/lib/esm/utils/auth.js +8 -0
- package/lib/esm/utils/auth.js.map +1 -0
- package/lib/esm/utils/blobs.js +54 -0
- package/lib/esm/utils/blobs.js.map +1 -0
- package/lib/esm/utils/chunks.js +9 -0
- package/lib/esm/utils/chunks.js.map +1 -0
- package/lib/esm/utils/client.js +27 -0
- package/lib/esm/utils/client.js.map +1 -0
- package/lib/esm/utils/expand-vars.js +30 -0
- package/lib/esm/utils/expand-vars.js.map +1 -0
- package/lib/esm/utils/memory.js +55 -0
- package/lib/esm/utils/memory.js.map +1 -0
- package/lib/esm/utils/renditions.js +84 -0
- package/lib/esm/utils/renditions.js.map +1 -0
- package/lib/esm/utils/storage.js +45 -0
- package/lib/esm/utils/storage.js.map +1 -0
- package/lib/esm/utils/text-preview-utils.js +38 -0
- package/lib/esm/utils/text-preview-utils.js.map +1 -0
- package/lib/esm/utils/tokens.js +34 -0
- package/lib/esm/utils/tokens.js.map +1 -0
- package/lib/esm/vars.js +4 -0
- package/lib/esm/vars.js.map +1 -0
- package/lib/esm/workflows.js +8 -0
- package/lib/esm/workflows.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/activities/advanced/createDocumentTypeFromInteractionRun.d.ts +17 -0
- package/lib/types/activities/advanced/createDocumentTypeFromInteractionRun.d.ts.map +1 -0
- package/lib/types/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts +39 -0
- package/lib/types/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/types/activities/advanced/updateDocumentFromInteractionRun.d.ts +19 -0
- package/lib/types/activities/advanced/updateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/types/activities/chunkDocument.d.ts +33 -0
- package/lib/types/activities/chunkDocument.d.ts.map +1 -0
- package/lib/types/activities/copyParentArtifacts.d.ts +19 -0
- package/lib/types/activities/copyParentArtifacts.d.ts.map +1 -0
- package/lib/types/activities/createDocumentFromOther.d.ts +21 -0
- package/lib/types/activities/createDocumentFromOther.d.ts.map +1 -0
- package/lib/types/activities/executeInteraction.d.ts +61 -0
- package/lib/types/activities/executeInteraction.d.ts.map +1 -0
- package/lib/types/activities/extractDocumentText.d.ts +11 -0
- package/lib/types/activities/extractDocumentText.d.ts.map +1 -0
- package/lib/types/activities/generateDocumentProperties.d.ts +32 -0
- package/lib/types/activities/generateDocumentProperties.d.ts.map +1 -0
- package/lib/types/activities/generateEmbeddings.d.ts +53 -0
- package/lib/types/activities/generateEmbeddings.d.ts.map +1 -0
- package/lib/types/activities/generateOrAssignContentType.d.ts +44 -0
- package/lib/types/activities/generateOrAssignContentType.d.ts.map +1 -0
- package/lib/types/activities/getObjectFromStore.d.ts +14 -0
- package/lib/types/activities/getObjectFromStore.d.ts.map +1 -0
- package/lib/types/activities/handleError.d.ts +6 -0
- package/lib/types/activities/handleError.d.ts.map +1 -0
- package/lib/types/activities/index-dsl.d.ts +26 -0
- package/lib/types/activities/index-dsl.d.ts.map +1 -0
- package/lib/types/activities/index.d.ts +5 -0
- package/lib/types/activities/index.d.ts.map +1 -0
- package/lib/types/activities/media/prepareAudio.d.ts +25 -0
- package/lib/types/activities/media/prepareAudio.d.ts.map +1 -0
- package/lib/types/activities/media/prepareVideo.d.ts +30 -0
- package/lib/types/activities/media/prepareVideo.d.ts.map +1 -0
- package/lib/types/activities/media/processPdfWithTextract.d.ts +26 -0
- package/lib/types/activities/media/processPdfWithTextract.d.ts.map +1 -0
- package/lib/types/activities/media/saveGladiaTranscription.d.ts +15 -0
- package/lib/types/activities/media/saveGladiaTranscription.d.ts.map +1 -0
- package/lib/types/activities/media/transcribeMediaWithGladia.d.ts +20 -0
- package/lib/types/activities/media/transcribeMediaWithGladia.d.ts.map +1 -0
- package/lib/types/activities/mergeChildArtifacts.d.ts +24 -0
- package/lib/types/activities/mergeChildArtifacts.d.ts.map +1 -0
- package/lib/types/activities/notifyWebhook.d.ts +27 -0
- package/lib/types/activities/notifyWebhook.d.ts.map +1 -0
- package/lib/types/activities/rateLimiter.d.ts +11 -0
- package/lib/types/activities/rateLimiter.d.ts.map +1 -0
- package/lib/types/activities/renditions/generateImageRendition.d.ts +14 -0
- package/lib/types/activities/renditions/generateImageRendition.d.ts.map +1 -0
- package/lib/types/activities/renditions/generateVideoRendition.d.ts +15 -0
- package/lib/types/activities/renditions/generateVideoRendition.d.ts.map +1 -0
- package/lib/types/activities/setDocumentStatus.d.ts +15 -0
- package/lib/types/activities/setDocumentStatus.d.ts.map +1 -0
- package/lib/types/conversion/TextractProcessor.d.ts +45 -0
- package/lib/types/conversion/TextractProcessor.d.ts.map +1 -0
- package/lib/types/conversion/image.d.ts +13 -0
- package/lib/types/conversion/image.d.ts.map +1 -0
- package/lib/types/conversion/markitdown.d.ts +2 -0
- package/lib/types/conversion/markitdown.d.ts.map +1 -0
- package/lib/types/conversion/mutool.d.ts +19 -0
- package/lib/types/conversion/mutool.d.ts.map +1 -0
- package/lib/types/conversion/pandoc.d.ts +2 -0
- package/lib/types/conversion/pandoc.d.ts.map +1 -0
- package/lib/types/dsl/conditions.d.ts +2 -0
- package/lib/types/dsl/conditions.d.ts.map +1 -0
- package/lib/types/dsl/dsl-workflow.d.ts +5 -0
- package/lib/types/dsl/dsl-workflow.d.ts.map +1 -0
- package/lib/types/dsl/dslProxyActivities.d.ts +10 -0
- package/lib/types/dsl/dslProxyActivities.d.ts.map +1 -0
- package/lib/types/dsl/projections.d.ts +4 -0
- package/lib/types/dsl/projections.d.ts.map +1 -0
- package/lib/types/dsl/setup/ActivityContext.d.ts +47 -0
- package/lib/types/dsl/setup/ActivityContext.d.ts.map +1 -0
- package/lib/types/dsl/setup/fetch/DataProvider.d.ts +9 -0
- package/lib/types/dsl/setup/fetch/DataProvider.d.ts.map +1 -0
- package/lib/types/dsl/setup/fetch/index.d.ts +6 -0
- package/lib/types/dsl/setup/fetch/index.d.ts.map +1 -0
- package/lib/types/dsl/setup/fetch/providers.d.ts +25 -0
- package/lib/types/dsl/setup/fetch/providers.d.ts.map +1 -0
- package/lib/types/dsl/test/test-child-workflow.d.ts +4 -0
- package/lib/types/dsl/test/test-child-workflow.d.ts.map +1 -0
- package/lib/types/dsl/validation.d.ts +4 -0
- package/lib/types/dsl/validation.d.ts.map +1 -0
- package/lib/types/dsl/vars.d.ts +48 -0
- package/lib/types/dsl/vars.d.ts.map +1 -0
- package/lib/types/dsl/walk.d.ts +18 -0
- package/lib/types/dsl/walk.d.ts.map +1 -0
- package/lib/types/dsl.d.ts +4 -0
- package/lib/types/dsl.d.ts.map +1 -0
- package/lib/types/errors.d.ts +41 -0
- package/lib/types/errors.d.ts.map +1 -0
- package/lib/types/index.d.ts +38 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/iterative-generation/activities/extractToc.d.ts +10 -0
- package/lib/types/iterative-generation/activities/extractToc.d.ts.map +1 -0
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts +3 -0
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts.map +1 -0
- package/lib/types/iterative-generation/activities/generatePart.d.ts +3 -0
- package/lib/types/iterative-generation/activities/generatePart.d.ts.map +1 -0
- package/lib/types/iterative-generation/activities/generateToc.d.ts +4 -0
- package/lib/types/iterative-generation/activities/generateToc.d.ts.map +1 -0
- package/lib/types/iterative-generation/activities/index.d.ts +5 -0
- package/lib/types/iterative-generation/activities/index.d.ts.map +1 -0
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts +3 -0
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts.map +1 -0
- package/lib/types/iterative-generation/types.d.ts +79 -0
- package/lib/types/iterative-generation/types.d.ts.map +1 -0
- package/lib/types/iterative-generation/utils.d.ts +26 -0
- package/lib/types/iterative-generation/utils.d.ts.map +1 -0
- package/lib/types/result-types.d.ts +26 -0
- package/lib/types/result-types.d.ts.map +1 -0
- package/lib/types/system/notifyWebhookWorkflow.d.ts +8 -0
- package/lib/types/system/notifyWebhookWorkflow.d.ts.map +1 -0
- package/lib/types/system/recalculateEmbeddingsWorkflow.d.ts +25 -0
- package/lib/types/system/recalculateEmbeddingsWorkflow.d.ts.map +1 -0
- package/lib/types/utils/auth.d.ts +4 -0
- package/lib/types/utils/auth.d.ts.map +1 -0
- package/lib/types/utils/blobs.d.ts +7 -0
- package/lib/types/utils/blobs.d.ts.map +1 -0
- package/lib/types/utils/chunks.d.ts +9 -0
- package/lib/types/utils/chunks.d.ts.map +1 -0
- package/lib/types/utils/client.d.ts +8 -0
- package/lib/types/utils/client.d.ts.map +1 -0
- package/lib/types/utils/expand-vars.d.ts +8 -0
- package/lib/types/utils/expand-vars.d.ts.map +1 -0
- package/lib/types/utils/memory.d.ts +8 -0
- package/lib/types/utils/memory.d.ts.map +1 -0
- package/lib/types/utils/renditions.d.ts +25 -0
- package/lib/types/utils/renditions.d.ts.map +1 -0
- package/lib/types/utils/storage.d.ts +16 -0
- package/lib/types/utils/storage.d.ts.map +1 -0
- package/lib/types/utils/text-preview-utils.d.ts +15 -0
- package/lib/types/utils/text-preview-utils.d.ts.map +1 -0
- package/lib/types/utils/tokens.d.ts +11 -0
- package/lib/types/utils/tokens.d.ts.map +1 -0
- package/lib/types/vars.d.ts +3 -0
- package/lib/types/vars.d.ts.map +1 -0
- package/lib/types/workflows.d.ts +8 -0
- package/lib/types/workflows.d.ts.map +1 -0
- package/lib/workflows-bundle.js +18083 -0
- package/package.json +6 -7
- package/src/activities/advanced/createOrUpdateDocumentFromInteractionRun.ts +1 -1
- package/src/activities/chunkDocument.ts +35 -6
- package/src/activities/executeInteraction.ts +37 -5
- package/src/activities/extractDocumentText.ts +84 -28
- package/src/activities/generateDocumentProperties.ts +42 -15
- package/src/activities/generateEmbeddings.ts +9 -9
- package/src/activities/generateOrAssignContentType.ts +74 -24
- package/src/activities/index-dsl.ts +4 -3
- package/src/activities/media/saveGladiaTranscription.test.ts +406 -0
- package/src/activities/media/saveGladiaTranscription.ts +41 -26
- package/src/activities/media/transcribeMediaWithGladia.test.ts +583 -0
- package/src/activities/media/transcribeMediaWithGladia.ts +46 -25
- package/src/activities/notifyWebhook.test.ts +121 -8
- package/src/activities/notifyWebhook.ts +10 -2
- package/src/activities/renditions/generateImageRendition.ts +2 -2
- package/src/conversion/image.test.ts +1 -0
- package/src/conversion/image.ts +10 -10
- package/src/conversion/mutool.test.ts +1 -4
- package/src/conversion/pandoc.test.ts +1 -4
- package/src/dsl/dsl-workflow.ts +49 -9
- package/src/dsl/setup/ActivityContext.ts +73 -0
- package/src/dsl/workflow-exec-child.test.ts +12 -8
- package/src/dsl/workflow-fetch.test.ts +9 -6
- package/src/dsl/workflow-import.test.ts +10 -7
- package/src/dsl/workflow.test.ts +11 -8
- package/src/dsl.ts +1 -0
- package/src/errors.ts +14 -0
- package/src/index.ts +6 -5
- package/src/result-types.ts +5 -1
- package/src/utils/renditions.ts +11 -5
- package/src/utils/text-preview-utils.ts +62 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as protos from '@temporalio/proto';
|
|
2
2
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
3
|
-
import { Worker } from '@temporalio/worker';
|
|
3
|
+
import { Worker, bundleWorkflowCode, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
4
4
|
import { ContentEventName, DSLActivityExecutionPayload, DSLWorkflowExecutionPayload, DSLWorkflowStep } from '@vertesia/common';
|
|
5
5
|
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
|
|
6
6
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
@@ -119,6 +119,7 @@ const steps3: DSLWorkflowStep[] = [
|
|
|
119
119
|
describe('DSL Workflow with child workflows', () => {
|
|
120
120
|
|
|
121
121
|
let testEnv: TestWorkflowEnvironment;
|
|
122
|
+
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
122
123
|
|
|
123
124
|
beforeAll(async () => {
|
|
124
125
|
testEnv = await TestWorkflowEnvironment.createLocal();
|
|
@@ -133,7 +134,10 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
133
134
|
InitiatedBy: protos.temporal.api.enums.v1.IndexedValueType.INDEXED_VALUE_TYPE_KEYWORD,
|
|
134
135
|
},
|
|
135
136
|
});
|
|
136
|
-
|
|
137
|
+
workflowBundle = await bundleWorkflowCode({
|
|
138
|
+
workflowsPath: new URL('./test/test-child-workflow.ts', import.meta.url).pathname,
|
|
139
|
+
});
|
|
140
|
+
}, 60_000);
|
|
137
141
|
|
|
138
142
|
afterAll(async () => {
|
|
139
143
|
await testEnv?.teardown();
|
|
@@ -148,7 +152,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
148
152
|
const worker = await Worker.create({
|
|
149
153
|
connection: nativeConnection,
|
|
150
154
|
taskQueue,
|
|
151
|
-
|
|
155
|
+
workflowBundle,
|
|
152
156
|
activities: { sayHelloFromParent, prepareResult },
|
|
153
157
|
});
|
|
154
158
|
|
|
@@ -173,7 +177,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
173
177
|
}
|
|
174
178
|
}
|
|
175
179
|
|
|
176
|
-
|
|
180
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
177
181
|
args: [payload],
|
|
178
182
|
workflowId: 'test',
|
|
179
183
|
taskQueue,
|
|
@@ -192,7 +196,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
192
196
|
const worker = await Worker.create({
|
|
193
197
|
connection: nativeConnection,
|
|
194
198
|
taskQueue,
|
|
195
|
-
|
|
199
|
+
workflowBundle,
|
|
196
200
|
activities: { sayHelloFromParent, prepareResult, sayHelloFromDSLChild },
|
|
197
201
|
});
|
|
198
202
|
|
|
@@ -217,7 +221,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
217
221
|
}
|
|
218
222
|
}
|
|
219
223
|
|
|
220
|
-
|
|
224
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
221
225
|
args: [payload],
|
|
222
226
|
workflowId: 'test',
|
|
223
227
|
taskQueue,
|
|
@@ -236,7 +240,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
236
240
|
const worker = await Worker.create({
|
|
237
241
|
connection: nativeConnection,
|
|
238
242
|
taskQueue,
|
|
239
|
-
|
|
243
|
+
workflowBundle,
|
|
240
244
|
activities: { sayHelloFromParent, prepareResult, sayHelloFromDSLChild },
|
|
241
245
|
});
|
|
242
246
|
|
|
@@ -261,7 +265,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
261
265
|
}
|
|
262
266
|
}
|
|
263
267
|
|
|
264
|
-
|
|
268
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
265
269
|
args: [payload],
|
|
266
270
|
workflowId: 'test-vars',
|
|
267
271
|
taskQueue,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
2
|
+
import { Worker, bundleWorkflowCode, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
1
3
|
import { VertesiaClient } from '@vertesia/client';
|
|
2
4
|
import { ContentEventName, DSLActivityExecutionPayload, DSLActivitySpec, DSLWorkflowExecutionPayload, FindPayload } from '@vertesia/common';
|
|
3
|
-
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
4
|
-
import { Worker } from '@temporalio/worker';
|
|
5
5
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
6
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
7
7
|
import { setupActivity } from "./setup/ActivityContext.js";
|
|
@@ -77,10 +77,14 @@ const activities: DSLActivitySpec[] = [
|
|
|
77
77
|
describe('DSL Workflow', () => {
|
|
78
78
|
|
|
79
79
|
let testEnv: TestWorkflowEnvironment;
|
|
80
|
+
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
80
81
|
|
|
81
82
|
beforeAll(async () => {
|
|
82
83
|
testEnv = await TestWorkflowEnvironment.createLocal();
|
|
83
|
-
|
|
84
|
+
workflowBundle = await bundleWorkflowCode({
|
|
85
|
+
workflowsPath: new URL('./dsl-workflow.ts', import.meta.url).pathname,
|
|
86
|
+
});
|
|
87
|
+
}, 60_000);
|
|
84
88
|
|
|
85
89
|
afterAll(async () => {
|
|
86
90
|
await testEnv?.teardown();
|
|
@@ -95,7 +99,7 @@ describe('DSL Workflow', () => {
|
|
|
95
99
|
const worker = await Worker.create({
|
|
96
100
|
connection: nativeConnection,
|
|
97
101
|
taskQueue,
|
|
98
|
-
|
|
102
|
+
workflowBundle,
|
|
99
103
|
activities: { sayMessage },
|
|
100
104
|
});
|
|
101
105
|
|
|
@@ -105,7 +109,6 @@ describe('DSL Workflow', () => {
|
|
|
105
109
|
vars: {},
|
|
106
110
|
account_id: '123',
|
|
107
111
|
project_id: '123',
|
|
108
|
-
timestamp: Date.now(),
|
|
109
112
|
wf_rule_name: 'test',
|
|
110
113
|
auth_token: process.env.VERTESIA_KEY || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
111
114
|
config: {
|
|
@@ -121,7 +124,7 @@ describe('DSL Workflow', () => {
|
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
125
128
|
args: [payload],
|
|
126
129
|
workflowId: 'test',
|
|
127
130
|
taskQueue,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ContentEventName, DSLActivityExecutionPayload, DSLActivitySpec, DSLWorkflowExecutionPayload } from '@vertesia/common';
|
|
2
1
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
3
|
-
import { Worker } from '@temporalio/worker';
|
|
2
|
+
import { Worker, bundleWorkflowCode, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
3
|
+
import { ContentEventName, DSLActivityExecutionPayload, DSLActivitySpec, DSLWorkflowExecutionPayload } from '@vertesia/common';
|
|
4
4
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
5
5
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
6
6
|
import { setupActivity } from "./setup/ActivityContext.js";
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
async function testImportedVars(payload: DSLActivityExecutionPayload) {
|
|
9
|
+
async function testImportedVars(payload: DSLActivityExecutionPayload<Record<string, any>>) {
|
|
10
10
|
const { params } = await setupActivity(payload);
|
|
11
11
|
if (!params.object_name) throw new Error('object_name is required');
|
|
12
12
|
console.log('!!!!!!!!!!@@@@@@@@@@@@@@!!!!!!!!!!!!!!', params.object_name);
|
|
@@ -28,10 +28,14 @@ const activities: DSLActivitySpec[] = [
|
|
|
28
28
|
describe('DSL Workflow import vars', () => {
|
|
29
29
|
|
|
30
30
|
let testEnv: TestWorkflowEnvironment;
|
|
31
|
+
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
31
32
|
|
|
32
33
|
beforeAll(async () => {
|
|
33
34
|
testEnv = await TestWorkflowEnvironment.createLocal();
|
|
34
|
-
|
|
35
|
+
workflowBundle = await bundleWorkflowCode({
|
|
36
|
+
workflowsPath: new URL('./dsl-workflow.ts', import.meta.url).pathname,
|
|
37
|
+
});
|
|
38
|
+
}, 60_000);
|
|
35
39
|
|
|
36
40
|
afterAll(async () => {
|
|
37
41
|
await testEnv?.teardown();
|
|
@@ -49,7 +53,7 @@ describe('DSL Workflow import vars', () => {
|
|
|
49
53
|
const worker = await Worker.create({
|
|
50
54
|
connection: nativeConnection,
|
|
51
55
|
taskQueue,
|
|
52
|
-
|
|
56
|
+
workflowBundle,
|
|
53
57
|
activities: { testImportedVars },
|
|
54
58
|
});
|
|
55
59
|
|
|
@@ -59,7 +63,6 @@ describe('DSL Workflow import vars', () => {
|
|
|
59
63
|
vars: {},
|
|
60
64
|
account_id: '123',
|
|
61
65
|
project_id: '123',
|
|
62
|
-
timestamp: Date.now(),
|
|
63
66
|
wf_rule_name: 'test',
|
|
64
67
|
auth_token: process.env.VERTESIA_KEY || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
65
68
|
config: {
|
|
@@ -75,7 +78,7 @@ describe('DSL Workflow import vars', () => {
|
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
79
82
|
args: [payload],
|
|
80
83
|
workflowId: 'test',
|
|
81
84
|
taskQueue,
|
package/src/dsl/workflow.test.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import * as protos from '@temporalio/proto';
|
|
2
2
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
3
|
-
import { Worker } from '@temporalio/worker';
|
|
3
|
+
import { Worker, bundleWorkflowCode, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
4
4
|
import { ContentEventName, DSLActivityExecutionPayload, DSLActivitySpec, DSLWorkflowExecutionPayload } from '@vertesia/common';
|
|
5
5
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
6
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
7
7
|
import { setupActivity } from "./setup/ActivityContext.js";
|
|
8
8
|
|
|
9
|
-
async function sayHello(payload: DSLActivityExecutionPayload): Promise<string> {
|
|
9
|
+
async function sayHello(payload: DSLActivityExecutionPayload<Record<string, any>>): Promise<string> {
|
|
10
10
|
const { params } = await setupActivity(payload);
|
|
11
11
|
return params.lang === 'fr' ? "Bonjour" : "Hello";
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async function sayName(payload: DSLActivityExecutionPayload): Promise<string> {
|
|
14
|
+
async function sayName(payload: DSLActivityExecutionPayload<Record<string, any>>): Promise<string> {
|
|
15
15
|
const { params } = await setupActivity(payload);
|
|
16
16
|
return params.lang === 'fr' ? "Monde" : "World";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
async function sayGreeting(payload: DSLActivityExecutionPayload): Promise<string> {
|
|
19
|
+
async function sayGreeting(payload: DSLActivityExecutionPayload<Record<string, any>>): Promise<string> {
|
|
20
20
|
const { params } = await setupActivity(payload);
|
|
21
21
|
return `${params.hello}, ${params.name}!`;
|
|
22
22
|
}
|
|
@@ -50,6 +50,7 @@ const activities: DSLActivitySpec[] = [
|
|
|
50
50
|
describe('DSL Workflow', () => {
|
|
51
51
|
|
|
52
52
|
let testEnv: TestWorkflowEnvironment;
|
|
53
|
+
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
53
54
|
|
|
54
55
|
beforeAll(async () => {
|
|
55
56
|
testEnv = await TestWorkflowEnvironment.createLocal();
|
|
@@ -64,7 +65,10 @@ describe('DSL Workflow', () => {
|
|
|
64
65
|
InitiatedBy: protos.temporal.api.enums.v1.IndexedValueType.INDEXED_VALUE_TYPE_KEYWORD,
|
|
65
66
|
},
|
|
66
67
|
});
|
|
67
|
-
|
|
68
|
+
workflowBundle = await bundleWorkflowCode({
|
|
69
|
+
workflowsPath: new URL('./dsl-workflow.ts', import.meta.url).pathname,
|
|
70
|
+
});
|
|
71
|
+
}, 60_000);
|
|
68
72
|
|
|
69
73
|
afterAll(async () => {
|
|
70
74
|
await testEnv?.teardown();
|
|
@@ -79,7 +83,7 @@ describe('DSL Workflow', () => {
|
|
|
79
83
|
const worker = await Worker.create({
|
|
80
84
|
connection: nativeConnection,
|
|
81
85
|
taskQueue,
|
|
82
|
-
|
|
86
|
+
workflowBundle,
|
|
83
87
|
activities: { sayHello, sayName, sayGreeting },
|
|
84
88
|
});
|
|
85
89
|
|
|
@@ -89,7 +93,6 @@ describe('DSL Workflow', () => {
|
|
|
89
93
|
vars: {},
|
|
90
94
|
account_id: '123',
|
|
91
95
|
project_id: '123',
|
|
92
|
-
timestamp: Date.now(),
|
|
93
96
|
wf_rule_name: 'test',
|
|
94
97
|
auth_token: process.env.VERTESIA_KEY || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
95
98
|
config: {
|
|
@@ -105,7 +108,7 @@ describe('DSL Workflow', () => {
|
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
const result = await worker.runUntil(client.workflow.execute(dslWorkflow, {
|
|
109
112
|
args: [payload],
|
|
110
113
|
workflowId: 'test',
|
|
111
114
|
taskQueue,
|
package/src/dsl.ts
CHANGED
package/src/errors.ts
CHANGED
|
@@ -91,6 +91,19 @@ export class TokenExpiredError extends ApplicationFailure {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
export class WorkflowExecutionError extends ApplicationFailure {
|
|
95
|
+
constructor(
|
|
96
|
+
message: string,
|
|
97
|
+
public workflow?: DSLWorkflowSpec,
|
|
98
|
+
) {
|
|
99
|
+
super(
|
|
100
|
+
message,
|
|
101
|
+
"WorkflowExecutionError",
|
|
102
|
+
true, // non-retryable
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
94
107
|
export const WF_NON_RETRYABLE_ERRORS = [
|
|
95
108
|
"DocumentNotFoundError",
|
|
96
109
|
"ActivityParamInvalidError",
|
|
@@ -99,4 +112,5 @@ export const WF_NON_RETRYABLE_ERRORS = [
|
|
|
99
112
|
"InvalidContentTypeError",
|
|
100
113
|
"TokenExpiredError",
|
|
101
114
|
"ZenoClientNotFoundError",
|
|
115
|
+
"WorkflowExecutionError",
|
|
102
116
|
];
|
package/src/index.ts
CHANGED
|
@@ -18,15 +18,15 @@ export * from "./activities/executeInteraction.js";
|
|
|
18
18
|
export * from "./activities/extractDocumentText.js";
|
|
19
19
|
export * from "./activities/generateDocumentProperties.js";
|
|
20
20
|
export * from "./activities/generateEmbeddings.js";
|
|
21
|
-
export * from "./activities/renditions/generateImageRendition.js";
|
|
22
|
-
export * from "./activities/renditions/generateVideoRendition.js";
|
|
23
21
|
export * from "./activities/generateOrAssignContentType.js";
|
|
22
|
+
export * from "./activities/media/prepareAudio.js";
|
|
23
|
+
export * from "./activities/media/prepareVideo.js";
|
|
24
24
|
export * from "./activities/notifyWebhook.js";
|
|
25
25
|
export * from "./activities/rateLimiter.js";
|
|
26
|
+
export * from "./activities/renditions/generateImageRendition.js";
|
|
27
|
+
export * from "./activities/renditions/generateVideoRendition.js";
|
|
26
28
|
export * from "./activities/setDocumentStatus.js";
|
|
27
29
|
export * from "./iterative-generation/activities/index.js";
|
|
28
|
-
export * from "./activities/media/prepareVideo.js";
|
|
29
|
-
export * from "./activities/media/prepareAudio.js";
|
|
30
30
|
|
|
31
31
|
export * from "./dsl/setup/ActivityContext.js";
|
|
32
32
|
export * from "./errors.js";
|
|
@@ -34,8 +34,9 @@ export * from "./result-types.js";
|
|
|
34
34
|
export * from "./utils/blobs.js";
|
|
35
35
|
export * from "./utils/client.js";
|
|
36
36
|
export * from "./utils/memory.js";
|
|
37
|
-
export * from "./utils/tokens.js";
|
|
38
37
|
export * from "./utils/renditions.js";
|
|
39
38
|
export * from "./utils/storage.js";
|
|
39
|
+
export * from "./utils/text-preview-utils.js";
|
|
40
|
+
export * from "./utils/tokens.js";
|
|
40
41
|
|
|
41
42
|
export * from "./conversion/image.js";
|
package/src/result-types.ts
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
* The result of a text extraction operation.
|
|
6
6
|
*/
|
|
7
7
|
export interface TextExtractionResult {
|
|
8
|
-
objectId
|
|
8
|
+
objectId?: string;
|
|
9
|
+
file?: {
|
|
10
|
+
source_url: string;
|
|
11
|
+
result_url?: string;
|
|
12
|
+
}
|
|
9
13
|
status: TextExtractionStatus;
|
|
10
14
|
hasText: boolean;
|
|
11
15
|
message?: string;
|
package/src/utils/renditions.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { imageResizer } from "../conversion/image.js";
|
|
|
9
9
|
export interface ImageRenditionParams {
|
|
10
10
|
max_hw: number; //maximum size of the longest side of the image
|
|
11
11
|
format: ImageRenditionFormat;
|
|
12
|
+
/** Custom upload path — overrides default renditions/{etag}/{max_hw}/{page}.{format} path */
|
|
13
|
+
outputPath?: string;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -53,7 +55,7 @@ export async function uploadRenditionPages(
|
|
|
53
55
|
params: ImageRenditionParams,
|
|
54
56
|
concurrency?: number,
|
|
55
57
|
) {
|
|
56
|
-
log.
|
|
58
|
+
log.debug(
|
|
57
59
|
`Uploading rendition for etag ${contentEtag} with ${files.length} pages (max_hw: ${params.max_hw}, format: ${params.format})`,
|
|
58
60
|
{ files },
|
|
59
61
|
);
|
|
@@ -61,11 +63,15 @@ export async function uploadRenditionPages(
|
|
|
61
63
|
const limit = pLimit(concurrency ?? 20);
|
|
62
64
|
|
|
63
65
|
const uploads = files.map((file, i) => limit(async () => {
|
|
64
|
-
const pageId =
|
|
66
|
+
const pageId = params.outputPath
|
|
67
|
+
? (files.length === 1
|
|
68
|
+
? params.outputPath
|
|
69
|
+
: `${params.outputPath}/${String(i).padStart(4, "0")}.${params.format}`)
|
|
70
|
+
: getRenditionPagePath(contentEtag, params, i);
|
|
65
71
|
let resizedImagePath = null;
|
|
66
72
|
|
|
67
73
|
try {
|
|
68
|
-
log.
|
|
74
|
+
log.debug(`Resizing image for ${contentEtag} page ${i}`, {
|
|
69
75
|
file,
|
|
70
76
|
params,
|
|
71
77
|
});
|
|
@@ -87,7 +93,7 @@ export async function uploadRenditionPages(
|
|
|
87
93
|
pageId,
|
|
88
94
|
);
|
|
89
95
|
|
|
90
|
-
log.
|
|
96
|
+
log.debug(
|
|
91
97
|
`Uploading rendition for ${contentEtag} page ${i} with max_hw: ${params.max_hw} and format: ${params.format}`,
|
|
92
98
|
{
|
|
93
99
|
resizedImagePath,
|
|
@@ -110,7 +116,7 @@ export async function uploadRenditionPages(
|
|
|
110
116
|
);
|
|
111
117
|
return Promise.reject(`Upload failed: ${err.message}`);
|
|
112
118
|
});
|
|
113
|
-
log.
|
|
119
|
+
log.debug(`Rendition uploaded for ${contentEtag} page ${i}`, {
|
|
114
120
|
result,
|
|
115
121
|
});
|
|
116
122
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { log } from "@temporalio/activity";
|
|
2
|
+
import { VertesiaClient } from "@vertesia/client";
|
|
3
|
+
import { NodeStreamSource } from "@vertesia/client/node";
|
|
4
|
+
import { Readable } from "stream";
|
|
5
|
+
import { TextExtractionResult, TextExtractionStatus } from "../result-types.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Uploads extracted text preview to cloud storage
|
|
9
|
+
*/
|
|
10
|
+
export async function uploadTextPreviewToStorage(
|
|
11
|
+
vertesia: VertesiaClient,
|
|
12
|
+
text: string,
|
|
13
|
+
storagePath: string,
|
|
14
|
+
fileType: string
|
|
15
|
+
): Promise<string> {
|
|
16
|
+
|
|
17
|
+
const source = new NodeStreamSource(
|
|
18
|
+
Readable.from(text),
|
|
19
|
+
storagePath,
|
|
20
|
+
'text/markdown',
|
|
21
|
+
storagePath
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const uploadedPath = await vertesia.files.uploadFile(source);
|
|
25
|
+
log.info(`Uploaded ${fileType} preview text to ${uploadedPath}`);
|
|
26
|
+
|
|
27
|
+
return uploadedPath;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Creates the TextExtractionResult for file_source mode
|
|
32
|
+
*/
|
|
33
|
+
export function createFileSourceResult(
|
|
34
|
+
sourceUrl: string,
|
|
35
|
+
storagePath: string,
|
|
36
|
+
text: string | null
|
|
37
|
+
): TextExtractionResult {
|
|
38
|
+
return {
|
|
39
|
+
hasText: !!text,
|
|
40
|
+
file: {
|
|
41
|
+
source_url: sourceUrl,
|
|
42
|
+
result_url: text && storagePath ? storagePath : undefined,
|
|
43
|
+
},
|
|
44
|
+
status: TextExtractionStatus.success,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Saves extracted text to an object in the object store
|
|
50
|
+
*/
|
|
51
|
+
export async function saveTextToObject(
|
|
52
|
+
vertesia: VertesiaClient,
|
|
53
|
+
objectId: string,
|
|
54
|
+
text: string
|
|
55
|
+
): Promise<void> {
|
|
56
|
+
const object = await vertesia.objects.retrieve(objectId);
|
|
57
|
+
await vertesia.objects.update(objectId, {
|
|
58
|
+
text: text,
|
|
59
|
+
text_etag: object.content?.etag,
|
|
60
|
+
});
|
|
61
|
+
log.info(`Saved text to object ${objectId}`);
|
|
62
|
+
}
|