@vertesia/workflow 1.2.0 → 1.4.0-dev.20260615.042549Z
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 +1 -2
- package/lib/{types/activities → activities}/advanced/createDocumentTypeFromInteractionRun.d.ts +2 -2
- package/lib/activities/advanced/createDocumentTypeFromInteractionRun.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/advanced/createDocumentTypeFromInteractionRun.js +9 -9
- package/lib/activities/advanced/createDocumentTypeFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/advanced/createOrUpdateDocumentFromInteractionRun.d.ts +2 -2
- package/lib/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/advanced/createOrUpdateDocumentFromInteractionRun.js +29 -22
- package/lib/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/advanced/updateDocumentFromInteractionRun.d.ts +1 -1
- package/lib/activities/advanced/updateDocumentFromInteractionRun.d.ts.map +1 -0
- package/lib/activities/advanced/updateDocumentFromInteractionRun.js +16 -0
- package/lib/activities/advanced/updateDocumentFromInteractionRun.js.map +1 -0
- package/lib/{types/activities → activities}/chunkDocument.d.ts +3 -3
- package/lib/activities/chunkDocument.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/chunkDocument.js +38 -33
- package/lib/activities/chunkDocument.js.map +1 -0
- package/lib/{types/activities → activities}/createDocumentFromOther.d.ts +1 -1
- package/lib/activities/createDocumentFromOther.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/createDocumentFromOther.js +15 -13
- package/lib/activities/createDocumentFromOther.js.map +1 -0
- package/lib/{types/activities → activities}/executeInteraction.d.ts +19 -10
- package/lib/activities/executeInteraction.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/executeInteraction.js +97 -78
- package/lib/activities/executeInteraction.js.map +1 -0
- package/lib/{types/activities → activities}/executeRemoteActivity.d.ts +4 -4
- package/lib/activities/executeRemoteActivity.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/executeRemoteActivity.js +48 -23
- package/lib/activities/executeRemoteActivity.js.map +1 -0
- package/lib/{types/activities → activities}/extractDocumentText.d.ts +3 -3
- package/lib/activities/extractDocumentText.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/extractDocumentText.js +65 -52
- package/lib/activities/extractDocumentText.js.map +1 -0
- package/lib/{types/activities → activities}/generateDocumentProperties.d.ts +4 -4
- package/lib/activities/generateDocumentProperties.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateDocumentProperties.js +37 -33
- package/lib/activities/generateDocumentProperties.js.map +1 -0
- package/lib/{types/activities → activities}/generateEmbeddings.d.ts +3 -3
- package/lib/activities/generateEmbeddings.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateEmbeddings.js +80 -80
- package/lib/activities/generateEmbeddings.js.map +1 -0
- package/lib/{types/activities → activities}/generateOrAssignContentType.d.ts +4 -4
- package/lib/activities/generateOrAssignContentType.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/generateOrAssignContentType.js +51 -49
- package/lib/activities/generateOrAssignContentType.js.map +1 -0
- package/lib/{types/activities → activities}/getObjectFromStore.d.ts +1 -1
- package/lib/activities/getObjectFromStore.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/getObjectFromStore.js +4 -3
- package/lib/activities/getObjectFromStore.js.map +1 -0
- package/lib/{types/activities → activities}/handleError.d.ts +1 -1
- package/lib/activities/handleError.d.ts.map +1 -0
- package/lib/activities/handleError.js +37 -0
- package/lib/activities/handleError.js.map +1 -0
- package/lib/activities/index-dsl.d.ts +31 -0
- package/lib/activities/index-dsl.d.ts.map +1 -0
- package/lib/activities/index-dsl.js +29 -0
- package/lib/activities/index-dsl.js.map +1 -0
- package/lib/{types/activities → activities}/index.d.ts +1 -1
- package/lib/activities/index.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/index.js +1 -1
- package/lib/activities/index.js.map +1 -0
- package/lib/{types/activities → activities}/loadChildWorkflowSpec.d.ts +1 -1
- package/lib/activities/loadChildWorkflowSpec.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/loadChildWorkflowSpec.js +4 -2
- package/lib/activities/loadChildWorkflowSpec.js.map +1 -0
- package/lib/{types/activities → activities}/media/prepareAudio.d.ts +1 -1
- package/lib/activities/media/prepareAudio.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/prepareAudio.js +27 -23
- package/lib/activities/media/prepareAudio.js.map +1 -0
- package/lib/{types/activities → activities}/media/prepareVideo.d.ts +2 -2
- package/lib/activities/media/prepareVideo.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/prepareVideo.js +72 -54
- package/lib/activities/media/prepareVideo.js.map +1 -0
- package/lib/{types/activities → activities}/media/probeMediaStreams.d.ts +2 -3
- package/lib/activities/media/probeMediaStreams.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/probeMediaStreams.js +7 -5
- package/lib/activities/media/probeMediaStreams.js.map +1 -0
- package/lib/{types/activities → activities}/media/processPdfWithTextract.d.ts +3 -3
- package/lib/activities/media/processPdfWithTextract.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/processPdfWithTextract.js +43 -26
- package/lib/activities/media/processPdfWithTextract.js.map +1 -0
- package/lib/{types/activities → activities}/media/saveGladiaTranscription.d.ts +2 -2
- package/lib/activities/media/saveGladiaTranscription.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/saveGladiaTranscription.js +35 -25
- package/lib/activities/media/saveGladiaTranscription.js.map +1 -0
- package/lib/{types/activities → activities}/media/transcribeMediaWithGladia.d.ts +2 -2
- package/lib/activities/media/transcribeMediaWithGladia.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/media/transcribeMediaWithGladia.js +26 -21
- package/lib/activities/media/transcribeMediaWithGladia.js.map +1 -0
- package/lib/{types/activities → activities}/mergeChildArtifacts.d.ts +1 -1
- package/lib/activities/mergeChildArtifacts.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/mergeChildArtifacts.js +27 -26
- package/lib/activities/mergeChildArtifacts.js.map +1 -0
- package/lib/{types/activities → activities}/notifyWebhook.d.ts +6 -5
- package/lib/activities/notifyWebhook.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/notifyWebhook.js +20 -17
- package/lib/activities/notifyWebhook.js.map +1 -0
- package/lib/{types/activities → activities}/rateLimiter.d.ts +1 -1
- package/lib/activities/rateLimiter.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/rateLimiter.js +4 -3
- package/lib/activities/rateLimiter.js.map +1 -0
- package/lib/{types/activities → activities}/renditions/generateImageRendition.d.ts +3 -3
- package/lib/activities/renditions/generateImageRendition.d.ts.map +1 -0
- package/lib/activities/renditions/generateImageRendition.js +75 -0
- package/lib/activities/renditions/generateImageRendition.js.map +1 -0
- package/lib/{types/activities → activities}/renditions/generateVideoRendition.d.ts +3 -3
- package/lib/activities/renditions/generateVideoRendition.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/renditions/generateVideoRendition.js +51 -54
- package/lib/activities/renditions/generateVideoRendition.js.map +1 -0
- package/lib/{types/activities → activities}/resolveRemoteActivities.d.ts +3 -4
- package/lib/activities/resolveRemoteActivities.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/resolveRemoteActivities.js +16 -15
- package/lib/activities/resolveRemoteActivities.js.map +1 -0
- package/lib/{types/activities → activities}/setDocumentStatus.d.ts +1 -1
- package/lib/activities/setDocumentStatus.d.ts.map +1 -0
- package/lib/{esm/activities → activities}/setDocumentStatus.js +5 -3
- package/lib/activities/setDocumentStatus.js.map +1 -0
- package/lib/{types/bulk-import.d.ts → bulk-import.d.ts} +10 -1
- package/lib/bulk-import.d.ts.map +1 -0
- package/lib/bulk-import.js.map +1 -0
- package/lib/{types/conversion → conversion}/TextractProcessor.d.ts +7 -4
- package/lib/conversion/TextractProcessor.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/TextractProcessor.js +38 -38
- package/lib/conversion/TextractProcessor.js.map +1 -0
- package/lib/conversion/image.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/image.js +35 -35
- package/lib/conversion/image.js.map +1 -0
- package/lib/conversion/markitdown.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/markitdown.js +11 -11
- package/lib/conversion/markitdown.js.map +1 -0
- package/lib/conversion/mutool.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/mutool.js +19 -24
- package/lib/conversion/mutool.js.map +1 -0
- package/lib/conversion/pandoc.d.ts.map +1 -0
- package/lib/{esm/conversion → conversion}/pandoc.js +11 -11
- package/lib/conversion/pandoc.js.map +1 -0
- package/lib/dsl/conditions.d.ts +2 -0
- package/lib/dsl/conditions.d.ts.map +1 -0
- package/lib/dsl/conditions.js +90 -0
- package/lib/dsl/conditions.js.map +1 -0
- package/lib/{types/dsl → dsl}/dsl-workflow.d.ts +2 -2
- package/lib/dsl/dsl-workflow.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/dsl-workflow.js +93 -65
- package/lib/dsl/dsl-workflow.js.map +1 -0
- package/lib/dsl/dslProxyActivities.d.ts +7 -0
- package/lib/dsl/dslProxyActivities.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/dslProxyActivities.js +10 -1
- package/lib/dsl/dslProxyActivities.js.map +1 -0
- package/lib/dsl/projections.d.ts +4 -0
- package/lib/dsl/projections.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/projections.js +22 -8
- package/lib/dsl/projections.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/ActivityContext.d.ts +4 -4
- package/lib/dsl/setup/ActivityContext.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/ActivityContext.js +22 -25
- package/lib/dsl/setup/ActivityContext.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/fetch/DataProvider.d.ts +3 -3
- package/lib/dsl/setup/fetch/DataProvider.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/DataProvider.js +2 -1
- package/lib/dsl/setup/fetch/DataProvider.js.map +1 -0
- package/lib/dsl/setup/fetch/index.d.ts +6 -0
- package/lib/dsl/setup/fetch/index.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/index.js +1 -1
- package/lib/dsl/setup/fetch/index.js.map +1 -0
- package/lib/{types/dsl → dsl}/setup/fetch/providers.d.ts +6 -6
- package/lib/dsl/setup/fetch/providers.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/setup/fetch/providers.js +30 -16
- package/lib/dsl/setup/fetch/providers.js.map +1 -0
- package/lib/dsl/test/test-child-workflow.d.ts +4 -0
- package/lib/dsl/test/test-child-workflow.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/test/test-child-workflow.js +1 -1
- package/lib/dsl/test/test-child-workflow.js.map +1 -0
- package/lib/{types/dsl → dsl}/validation.d.ts +1 -1
- package/lib/dsl/validation.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/validation.js +8 -8
- package/lib/dsl/validation.js.map +1 -0
- package/lib/{types/dsl → dsl}/vars.d.ts +16 -16
- package/lib/dsl/vars.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/vars.js +20 -15
- package/lib/dsl/vars.js.map +1 -0
- package/lib/dsl/walk.d.ts +18 -0
- package/lib/dsl/walk.d.ts.map +1 -0
- package/lib/{esm/dsl → dsl}/walk.js +37 -16
- package/lib/dsl/walk.js.map +1 -0
- package/lib/dsl.d.ts +4 -0
- package/lib/dsl.d.ts.map +1 -0
- package/lib/dsl.js +4 -0
- package/lib/dsl.js.map +1 -0
- package/lib/{types/errors.d.ts → errors.d.ts} +2 -2
- package/lib/errors.d.ts.map +1 -0
- package/lib/{esm/errors.js → errors.js} +22 -17
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +36 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +37 -0
- package/lib/index.js.map +1 -0
- package/lib/result-types.d.ts.map +1 -0
- package/lib/result-types.js.map +1 -0
- package/lib/security/ssrf.d.ts.map +1 -0
- package/lib/security/ssrf.js.map +1 -0
- package/lib/system/notifyWebhookWorkflow.d.ts +8 -0
- package/lib/system/notifyWebhookWorkflow.d.ts.map +1 -0
- package/lib/{esm/system → system}/notifyWebhookWorkflow.js +13 -12
- package/lib/system/notifyWebhookWorkflow.js.map +1 -0
- package/lib/{types/system → system}/recalculateEmbeddingsWorkflow.d.ts +1 -1
- package/lib/system/recalculateEmbeddingsWorkflow.d.ts.map +1 -0
- package/lib/{esm/system → system}/recalculateEmbeddingsWorkflow.js +7 -7
- package/lib/system/recalculateEmbeddingsWorkflow.js.map +1 -0
- package/lib/utils/activity-info.d.ts +12 -0
- package/lib/utils/activity-info.d.ts.map +1 -0
- package/lib/utils/activity-info.js +15 -0
- package/lib/utils/activity-info.js.map +1 -0
- package/lib/{types/utils → utils}/auth.d.ts +1 -1
- package/lib/utils/auth.d.ts.map +1 -0
- package/lib/utils/auth.js.map +1 -0
- package/lib/{types/utils → utils}/blobs.d.ts +1 -1
- package/lib/utils/blobs.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/blobs.js +17 -16
- package/lib/utils/blobs.js.map +1 -0
- package/lib/utils/chunks.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/chunks.js +1 -1
- package/lib/utils/chunks.js.map +1 -0
- package/lib/utils/client.d.ts +8 -0
- package/lib/utils/client.d.ts.map +1 -0
- package/lib/utils/client.js +64 -0
- package/lib/utils/client.js.map +1 -0
- package/lib/{types/utils → utils}/expand-vars.d.ts +1 -1
- package/lib/utils/expand-vars.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/expand-vars.js +4 -1
- package/lib/utils/expand-vars.js.map +1 -0
- package/lib/{types/utils → utils}/renditions.d.ts +2 -2
- package/lib/utils/renditions.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/renditions.js +29 -18
- package/lib/utils/renditions.js.map +1 -0
- package/lib/{types/utils → utils}/storage.d.ts +2 -2
- package/lib/utils/storage.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/storage.js +13 -12
- package/lib/utils/storage.js.map +1 -0
- package/lib/{types/utils → utils}/text-preview-utils.d.ts +2 -2
- package/lib/utils/text-preview-utils.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/text-preview-utils.js +4 -4
- package/lib/utils/text-preview-utils.js.map +1 -0
- package/lib/{types/utils → utils}/tokens.d.ts +1 -1
- package/lib/utils/tokens.d.ts.map +1 -0
- package/lib/{esm/utils → utils}/tokens.js +3 -3
- package/lib/utils/tokens.js.map +1 -0
- package/lib/vars.d.ts +3 -0
- package/lib/vars.d.ts.map +1 -0
- package/lib/vars.js +4 -0
- package/lib/vars.js.map +1 -0
- package/lib/workflows-bundle.js +5735 -2815
- package/lib/workflows.d.ts +7 -0
- package/lib/workflows.d.ts.map +1 -0
- package/lib/workflows.js +7 -0
- package/lib/workflows.js.map +1 -0
- package/package.json +48 -89
- package/src/activities/advanced/createDocumentTypeFromInteractionRun.ts +30 -17
- package/src/activities/advanced/createOrUpdateDocumentFromInteractionRun.ts +51 -37
- package/src/activities/advanced/updateDocumentFromInteractionRun.ts +12 -11
- package/src/activities/chunkDocument.ts +87 -77
- package/src/activities/createDocumentFromOther.ts +19 -25
- package/src/activities/executeInteraction.test.ts +81 -8
- package/src/activities/executeInteraction.ts +147 -102
- package/src/activities/executeRemoteActivity.test.ts +61 -67
- package/src/activities/executeRemoteActivity.ts +56 -29
- package/src/activities/extractDocumentText.ts +75 -64
- package/src/activities/generateDocumentProperties.ts +69 -50
- package/src/activities/generateEmbeddings.test.ts +114 -0
- package/src/activities/generateEmbeddings.ts +113 -141
- package/src/activities/generateOrAssignContentType.ts +219 -231
- package/src/activities/getObjectFromStore.ts +11 -10
- package/src/activities/handleError.ts +23 -11
- package/src/activities/index-dsl.ts +30 -30
- package/src/activities/index.ts +1 -1
- package/src/activities/loadChildWorkflowSpec.ts +8 -3
- package/src/activities/media/prepareAudio.ts +47 -56
- package/src/activities/media/prepareVideo.ts +107 -122
- package/src/activities/media/probeMediaStreams.test.ts +11 -13
- package/src/activities/media/probeMediaStreams.ts +13 -15
- package/src/activities/media/processPdfWithTextract.ts +65 -46
- package/src/activities/media/saveGladiaTranscription.test.ts +122 -121
- package/src/activities/media/saveGladiaTranscription.ts +52 -26
- package/src/activities/media/transcribeMediaWithGladia.test.ts +173 -165
- package/src/activities/media/transcribeMediaWithGladia.ts +44 -28
- package/src/activities/mergeChildArtifacts.ts +36 -38
- package/src/activities/notifyWebhook.test.ts +223 -217
- package/src/activities/notifyWebhook.ts +67 -40
- package/src/activities/rateLimiter.ts +31 -30
- package/src/activities/renditions/generateImageRendition.ts +54 -64
- package/src/activities/renditions/generateVideoRendition.ts +87 -141
- package/src/activities/resolveRemoteActivities.test.ts +96 -88
- package/src/activities/resolveRemoteActivities.ts +32 -23
- package/src/activities/setDocumentStatus.ts +11 -7
- package/src/bulk-import.ts +11 -5
- package/src/conversion/TextractProcessor.ts +69 -71
- package/src/conversion/image.test.ts +31 -31
- package/src/conversion/image.ts +41 -38
- package/src/conversion/markitdown.ts +11 -11
- package/src/conversion/mutool.test.ts +77 -62
- package/src/conversion/mutool.ts +27 -49
- package/src/conversion/pandoc.test.ts +5 -6
- package/src/conversion/pandoc.ts +11 -11
- package/src/dsl/conditions.ts +35 -17
- package/src/dsl/dsl-workflow.test.ts +49 -39
- package/src/dsl/dsl-workflow.ts +200 -112
- package/src/dsl/dslProxyActivities.test.ts +23 -0
- package/src/dsl/dslProxyActivities.ts +46 -26
- package/src/dsl/ms.d.ts +34 -3
- package/src/dsl/projections.test.ts +108 -100
- package/src/dsl/projections.ts +46 -26
- package/src/dsl/setup/ActivityContext.test.ts +22 -23
- package/src/dsl/setup/ActivityContext.ts +39 -82
- package/src/dsl/setup/fetch/DataProvider.ts +11 -8
- package/src/dsl/setup/fetch/index.ts +6 -8
- package/src/dsl/setup/fetch/providers.ts +38 -24
- package/src/dsl/test/test-child-workflow.ts +3 -2
- package/src/dsl/validation.test.ts +232 -213
- package/src/dsl/validation.ts +17 -12
- package/src/dsl/vars.test.ts +143 -140
- package/src/dsl/vars.ts +61 -54
- package/src/dsl/walk.test.ts +61 -56
- package/src/dsl/walk.ts +61 -35
- package/src/dsl/workflow-exec-child.test.ts +77 -61
- package/src/dsl/workflow-fetch.test.ts +40 -38
- package/src/dsl/workflow-import.test.ts +27 -27
- package/src/dsl/workflow.test.ts +34 -33
- package/src/dsl.ts +3 -4
- package/src/errors.ts +31 -23
- package/src/index.ts +28 -33
- package/src/result-types.ts +6 -9
- package/src/system/notifyWebhookWorkflow.ts +23 -23
- package/src/system/recalculateEmbeddingsWorkflow.ts +14 -17
- package/src/utils/activity-info.ts +15 -0
- package/src/utils/auth.ts +1 -1
- package/src/utils/blobs.ts +19 -18
- package/src/utils/chunks.ts +7 -8
- package/src/utils/client.ts +57 -17
- package/src/utils/expand-vars.ts +9 -6
- package/src/utils/renditions.ts +68 -72
- package/src/utils/storage.ts +18 -22
- package/src/utils/text-preview-utils.ts +9 -19
- package/src/utils/tokens.ts +9 -11
- package/src/vars.ts +2 -2
- package/src/workflows.ts +3 -4
- package/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js +0 -33
- package/lib/cjs/activities/advanced/createDocumentTypeFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js +0 -73
- package/lib/cjs/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js +0 -19
- package/lib/cjs/activities/advanced/updateDocumentFromInteractionRun.js.map +0 -1
- package/lib/cjs/activities/chunkDocument.js +0 -111
- package/lib/cjs/activities/chunkDocument.js.map +0 -1
- package/lib/cjs/activities/createDocumentFromOther.js +0 -64
- package/lib/cjs/activities/createDocumentFromOther.js.map +0 -1
- package/lib/cjs/activities/executeInteraction.js +0 -241
- package/lib/cjs/activities/executeInteraction.js.map +0 -1
- package/lib/cjs/activities/executeRemoteActivity.js +0 -126
- package/lib/cjs/activities/executeRemoteActivity.js.map +0 -1
- package/lib/cjs/activities/extractDocumentText.js +0 -196
- package/lib/cjs/activities/extractDocumentText.js.map +0 -1
- package/lib/cjs/activities/generateDocumentProperties.js +0 -109
- package/lib/cjs/activities/generateDocumentProperties.js.map +0 -1
- package/lib/cjs/activities/generateEmbeddings.js +0 -269
- package/lib/cjs/activities/generateEmbeddings.js.map +0 -1
- package/lib/cjs/activities/generateOrAssignContentType.js +0 -173
- package/lib/cjs/activities/generateOrAssignContentType.js.map +0 -1
- package/lib/cjs/activities/getObjectFromStore.js +0 -31
- package/lib/cjs/activities/getObjectFromStore.js.map +0 -1
- package/lib/cjs/activities/handleError.js +0 -29
- package/lib/cjs/activities/handleError.js.map +0 -1
- package/lib/cjs/activities/index-dsl.js +0 -59
- package/lib/cjs/activities/index-dsl.js.map +0 -1
- package/lib/cjs/activities/index.js +0 -21
- package/lib/cjs/activities/index.js.map +0 -1
- package/lib/cjs/activities/loadChildWorkflowSpec.js +0 -15
- package/lib/cjs/activities/loadChildWorkflowSpec.js.map +0 -1
- package/lib/cjs/activities/media/prepareAudio.js +0 -240
- package/lib/cjs/activities/media/prepareAudio.js.map +0 -1
- package/lib/cjs/activities/media/prepareVideo.js +0 -432
- package/lib/cjs/activities/media/prepareVideo.js.map +0 -1
- package/lib/cjs/activities/media/probeMediaStreams.js +0 -49
- package/lib/cjs/activities/media/probeMediaStreams.js.map +0 -1
- package/lib/cjs/activities/media/processPdfWithTextract.js +0 -103
- package/lib/cjs/activities/media/processPdfWithTextract.js.map +0 -1
- package/lib/cjs/activities/media/saveGladiaTranscription.js +0 -103
- package/lib/cjs/activities/media/saveGladiaTranscription.js.map +0 -1
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js +0 -107
- package/lib/cjs/activities/media/transcribeMediaWithGladia.js.map +0 -1
- package/lib/cjs/activities/mergeChildArtifacts.js +0 -150
- package/lib/cjs/activities/mergeChildArtifacts.js.map +0 -1
- package/lib/cjs/activities/notifyWebhook.js +0 -167
- package/lib/cjs/activities/notifyWebhook.js.map +0 -1
- package/lib/cjs/activities/rateLimiter.js +0 -30
- package/lib/cjs/activities/rateLimiter.js.map +0 -1
- package/lib/cjs/activities/renditions/generateImageRendition.js +0 -66
- package/lib/cjs/activities/renditions/generateImageRendition.js.map +0 -1
- package/lib/cjs/activities/renditions/generateVideoRendition.js +0 -200
- package/lib/cjs/activities/renditions/generateVideoRendition.js.map +0 -1
- package/lib/cjs/activities/resolveRemoteActivities.js +0 -133
- package/lib/cjs/activities/resolveRemoteActivities.js.map +0 -1
- package/lib/cjs/activities/setDocumentStatus.js +0 -26
- package/lib/cjs/activities/setDocumentStatus.js.map +0 -1
- package/lib/cjs/bulk-import.js +0 -12
- package/lib/cjs/bulk-import.js.map +0 -1
- package/lib/cjs/conversion/TextractProcessor.js +0 -417
- package/lib/cjs/conversion/TextractProcessor.js.map +0 -1
- package/lib/cjs/conversion/image.js +0 -149
- package/lib/cjs/conversion/image.js.map +0 -1
- package/lib/cjs/conversion/markitdown.js +0 -42
- package/lib/cjs/conversion/markitdown.js.map +0 -1
- package/lib/cjs/conversion/mutool.js +0 -147
- package/lib/cjs/conversion/mutool.js.map +0 -1
- package/lib/cjs/conversion/pandoc.js +0 -39
- package/lib/cjs/conversion/pandoc.js.map +0 -1
- package/lib/cjs/dsl/conditions.js +0 -81
- package/lib/cjs/dsl/conditions.js.map +0 -1
- package/lib/cjs/dsl/dsl-workflow.js +0 -458
- package/lib/cjs/dsl/dsl-workflow.js.map +0 -1
- package/lib/cjs/dsl/dslProxyActivities.js +0 -23
- package/lib/cjs/dsl/dslProxyActivities.js.map +0 -1
- package/lib/cjs/dsl/projections.js +0 -59
- package/lib/cjs/dsl/projections.js.map +0 -1
- package/lib/cjs/dsl/setup/ActivityContext.js +0 -188
- package/lib/cjs/dsl/setup/ActivityContext.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/DataProvider.js +0 -51
- package/lib/cjs/dsl/setup/fetch/DataProvider.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/index.js +0 -16
- package/lib/cjs/dsl/setup/fetch/index.js.map +0 -1
- package/lib/cjs/dsl/setup/fetch/providers.js +0 -67
- package/lib/cjs/dsl/setup/fetch/providers.js.map +0 -1
- package/lib/cjs/dsl/test/test-child-workflow.js +0 -10
- package/lib/cjs/dsl/test/test-child-workflow.js.map +0 -1
- package/lib/cjs/dsl/validation.js +0 -122
- package/lib/cjs/dsl/validation.js.map +0 -1
- package/lib/cjs/dsl/vars.js +0 -341
- package/lib/cjs/dsl/vars.js.map +0 -1
- package/lib/cjs/dsl/walk.js +0 -100
- package/lib/cjs/dsl/walk.js.map +0 -1
- package/lib/cjs/dsl.js +0 -20
- package/lib/cjs/dsl.js.map +0 -1
- package/lib/cjs/errors.js +0 -89
- package/lib/cjs/errors.js.map +0 -1
- package/lib/cjs/index.js +0 -57
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/extractToc.js +0 -47
- package/lib/cjs/iterative-generation/activities/extractToc.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js +0 -72
- package/lib/cjs/iterative-generation/activities/finalizeOutput.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/generatePart.js +0 -78
- package/lib/cjs/iterative-generation/activities/generatePart.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/generateToc.js +0 -86
- package/lib/cjs/iterative-generation/activities/generateToc.js.map +0 -1
- package/lib/cjs/iterative-generation/activities/index.js +0 -12
- package/lib/cjs/iterative-generation/activities/index.js.map +0 -1
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js +0 -56
- package/lib/cjs/iterative-generation/iterativeGenerationWorkflow.js.map +0 -1
- package/lib/cjs/iterative-generation/types.js +0 -5
- package/lib/cjs/iterative-generation/types.js.map +0 -1
- package/lib/cjs/iterative-generation/utils.js +0 -121
- package/lib/cjs/iterative-generation/utils.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/result-types.js +0 -10
- package/lib/cjs/result-types.js.map +0 -1
- package/lib/cjs/security/ssrf.js +0 -34
- package/lib/cjs/security/ssrf.js.map +0 -1
- package/lib/cjs/system/notifyWebhookWorkflow.js +0 -53
- package/lib/cjs/system/notifyWebhookWorkflow.js.map +0 -1
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js +0 -33
- package/lib/cjs/system/recalculateEmbeddingsWorkflow.js.map +0 -1
- package/lib/cjs/utils/auth.js +0 -15
- package/lib/cjs/utils/auth.js.map +0 -1
- package/lib/cjs/utils/blobs.js +0 -64
- package/lib/cjs/utils/blobs.js.map +0 -1
- package/lib/cjs/utils/chunks.js +0 -14
- package/lib/cjs/utils/chunks.js.map +0 -1
- package/lib/cjs/utils/client.js +0 -31
- package/lib/cjs/utils/client.js.map +0 -1
- package/lib/cjs/utils/expand-vars.js +0 -33
- package/lib/cjs/utils/expand-vars.js.map +0 -1
- package/lib/cjs/utils/memory.js +0 -65
- package/lib/cjs/utils/memory.js.map +0 -1
- package/lib/cjs/utils/renditions.js +0 -92
- package/lib/cjs/utils/renditions.js.map +0 -1
- package/lib/cjs/utils/storage.js +0 -54
- package/lib/cjs/utils/storage.js.map +0 -1
- package/lib/cjs/utils/text-preview-utils.js +0 -43
- package/lib/cjs/utils/text-preview-utils.js.map +0 -1
- package/lib/cjs/utils/tokens.js +0 -38
- package/lib/cjs/utils/tokens.js.map +0 -1
- package/lib/cjs/vars.js +0 -20
- package/lib/cjs/vars.js.map +0 -1
- package/lib/cjs/workflows.js +0 -15
- package/lib/cjs/workflows.js.map +0 -1
- package/lib/esm/activities/advanced/createDocumentTypeFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/advanced/createOrUpdateDocumentFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js +0 -16
- package/lib/esm/activities/advanced/updateDocumentFromInteractionRun.js.map +0 -1
- package/lib/esm/activities/chunkDocument.js.map +0 -1
- package/lib/esm/activities/createDocumentFromOther.js.map +0 -1
- package/lib/esm/activities/executeInteraction.js.map +0 -1
- package/lib/esm/activities/executeRemoteActivity.js.map +0 -1
- package/lib/esm/activities/extractDocumentText.js.map +0 -1
- package/lib/esm/activities/generateDocumentProperties.js.map +0 -1
- package/lib/esm/activities/generateEmbeddings.js.map +0 -1
- package/lib/esm/activities/generateOrAssignContentType.js.map +0 -1
- package/lib/esm/activities/getObjectFromStore.js.map +0 -1
- package/lib/esm/activities/handleError.js +0 -26
- package/lib/esm/activities/handleError.js.map +0 -1
- package/lib/esm/activities/index-dsl.js +0 -29
- package/lib/esm/activities/index-dsl.js.map +0 -1
- package/lib/esm/activities/index.js.map +0 -1
- package/lib/esm/activities/loadChildWorkflowSpec.js.map +0 -1
- package/lib/esm/activities/media/prepareAudio.js.map +0 -1
- package/lib/esm/activities/media/prepareVideo.js.map +0 -1
- package/lib/esm/activities/media/probeMediaStreams.js.map +0 -1
- package/lib/esm/activities/media/processPdfWithTextract.js.map +0 -1
- package/lib/esm/activities/media/saveGladiaTranscription.js.map +0 -1
- package/lib/esm/activities/media/transcribeMediaWithGladia.js.map +0 -1
- package/lib/esm/activities/mergeChildArtifacts.js.map +0 -1
- package/lib/esm/activities/notifyWebhook.js.map +0 -1
- package/lib/esm/activities/rateLimiter.js.map +0 -1
- package/lib/esm/activities/renditions/generateImageRendition.js +0 -63
- package/lib/esm/activities/renditions/generateImageRendition.js.map +0 -1
- package/lib/esm/activities/renditions/generateVideoRendition.js.map +0 -1
- package/lib/esm/activities/resolveRemoteActivities.js.map +0 -1
- package/lib/esm/activities/setDocumentStatus.js.map +0 -1
- package/lib/esm/bulk-import.js.map +0 -1
- package/lib/esm/conversion/TextractProcessor.js.map +0 -1
- package/lib/esm/conversion/image.js.map +0 -1
- package/lib/esm/conversion/markitdown.js.map +0 -1
- package/lib/esm/conversion/mutool.js.map +0 -1
- package/lib/esm/conversion/pandoc.js.map +0 -1
- package/lib/esm/dsl/conditions.js +0 -75
- package/lib/esm/dsl/conditions.js.map +0 -1
- package/lib/esm/dsl/dsl-workflow.js.map +0 -1
- package/lib/esm/dsl/dslProxyActivities.js.map +0 -1
- package/lib/esm/dsl/projections.js.map +0 -1
- package/lib/esm/dsl/setup/ActivityContext.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/DataProvider.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/index.js.map +0 -1
- package/lib/esm/dsl/setup/fetch/providers.js.map +0 -1
- package/lib/esm/dsl/test/test-child-workflow.js.map +0 -1
- package/lib/esm/dsl/validation.js.map +0 -1
- package/lib/esm/dsl/vars.js.map +0 -1
- package/lib/esm/dsl/walk.js.map +0 -1
- package/lib/esm/dsl.js +0 -4
- package/lib/esm/dsl.js.map +0 -1
- package/lib/esm/errors.js.map +0 -1
- package/lib/esm/index.js +0 -39
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/iterative-generation/activities/extractToc.js +0 -44
- package/lib/esm/iterative-generation/activities/extractToc.js.map +0 -1
- package/lib/esm/iterative-generation/activities/finalizeOutput.js +0 -69
- package/lib/esm/iterative-generation/activities/finalizeOutput.js.map +0 -1
- package/lib/esm/iterative-generation/activities/generatePart.js +0 -75
- package/lib/esm/iterative-generation/activities/generatePart.js.map +0 -1
- package/lib/esm/iterative-generation/activities/generateToc.js +0 -83
- package/lib/esm/iterative-generation/activities/generateToc.js.map +0 -1
- package/lib/esm/iterative-generation/activities/index.js +0 -5
- package/lib/esm/iterative-generation/activities/index.js.map +0 -1
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js +0 -53
- package/lib/esm/iterative-generation/iterativeGenerationWorkflow.js.map +0 -1
- package/lib/esm/iterative-generation/types.js +0 -2
- package/lib/esm/iterative-generation/types.js.map +0 -1
- package/lib/esm/iterative-generation/utils.js +0 -112
- package/lib/esm/iterative-generation/utils.js.map +0 -1
- package/lib/esm/result-types.js.map +0 -1
- package/lib/esm/security/ssrf.js.map +0 -1
- package/lib/esm/system/notifyWebhookWorkflow.js.map +0 -1
- package/lib/esm/system/recalculateEmbeddingsWorkflow.js.map +0 -1
- package/lib/esm/utils/auth.js.map +0 -1
- package/lib/esm/utils/blobs.js.map +0 -1
- package/lib/esm/utils/chunks.js.map +0 -1
- package/lib/esm/utils/client.js +0 -27
- package/lib/esm/utils/client.js.map +0 -1
- package/lib/esm/utils/expand-vars.js.map +0 -1
- package/lib/esm/utils/memory.js +0 -55
- package/lib/esm/utils/memory.js.map +0 -1
- package/lib/esm/utils/renditions.js.map +0 -1
- package/lib/esm/utils/storage.js.map +0 -1
- package/lib/esm/utils/text-preview-utils.js.map +0 -1
- package/lib/esm/utils/tokens.js.map +0 -1
- package/lib/esm/vars.js +0 -4
- package/lib/esm/vars.js.map +0 -1
- package/lib/esm/workflows.js +0 -8
- package/lib/esm/workflows.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/activities/advanced/createDocumentTypeFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/advanced/createOrUpdateDocumentFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/advanced/updateDocumentFromInteractionRun.d.ts.map +0 -1
- package/lib/types/activities/chunkDocument.d.ts.map +0 -1
- package/lib/types/activities/createDocumentFromOther.d.ts.map +0 -1
- package/lib/types/activities/executeInteraction.d.ts.map +0 -1
- package/lib/types/activities/executeRemoteActivity.d.ts.map +0 -1
- package/lib/types/activities/extractDocumentText.d.ts.map +0 -1
- package/lib/types/activities/generateDocumentProperties.d.ts.map +0 -1
- package/lib/types/activities/generateEmbeddings.d.ts.map +0 -1
- package/lib/types/activities/generateOrAssignContentType.d.ts.map +0 -1
- package/lib/types/activities/getObjectFromStore.d.ts.map +0 -1
- package/lib/types/activities/handleError.d.ts.map +0 -1
- package/lib/types/activities/index-dsl.d.ts +0 -31
- package/lib/types/activities/index-dsl.d.ts.map +0 -1
- package/lib/types/activities/index.d.ts.map +0 -1
- package/lib/types/activities/loadChildWorkflowSpec.d.ts.map +0 -1
- package/lib/types/activities/media/prepareAudio.d.ts.map +0 -1
- package/lib/types/activities/media/prepareVideo.d.ts.map +0 -1
- package/lib/types/activities/media/probeMediaStreams.d.ts.map +0 -1
- package/lib/types/activities/media/processPdfWithTextract.d.ts.map +0 -1
- package/lib/types/activities/media/saveGladiaTranscription.d.ts.map +0 -1
- package/lib/types/activities/media/transcribeMediaWithGladia.d.ts.map +0 -1
- package/lib/types/activities/mergeChildArtifacts.d.ts.map +0 -1
- package/lib/types/activities/notifyWebhook.d.ts.map +0 -1
- package/lib/types/activities/rateLimiter.d.ts.map +0 -1
- package/lib/types/activities/renditions/generateImageRendition.d.ts.map +0 -1
- package/lib/types/activities/renditions/generateVideoRendition.d.ts.map +0 -1
- package/lib/types/activities/resolveRemoteActivities.d.ts.map +0 -1
- package/lib/types/activities/setDocumentStatus.d.ts.map +0 -1
- package/lib/types/bulk-import.d.ts.map +0 -1
- package/lib/types/conversion/TextractProcessor.d.ts.map +0 -1
- package/lib/types/conversion/image.d.ts.map +0 -1
- package/lib/types/conversion/markitdown.d.ts.map +0 -1
- package/lib/types/conversion/mutool.d.ts.map +0 -1
- package/lib/types/conversion/pandoc.d.ts.map +0 -1
- package/lib/types/dsl/conditions.d.ts +0 -2
- package/lib/types/dsl/conditions.d.ts.map +0 -1
- package/lib/types/dsl/dsl-workflow.d.ts.map +0 -1
- package/lib/types/dsl/dslProxyActivities.d.ts +0 -10
- package/lib/types/dsl/dslProxyActivities.d.ts.map +0 -1
- package/lib/types/dsl/projections.d.ts +0 -4
- package/lib/types/dsl/projections.d.ts.map +0 -1
- package/lib/types/dsl/setup/ActivityContext.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/DataProvider.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/index.d.ts +0 -6
- package/lib/types/dsl/setup/fetch/index.d.ts.map +0 -1
- package/lib/types/dsl/setup/fetch/providers.d.ts.map +0 -1
- package/lib/types/dsl/test/test-child-workflow.d.ts +0 -4
- package/lib/types/dsl/test/test-child-workflow.d.ts.map +0 -1
- package/lib/types/dsl/validation.d.ts.map +0 -1
- package/lib/types/dsl/vars.d.ts.map +0 -1
- package/lib/types/dsl/walk.d.ts +0 -18
- package/lib/types/dsl/walk.d.ts.map +0 -1
- package/lib/types/dsl.d.ts +0 -4
- package/lib/types/dsl.d.ts.map +0 -1
- package/lib/types/errors.d.ts.map +0 -1
- package/lib/types/index.d.ts +0 -38
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/extractToc.d.ts +0 -10
- package/lib/types/iterative-generation/activities/extractToc.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts +0 -3
- package/lib/types/iterative-generation/activities/finalizeOutput.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/generatePart.d.ts +0 -3
- package/lib/types/iterative-generation/activities/generatePart.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/generateToc.d.ts +0 -4
- package/lib/types/iterative-generation/activities/generateToc.d.ts.map +0 -1
- package/lib/types/iterative-generation/activities/index.d.ts +0 -5
- package/lib/types/iterative-generation/activities/index.d.ts.map +0 -1
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts +0 -3
- package/lib/types/iterative-generation/iterativeGenerationWorkflow.d.ts.map +0 -1
- package/lib/types/iterative-generation/types.d.ts +0 -79
- package/lib/types/iterative-generation/types.d.ts.map +0 -1
- package/lib/types/iterative-generation/utils.d.ts +0 -26
- package/lib/types/iterative-generation/utils.d.ts.map +0 -1
- package/lib/types/result-types.d.ts.map +0 -1
- package/lib/types/security/ssrf.d.ts.map +0 -1
- package/lib/types/system/notifyWebhookWorkflow.d.ts +0 -8
- package/lib/types/system/notifyWebhookWorkflow.d.ts.map +0 -1
- package/lib/types/system/recalculateEmbeddingsWorkflow.d.ts.map +0 -1
- package/lib/types/utils/auth.d.ts.map +0 -1
- package/lib/types/utils/blobs.d.ts.map +0 -1
- package/lib/types/utils/chunks.d.ts.map +0 -1
- package/lib/types/utils/client.d.ts +0 -8
- package/lib/types/utils/client.d.ts.map +0 -1
- package/lib/types/utils/expand-vars.d.ts.map +0 -1
- package/lib/types/utils/memory.d.ts +0 -8
- package/lib/types/utils/memory.d.ts.map +0 -1
- package/lib/types/utils/renditions.d.ts.map +0 -1
- package/lib/types/utils/storage.d.ts.map +0 -1
- package/lib/types/utils/text-preview-utils.d.ts.map +0 -1
- package/lib/types/utils/tokens.d.ts.map +0 -1
- package/lib/types/vars.d.ts +0 -3
- package/lib/types/vars.d.ts.map +0 -1
- package/lib/types/workflows.d.ts +0 -8
- package/lib/types/workflows.d.ts.map +0 -1
- package/src/iterative-generation/activities/extractToc.ts +0 -63
- package/src/iterative-generation/activities/finalizeOutput.ts +0 -100
- package/src/iterative-generation/activities/generatePart.ts +0 -123
- package/src/iterative-generation/activities/generateToc.ts +0 -116
- package/src/iterative-generation/activities/index.ts +0 -4
- package/src/iterative-generation/iterativeGenerationWorkflow.ts +0 -68
- package/src/iterative-generation/types.ts +0 -99
- package/src/iterative-generation/utils.ts +0 -126
- package/src/utils/memory.ts +0 -61
- /package/lib/{esm/bulk-import.js → bulk-import.js} +0 -0
- /package/lib/{types/conversion → conversion}/image.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/markitdown.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/mutool.d.ts +0 -0
- /package/lib/{types/conversion → conversion}/pandoc.d.ts +0 -0
- /package/lib/{types/result-types.d.ts → result-types.d.ts} +0 -0
- /package/lib/{esm/result-types.js → result-types.js} +0 -0
- /package/lib/{types/security → security}/ssrf.d.ts +0 -0
- /package/lib/{esm/security → security}/ssrf.js +0 -0
- /package/lib/{esm/utils → utils}/auth.js +0 -0
- /package/lib/{types/utils → utils}/chunks.d.ts +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as protos from '@temporalio/proto';
|
|
2
2
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { bundleWorkflowCode, Worker, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
4
|
+
import {
|
|
5
|
+
ContentEventName,
|
|
6
|
+
type DSLActivityExecutionPayload,
|
|
7
|
+
type DSLWorkflowExecutionPayload,
|
|
8
|
+
type DSLWorkflowStep,
|
|
9
|
+
} from '@vertesia/common';
|
|
5
10
|
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
|
|
6
11
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
7
12
|
import { setupActivity } from './setup/ActivityContext.js';
|
|
@@ -26,7 +31,7 @@ async function sayHelloFromDSLChild(payload: DSLActivityExecutionPayload<SayHell
|
|
|
26
31
|
|
|
27
32
|
async function prepareResult(payload: DSLActivityExecutionPayload<PrepareResultParams>) {
|
|
28
33
|
const { params } = await setupActivity(payload);
|
|
29
|
-
return [params.parent, params.child]
|
|
34
|
+
return [params.parent, params.child];
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
const steps1: DSLWorkflowStep[] = [
|
|
@@ -34,7 +39,7 @@ const steps1: DSLWorkflowStep[] = [
|
|
|
34
39
|
type: 'activity',
|
|
35
40
|
name: 'sayHelloFromParent',
|
|
36
41
|
output: 'parent',
|
|
37
|
-
import: [
|
|
42
|
+
import: ['name'],
|
|
38
43
|
},
|
|
39
44
|
{
|
|
40
45
|
type: 'workflow',
|
|
@@ -44,80 +49,79 @@ const steps1: DSLWorkflowStep[] = [
|
|
|
44
49
|
{
|
|
45
50
|
type: 'activity',
|
|
46
51
|
name: 'prepareResult',
|
|
47
|
-
import: [
|
|
52
|
+
import: ['parent', 'child'],
|
|
48
53
|
output: 'result',
|
|
49
|
-
}
|
|
50
|
-
]
|
|
54
|
+
},
|
|
55
|
+
];
|
|
51
56
|
|
|
52
57
|
const childSteps: DSLWorkflowStep[] = [
|
|
53
58
|
{
|
|
54
59
|
type: 'activity',
|
|
55
60
|
name: 'sayHelloFromDSLChild',
|
|
56
61
|
output: 'result',
|
|
57
|
-
import: [
|
|
62
|
+
import: ['name'],
|
|
58
63
|
},
|
|
59
|
-
]
|
|
64
|
+
];
|
|
60
65
|
|
|
61
66
|
const steps2: DSLWorkflowStep[] = [
|
|
62
67
|
{
|
|
63
68
|
type: 'activity',
|
|
64
69
|
name: 'sayHelloFromParent',
|
|
65
70
|
output: 'parent',
|
|
66
|
-
import: [
|
|
71
|
+
import: ['name'],
|
|
67
72
|
},
|
|
68
73
|
{
|
|
69
74
|
type: 'workflow',
|
|
70
75
|
name: 'dslWorkflow',
|
|
71
76
|
output: 'child',
|
|
72
77
|
spec: {
|
|
78
|
+
spec_format: 'steps',
|
|
73
79
|
name: 'testChildWorkflow',
|
|
74
80
|
steps: childSteps,
|
|
75
|
-
vars: {}
|
|
76
|
-
}
|
|
81
|
+
vars: {},
|
|
82
|
+
},
|
|
77
83
|
},
|
|
78
84
|
{
|
|
79
85
|
type: 'activity',
|
|
80
86
|
name: 'prepareResult',
|
|
81
|
-
import: [
|
|
87
|
+
import: ['parent', 'child'],
|
|
82
88
|
output: 'result',
|
|
83
|
-
}
|
|
84
|
-
]
|
|
89
|
+
},
|
|
90
|
+
];
|
|
85
91
|
|
|
86
92
|
const steps3: DSLWorkflowStep[] = [
|
|
87
93
|
{
|
|
88
94
|
type: 'activity',
|
|
89
95
|
name: 'sayHelloFromParent',
|
|
90
96
|
output: 'parent',
|
|
91
|
-
import: [
|
|
97
|
+
import: ['name'],
|
|
92
98
|
},
|
|
93
99
|
{
|
|
94
100
|
type: 'workflow',
|
|
95
101
|
name: 'dslWorkflow',
|
|
96
102
|
output: 'child',
|
|
97
103
|
spec: {
|
|
104
|
+
spec_format: 'steps',
|
|
98
105
|
name: 'testChildWorkflow',
|
|
99
106
|
steps: childSteps,
|
|
100
|
-
vars: {}
|
|
107
|
+
vars: {},
|
|
101
108
|
},
|
|
102
109
|
vars: {
|
|
103
110
|
storeUrl: 'store:${objectIds[0]}',
|
|
104
|
-
name: '${name}'
|
|
105
|
-
}
|
|
111
|
+
name: '${name}',
|
|
112
|
+
},
|
|
106
113
|
},
|
|
107
114
|
{
|
|
108
115
|
type: 'activity',
|
|
109
116
|
name: 'prepareResult',
|
|
110
|
-
import: [
|
|
117
|
+
import: ['parent', 'child'],
|
|
111
118
|
output: 'result',
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
|
|
119
|
+
},
|
|
120
|
+
];
|
|
115
121
|
|
|
116
122
|
// ========== test env setup ==========
|
|
117
123
|
|
|
118
|
-
|
|
119
124
|
describe('DSL Workflow with child workflows', () => {
|
|
120
|
-
|
|
121
125
|
let testEnv: TestWorkflowEnvironment;
|
|
122
126
|
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
123
127
|
|
|
@@ -143,7 +147,7 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
143
147
|
await testEnv?.teardown();
|
|
144
148
|
});
|
|
145
149
|
|
|
146
|
-
test('execute child workflow', async () => {
|
|
150
|
+
test('should execute child workflow', async () => {
|
|
147
151
|
const { client, nativeConnection } = testEnv;
|
|
148
152
|
const taskQueue = 'test';
|
|
149
153
|
|
|
@@ -163,31 +167,35 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
163
167
|
account_id: '123',
|
|
164
168
|
project_id: '123',
|
|
165
169
|
wf_rule_name: 'test',
|
|
166
|
-
auth_token:
|
|
170
|
+
auth_token:
|
|
171
|
+
process.env.VERTESIA_KEY ||
|
|
172
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
167
173
|
config: {
|
|
168
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
169
|
-
store_url: process.env.CP_STORE_URL ||
|
|
174
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
175
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
170
176
|
},
|
|
171
177
|
workflow: {
|
|
178
|
+
spec_format: 'steps',
|
|
172
179
|
steps: steps1,
|
|
173
180
|
vars: {
|
|
174
181
|
name,
|
|
175
182
|
},
|
|
176
183
|
name: 'test',
|
|
177
|
-
}
|
|
178
|
-
}
|
|
184
|
+
},
|
|
185
|
+
};
|
|
179
186
|
|
|
180
|
-
const result = await worker.runUntil(
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
187
|
+
const result = await worker.runUntil(
|
|
188
|
+
client.workflow.execute(dslWorkflow, {
|
|
189
|
+
args: [payload],
|
|
190
|
+
workflowId: 'test',
|
|
191
|
+
taskQueue,
|
|
192
|
+
}),
|
|
193
|
+
);
|
|
185
194
|
|
|
186
195
|
expect(result).toEqual([`Parent: Hello, ${name}!`, `Child: Hello, ${name}!`]);
|
|
187
|
-
|
|
188
196
|
});
|
|
189
197
|
|
|
190
|
-
test('execute DSL child workflow', async () => {
|
|
198
|
+
test('should execute DSL child workflow', async () => {
|
|
191
199
|
const { client, nativeConnection } = testEnv;
|
|
192
200
|
const taskQueue = 'test';
|
|
193
201
|
|
|
@@ -207,31 +215,35 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
207
215
|
account_id: '123',
|
|
208
216
|
project_id: '123',
|
|
209
217
|
wf_rule_name: 'test',
|
|
210
|
-
auth_token:
|
|
218
|
+
auth_token:
|
|
219
|
+
process.env.VERTESIA_KEY ||
|
|
220
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
211
221
|
config: {
|
|
212
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
213
|
-
store_url: process.env.CP_STORE_URL ||
|
|
222
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
223
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
214
224
|
},
|
|
215
225
|
workflow: {
|
|
226
|
+
spec_format: 'steps',
|
|
216
227
|
steps: steps2,
|
|
217
228
|
vars: {
|
|
218
229
|
name,
|
|
219
230
|
},
|
|
220
231
|
name: 'test',
|
|
221
|
-
}
|
|
222
|
-
}
|
|
232
|
+
},
|
|
233
|
+
};
|
|
223
234
|
|
|
224
|
-
const result = await worker.runUntil(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
const result = await worker.runUntil(
|
|
236
|
+
client.workflow.execute(dslWorkflow, {
|
|
237
|
+
args: [payload],
|
|
238
|
+
workflowId: 'test',
|
|
239
|
+
taskQueue,
|
|
240
|
+
}),
|
|
241
|
+
);
|
|
229
242
|
|
|
230
243
|
expect(result).toEqual([`Parent: Hello, ${name}!`, `DSL Child: Hello, ${name}!`]);
|
|
231
|
-
|
|
232
244
|
});
|
|
233
245
|
|
|
234
|
-
test('execute DSL child workflow with variable resolution', async () => {
|
|
246
|
+
test('should execute DSL child workflow with variable resolution', async () => {
|
|
235
247
|
const { client, nativeConnection } = testEnv;
|
|
236
248
|
const taskQueue = 'test';
|
|
237
249
|
|
|
@@ -251,27 +263,31 @@ describe('DSL Workflow with child workflows', () => {
|
|
|
251
263
|
account_id: '123',
|
|
252
264
|
project_id: '123',
|
|
253
265
|
wf_rule_name: 'test',
|
|
254
|
-
auth_token:
|
|
266
|
+
auth_token:
|
|
267
|
+
process.env.VERTESIA_KEY ||
|
|
268
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
255
269
|
config: {
|
|
256
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
257
|
-
store_url: process.env.CP_STORE_URL ||
|
|
270
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
271
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
258
272
|
},
|
|
259
273
|
workflow: {
|
|
274
|
+
spec_format: 'steps',
|
|
260
275
|
steps: steps3,
|
|
261
276
|
vars: {
|
|
262
277
|
name,
|
|
263
278
|
},
|
|
264
279
|
name: 'test',
|
|
265
|
-
}
|
|
266
|
-
}
|
|
280
|
+
},
|
|
281
|
+
};
|
|
267
282
|
|
|
268
|
-
const result = await worker.runUntil(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
283
|
+
const result = await worker.runUntil(
|
|
284
|
+
client.workflow.execute(dslWorkflow, {
|
|
285
|
+
args: [payload],
|
|
286
|
+
workflowId: 'test-vars',
|
|
287
|
+
taskQueue,
|
|
288
|
+
}),
|
|
289
|
+
);
|
|
273
290
|
|
|
274
291
|
expect(result).toEqual([`Parent: Hello, ${name}!`, `DSL Child: Hello, ${name}!`]);
|
|
275
|
-
|
|
276
292
|
});
|
|
277
293
|
});
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
2
|
-
import {
|
|
3
|
-
import { VertesiaClient } from '@vertesia/client';
|
|
4
|
-
import {
|
|
2
|
+
import { bundleWorkflowCode, Worker, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
3
|
+
import type { VertesiaClient } from '@vertesia/client';
|
|
4
|
+
import {
|
|
5
|
+
ContentEventName,
|
|
6
|
+
type DSLActivityExecutionPayload,
|
|
7
|
+
type DSLActivitySpec,
|
|
8
|
+
type DSLWorkflowExecutionPayload,
|
|
9
|
+
type FindPayload,
|
|
10
|
+
} from '@vertesia/common';
|
|
5
11
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
12
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
7
|
-
import { setupActivity } from
|
|
13
|
+
import { setupActivity } from './setup/ActivityContext.js';
|
|
8
14
|
import { DataProvider } from './setup/fetch/DataProvider.js';
|
|
9
15
|
import { registerFetchProviderFactory } from './setup/fetch/index.js';
|
|
10
16
|
|
|
@@ -13,20 +19,19 @@ interface SayMessageParams {
|
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
class DocumentTestProvider extends DataProvider {
|
|
16
|
-
|
|
17
|
-
static ID = "document";
|
|
22
|
+
static ID = 'document';
|
|
18
23
|
|
|
19
24
|
constructor() {
|
|
20
25
|
super(DocumentTestProvider.ID, true);
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
doFetch(payload: FindPayload): Promise<Record<string,
|
|
28
|
+
doFetch(payload: FindPayload): Promise<Record<string, unknown>[]> {
|
|
24
29
|
const query = payload.query;
|
|
25
30
|
console.log('query', query);
|
|
26
31
|
if (query.lang === 'en') {
|
|
27
|
-
return Promise.resolve([query.greeting ? { text: 'Hello' } : { text:
|
|
32
|
+
return Promise.resolve([query.greeting ? { text: 'Hello' } : { text: 'World' }]);
|
|
28
33
|
} else {
|
|
29
|
-
return Promise.resolve([query.greeting ? { text: 'Bonjour' } : { text:
|
|
34
|
+
return Promise.resolve([query.greeting ? { text: 'Bonjour' } : { text: 'Monde' }]);
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
|
|
@@ -37,45 +42,43 @@ class DocumentTestProvider extends DataProvider {
|
|
|
37
42
|
|
|
38
43
|
registerFetchProviderFactory(DocumentTestProvider.ID, DocumentTestProvider.factory);
|
|
39
44
|
|
|
40
|
-
|
|
41
45
|
async function sayMessage(payload: DSLActivityExecutionPayload<SayMessageParams>): Promise<string> {
|
|
42
46
|
const { params } = await setupActivity(payload);
|
|
43
47
|
return params.message;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
|
|
47
50
|
const activities: DSLActivitySpec[] = [
|
|
48
51
|
{
|
|
49
52
|
name: 'sayMessage',
|
|
50
53
|
output: 'result',
|
|
51
|
-
import: [
|
|
54
|
+
import: ['lang'],
|
|
52
55
|
params: {
|
|
53
|
-
message:
|
|
56
|
+
message: '${greeting.text}, ${name.text}!',
|
|
54
57
|
},
|
|
55
58
|
fetch: {
|
|
56
59
|
name: {
|
|
57
|
-
type:
|
|
60
|
+
type: 'document',
|
|
58
61
|
query: {
|
|
59
|
-
lang:
|
|
62
|
+
lang: '${lang}',
|
|
63
|
+
greeting: false,
|
|
60
64
|
},
|
|
61
65
|
limit: 1,
|
|
62
66
|
},
|
|
63
67
|
greeting: {
|
|
64
|
-
type:
|
|
68
|
+
type: 'document',
|
|
65
69
|
query: {
|
|
66
|
-
lang:
|
|
70
|
+
lang: '${lang}',
|
|
71
|
+
greeting: true,
|
|
67
72
|
},
|
|
68
73
|
limit: 1,
|
|
69
|
-
}
|
|
74
|
+
},
|
|
70
75
|
},
|
|
71
76
|
},
|
|
72
|
-
]
|
|
77
|
+
];
|
|
73
78
|
|
|
74
79
|
// ========== test env setup ==========
|
|
75
80
|
|
|
76
|
-
|
|
77
81
|
describe('DSL Workflow', () => {
|
|
78
|
-
|
|
79
82
|
let testEnv: TestWorkflowEnvironment;
|
|
80
83
|
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
81
84
|
|
|
@@ -90,7 +93,7 @@ describe('DSL Workflow', () => {
|
|
|
90
93
|
await testEnv?.teardown();
|
|
91
94
|
});
|
|
92
95
|
|
|
93
|
-
it('successfully
|
|
96
|
+
it('should successfully complete a mock workflow', async () => {
|
|
94
97
|
const { client, nativeConnection } = testEnv;
|
|
95
98
|
const taskQueue = 'test';
|
|
96
99
|
|
|
@@ -110,32 +113,31 @@ describe('DSL Workflow', () => {
|
|
|
110
113
|
account_id: '123',
|
|
111
114
|
project_id: '123',
|
|
112
115
|
wf_rule_name: 'test',
|
|
113
|
-
auth_token:
|
|
116
|
+
auth_token:
|
|
117
|
+
process.env.VERTESIA_KEY ||
|
|
118
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
114
119
|
config: {
|
|
115
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
116
|
-
store_url: process.env.CP_STORE_URL ||
|
|
120
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
121
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
117
122
|
},
|
|
118
123
|
workflow: {
|
|
124
|
+
spec_format: 'activities',
|
|
119
125
|
activities,
|
|
120
126
|
vars: {
|
|
121
127
|
lang,
|
|
122
128
|
},
|
|
123
129
|
name: 'test',
|
|
124
|
-
}
|
|
125
|
-
}
|
|
130
|
+
},
|
|
131
|
+
};
|
|
126
132
|
|
|
127
|
-
const result = await worker.runUntil(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
const result = await worker.runUntil(
|
|
134
|
+
client.workflow.execute(dslWorkflow, {
|
|
135
|
+
args: [payload],
|
|
136
|
+
workflowId: 'test',
|
|
137
|
+
taskQueue,
|
|
138
|
+
}),
|
|
139
|
+
);
|
|
132
140
|
|
|
133
141
|
expect(result).toBe('Hello, World!');
|
|
134
|
-
|
|
135
142
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
143
|
});
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { bundleWorkflowCode, Worker, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
3
|
+
import {
|
|
4
|
+
ContentEventName,
|
|
5
|
+
type DSLActivityExecutionPayload,
|
|
6
|
+
type DSLActivitySpec,
|
|
7
|
+
type DSLWorkflowExecutionPayload,
|
|
8
|
+
} from '@vertesia/common';
|
|
4
9
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
5
10
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
6
|
-
import { setupActivity } from
|
|
11
|
+
import { setupActivity } from './setup/ActivityContext.js';
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
async function testImportedVars(payload: DSLActivityExecutionPayload<Record<string, any>>) {
|
|
13
|
+
async function testImportedVars(payload: DSLActivityExecutionPayload<Record<string, unknown>>) {
|
|
10
14
|
const { params } = await setupActivity(payload);
|
|
11
15
|
if (!params.object_name) throw new Error('object_name is required');
|
|
12
16
|
console.log('!!!!!!!!!!@@@@@@@@@@@@@@!!!!!!!!!!!!!!', params.object_name);
|
|
13
17
|
return params.object_name;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
|
|
17
20
|
const activities: DSLActivitySpec[] = [
|
|
18
21
|
{
|
|
19
22
|
name: 'testImportedVars',
|
|
20
|
-
import: [
|
|
23
|
+
import: ['object_name'],
|
|
21
24
|
output: 'result',
|
|
22
25
|
},
|
|
23
|
-
]
|
|
26
|
+
];
|
|
24
27
|
|
|
25
28
|
// ========== test env setup ==========
|
|
26
29
|
|
|
27
|
-
|
|
28
30
|
describe('DSL Workflow import vars', () => {
|
|
29
|
-
|
|
30
31
|
let testEnv: TestWorkflowEnvironment;
|
|
31
32
|
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
32
33
|
|
|
@@ -41,10 +42,7 @@ describe('DSL Workflow import vars', () => {
|
|
|
41
42
|
await testEnv?.teardown();
|
|
42
43
|
});
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
it('import vars are part of activity params', async () => {
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
it('should include import vars in activity params', async () => {
|
|
48
46
|
const { client, nativeConnection } = testEnv;
|
|
49
47
|
const taskQueue = 'test';
|
|
50
48
|
|
|
@@ -64,29 +62,31 @@ describe('DSL Workflow import vars', () => {
|
|
|
64
62
|
account_id: '123',
|
|
65
63
|
project_id: '123',
|
|
66
64
|
wf_rule_name: 'test',
|
|
67
|
-
auth_token:
|
|
65
|
+
auth_token:
|
|
66
|
+
process.env.VERTESIA_KEY ||
|
|
67
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
68
68
|
config: {
|
|
69
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
70
|
-
store_url: process.env.CP_STORE_URL ||
|
|
69
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
70
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
71
71
|
},
|
|
72
72
|
workflow: {
|
|
73
|
+
spec_format: 'activities',
|
|
73
74
|
activities,
|
|
74
75
|
vars: {
|
|
75
76
|
object_name,
|
|
76
77
|
},
|
|
77
78
|
name: 'test',
|
|
78
|
-
}
|
|
79
|
-
}
|
|
79
|
+
},
|
|
80
|
+
};
|
|
80
81
|
|
|
81
|
-
const result = await worker.runUntil(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const result = await worker.runUntil(
|
|
83
|
+
client.workflow.execute(dslWorkflow, {
|
|
84
|
+
args: [payload],
|
|
85
|
+
workflowId: 'test',
|
|
86
|
+
taskQueue,
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
86
89
|
|
|
87
90
|
expect(result).toBe(object_name);
|
|
88
|
-
|
|
89
91
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
92
|
});
|
package/src/dsl/workflow.test.ts
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
import * as protos from '@temporalio/proto';
|
|
2
2
|
import { TestWorkflowEnvironment } from '@temporalio/testing';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { bundleWorkflowCode, Worker, type WorkflowBundleWithSourceMap } from '@temporalio/worker';
|
|
4
|
+
import {
|
|
5
|
+
ContentEventName,
|
|
6
|
+
type DSLActivityExecutionPayload,
|
|
7
|
+
type DSLActivitySpec,
|
|
8
|
+
type DSLWorkflowExecutionPayload,
|
|
9
|
+
} from '@vertesia/common';
|
|
5
10
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
11
|
import { dslWorkflow } from './dsl-workflow.js';
|
|
7
|
-
import { setupActivity } from
|
|
12
|
+
import { setupActivity } from './setup/ActivityContext.js';
|
|
8
13
|
|
|
9
|
-
async function sayHello(payload: DSLActivityExecutionPayload<Record<string,
|
|
14
|
+
async function sayHello(payload: DSLActivityExecutionPayload<Record<string, unknown>>): Promise<string> {
|
|
10
15
|
const { params } = await setupActivity(payload);
|
|
11
|
-
return params.lang === 'fr' ?
|
|
16
|
+
return params.lang === 'fr' ? 'Bonjour' : 'Hello';
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
async function sayName(payload: DSLActivityExecutionPayload<Record<string,
|
|
19
|
+
async function sayName(payload: DSLActivityExecutionPayload<Record<string, unknown>>): Promise<string> {
|
|
15
20
|
const { params } = await setupActivity(payload);
|
|
16
|
-
return params.lang === 'fr' ?
|
|
21
|
+
return params.lang === 'fr' ? 'Monde' : 'World';
|
|
17
22
|
}
|
|
18
23
|
|
|
19
|
-
async function sayGreeting(payload: DSLActivityExecutionPayload<Record<string,
|
|
24
|
+
async function sayGreeting(payload: DSLActivityExecutionPayload<Record<string, unknown>>): Promise<string> {
|
|
20
25
|
const { params } = await setupActivity(payload);
|
|
21
26
|
return `${params.hello}, ${params.name}!`;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
|
-
|
|
25
29
|
const activities: DSLActivitySpec[] = [
|
|
26
30
|
{
|
|
27
31
|
name: 'sayHello',
|
|
28
32
|
output: 'hello',
|
|
29
|
-
import: [
|
|
33
|
+
import: ['lang'],
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
36
|
name: 'sayName',
|
|
33
37
|
output: 'name',
|
|
34
|
-
import: [
|
|
38
|
+
import: ['lang'],
|
|
35
39
|
},
|
|
36
40
|
{
|
|
37
41
|
name: 'sayGreeting',
|
|
38
|
-
import: [
|
|
42
|
+
import: ['hello', 'name'],
|
|
39
43
|
condition: {
|
|
40
44
|
hello: { $null: false },
|
|
41
|
-
name: { $null: false }
|
|
45
|
+
name: { $null: false },
|
|
42
46
|
},
|
|
43
47
|
output: 'result',
|
|
44
48
|
},
|
|
45
|
-
]
|
|
49
|
+
];
|
|
46
50
|
|
|
47
51
|
// ========== test env setup ==========
|
|
48
52
|
|
|
49
|
-
|
|
50
53
|
describe('DSL Workflow', () => {
|
|
51
|
-
|
|
52
54
|
let testEnv: TestWorkflowEnvironment;
|
|
53
55
|
let workflowBundle: WorkflowBundleWithSourceMap;
|
|
54
56
|
|
|
@@ -74,7 +76,7 @@ describe('DSL Workflow', () => {
|
|
|
74
76
|
await testEnv?.teardown();
|
|
75
77
|
});
|
|
76
78
|
|
|
77
|
-
it('successfully
|
|
79
|
+
it('should successfully complete a mock workflow', async () => {
|
|
78
80
|
const { client, nativeConnection } = testEnv;
|
|
79
81
|
const taskQueue = 'test';
|
|
80
82
|
|
|
@@ -94,32 +96,31 @@ describe('DSL Workflow', () => {
|
|
|
94
96
|
account_id: '123',
|
|
95
97
|
project_id: '123',
|
|
96
98
|
wf_rule_name: 'test',
|
|
97
|
-
auth_token:
|
|
99
|
+
auth_token:
|
|
100
|
+
process.env.VERTESIA_KEY ||
|
|
101
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwOi8vbW9jay10b2tlbi1zZXJ2ZXIiLCJzdWIiOiJ0ZXN0In0.signature',
|
|
98
102
|
config: {
|
|
99
|
-
studio_url: process.env.CP_STUDIO_URL ||
|
|
100
|
-
store_url: process.env.CP_STORE_URL ||
|
|
103
|
+
studio_url: process.env.CP_STUDIO_URL || 'http://localhost:8081',
|
|
104
|
+
store_url: process.env.CP_STORE_URL || 'http://localhost:8082',
|
|
101
105
|
},
|
|
102
106
|
workflow: {
|
|
107
|
+
spec_format: 'activities',
|
|
103
108
|
activities,
|
|
104
109
|
vars: {
|
|
105
110
|
lang,
|
|
106
111
|
},
|
|
107
112
|
name: 'test',
|
|
108
|
-
}
|
|
109
|
-
}
|
|
113
|
+
},
|
|
114
|
+
};
|
|
110
115
|
|
|
111
|
-
const result = await worker.runUntil(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
const result = await worker.runUntil(
|
|
117
|
+
client.workflow.execute(dslWorkflow, {
|
|
118
|
+
args: [payload],
|
|
119
|
+
workflowId: 'test',
|
|
120
|
+
taskQueue,
|
|
121
|
+
}),
|
|
122
|
+
);
|
|
116
123
|
|
|
117
124
|
expect(result).toBe('Bonjour, Monde!');
|
|
118
|
-
|
|
119
125
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
126
|
});
|
package/src/dsl.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
|
|
1
|
+
export * from './dsl/dslProxyActivities.js';
|
|
2
|
+
export * from './errors.js';
|
|
3
|
+
export * from './result-types.js';
|