@decaf-ts/integrations 0.8.0 → 0.9.0
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 +4 -0
- package/dist/integrations.cjs +1 -1
- package/jest.config.cjs +1 -11
- package/lib/cjs/blob/azure/AzureBlobEnvironment.cjs +25 -0
- package/lib/cjs/blob/azure/AzureBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/azure/AzureBlobStoreService.cjs +52 -10
- package/lib/cjs/blob/azure/AzureBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/azure/index.cjs +1 -0
- package/lib/cjs/blob/azure/index.cjs.map +1 -1
- package/lib/cjs/blob/core/BlobEnvironment.cjs +19 -0
- package/lib/cjs/blob/core/BlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/core/BlobStoreService.cjs +6 -3
- package/lib/cjs/blob/core/BlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/core/index.cjs +1 -0
- package/lib/cjs/blob/core/index.cjs.map +1 -1
- package/lib/cjs/blob/gcp/GcsBlobEnvironment.cjs +26 -0
- package/lib/cjs/blob/gcp/GcsBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/gcp/GcsBlobStoreService.cjs +31 -2
- package/lib/cjs/blob/gcp/GcsBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/gcp/index.cjs +1 -0
- package/lib/cjs/blob/gcp/index.cjs.map +1 -1
- package/lib/cjs/blob/ipfs/IpfsBlobEnvironment.cjs +30 -0
- package/lib/cjs/blob/ipfs/IpfsBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/ipfs/IpfsBlobStoreService.cjs +37 -2
- package/lib/cjs/blob/ipfs/IpfsBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/ipfs/index.cjs +1 -0
- package/lib/cjs/blob/ipfs/index.cjs.map +1 -1
- package/lib/cjs/blob/local/LocalBlobEnvironment.cjs +22 -0
- package/lib/cjs/blob/local/LocalBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/local/LocalBlobStoreService.cjs +29 -2
- package/lib/cjs/blob/local/LocalBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/local/index.cjs +1 -0
- package/lib/cjs/blob/local/index.cjs.map +1 -1
- package/lib/cjs/blob/memory/MemoryBlobEnvironment.cjs +21 -0
- package/lib/cjs/blob/memory/MemoryBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/memory/MemoryBlobStoreService.cjs +28 -2
- package/lib/cjs/blob/memory/MemoryBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/memory/index.cjs +1 -0
- package/lib/cjs/blob/memory/index.cjs.map +1 -1
- package/lib/cjs/blob/s3/MinioBlobEnvironment.cjs +32 -0
- package/lib/cjs/blob/s3/MinioBlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/s3/MinioBlobStoreService.cjs +45 -4
- package/lib/cjs/blob/s3/MinioBlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/s3/R2BlobEnvironment.cjs +32 -0
- package/lib/cjs/blob/s3/R2BlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/s3/R2BlobStoreService.cjs +45 -4
- package/lib/cjs/blob/s3/R2BlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/s3/S3BlobEnvironment.cjs +32 -0
- package/lib/cjs/blob/s3/S3BlobEnvironment.cjs.map +1 -0
- package/lib/cjs/blob/s3/S3BlobStoreService.cjs +43 -310
- package/lib/cjs/blob/s3/S3BlobStoreService.cjs.map +1 -1
- package/lib/cjs/blob/s3/S3CompatibleBlobStoreService.cjs +327 -0
- package/lib/cjs/blob/s3/S3CompatibleBlobStoreService.cjs.map +1 -0
- package/lib/cjs/blob/s3/index.cjs +4 -0
- package/lib/cjs/blob/s3/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs +100 -0
- package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/GraphCatalogueErrors.cjs +29 -0
- package/lib/cjs/graph/engine/catalog/GraphCatalogueErrors.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeCatalogue.cjs +270 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeCatalogue.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeManifestResolver.cjs +169 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeManifestResolver.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeMethodRegistry.cjs +64 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeMethodRegistry.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeRegistration.cjs +17 -0
- package/lib/cjs/graph/engine/catalog/GraphNodeRegistration.cjs.map +1 -0
- package/lib/cjs/graph/engine/catalog/index.cjs +24 -0
- package/lib/cjs/graph/engine/catalog/index.cjs.map +1 -0
- package/lib/cjs/graph/engine/constants.cjs +2 -2
- package/lib/cjs/graph/engine/errors/GraphExecutionError.cjs +1 -0
- package/lib/cjs/graph/engine/errors/GraphExecutionError.cjs.map +1 -1
- package/lib/cjs/graph/engine/errors/GraphRunCancelledError.cjs +18 -0
- package/lib/cjs/graph/engine/errors/GraphRunCancelledError.cjs.map +1 -0
- package/lib/cjs/graph/engine/errors/index.cjs +1 -0
- package/lib/cjs/graph/engine/errors/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/events/index.cjs +0 -1
- package/lib/cjs/graph/engine/events/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs +2 -2
- package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs +10 -6
- package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +30 -18
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +354 -73
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionResult.cjs +3 -3
- package/lib/cjs/graph/engine/execution/GraphExecutionResult.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +9 -6
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +11 -10
- package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/index.cjs +8 -11
- package/lib/cjs/graph/engine/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs +37 -12
- package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs +38 -13
- package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs +38 -13
- package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningPolicy.cjs +2 -2
- package/lib/cjs/graph/engine/pinning/GraphPinningPolicy.cjs.map +1 -1
- package/lib/cjs/graph/engine/pinning/GraphPinningService.cjs +43 -14
- package/lib/cjs/graph/engine/pinning/GraphPinningService.cjs.map +1 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanEdge.cjs.map +1 -1
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanner.cjs +79 -88
- package/lib/cjs/graph/engine/planning/GraphExecutionPlanner.cjs.map +1 -1
- package/lib/cjs/graph/engine/planning/index.cjs +0 -1
- package/lib/cjs/graph/engine/planning/index.cjs.map +1 -1
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorRegistry.cjs +28 -15
- package/lib/cjs/graph/engine/registry/GraphNodeExecutorRegistry.cjs.map +1 -1
- package/lib/cjs/graph/engine/runs/GraphRunEventPublisher.cjs +69 -0
- package/lib/cjs/graph/engine/runs/GraphRunEventPublisher.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/GraphRunExecutor.cjs +291 -0
- package/lib/cjs/graph/engine/runs/GraphRunExecutor.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/GraphRunFingerprint.cjs +29 -0
- package/lib/cjs/graph/engine/runs/GraphRunFingerprint.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/GraphRunService.cjs +259 -0
- package/lib/cjs/graph/engine/runs/GraphRunService.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunEventStore.cjs +69 -0
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunEventStore.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunStore.cjs +26 -0
- package/lib/cjs/graph/engine/runs/InMemoryGraphRunStore.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/index.cjs +26 -0
- package/lib/cjs/graph/engine/runs/index.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/ownership.cjs +34 -0
- package/lib/cjs/graph/engine/runs/ownership.cjs.map +1 -0
- package/lib/cjs/graph/engine/runs/types.cjs.map +1 -0
- package/lib/cjs/graph/engine/snapshots/GraphExecutionSnapshotMapper.cjs +2 -2
- package/lib/cjs/graph/engine/snapshots/GraphExecutionSnapshotMapper.cjs.map +1 -1
- package/lib/cjs/graph/engine/validation/GraphConnectionPolicyValidator.cjs +142 -0
- package/lib/cjs/graph/engine/validation/GraphConnectionPolicyValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphCredentialReferenceValidator.cjs +160 -0
- package/lib/cjs/graph/engine/validation/GraphCredentialReferenceValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphDefinitionValidator.cjs +6 -10
- package/lib/cjs/graph/engine/validation/GraphDefinitionValidator.cjs.map +1 -1
- package/lib/cjs/graph/engine/validation/GraphEdgeInstanceValidator.cjs +166 -0
- package/lib/cjs/graph/engine/validation/GraphEdgeInstanceValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphNodeInstanceValidator.cjs +86 -0
- package/lib/cjs/graph/engine/validation/GraphNodeInstanceValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs +423 -0
- package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphResolvedWorkflow.cjs +4 -0
- package/lib/cjs/graph/engine/validation/GraphResolvedWorkflow.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphValidationErrors.cjs +50 -0
- package/lib/cjs/graph/engine/validation/GraphValidationErrors.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphValidationIssue.cjs +4 -0
- package/lib/cjs/graph/engine/validation/GraphValidationIssue.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs +478 -0
- package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs.map +1 -0
- package/lib/cjs/graph/engine/validation/index.cjs +12 -1
- package/lib/cjs/graph/engine/validation/index.cjs.map +1 -1
- package/lib/cjs/graph/index.cjs +4 -4
- package/lib/cjs/graph/log/GraphRunLogger.cjs +10 -6
- package/lib/cjs/graph/log/GraphRunLogger.cjs.map +1 -1
- package/lib/cjs/graph/log/LogParameters.cjs +13 -13
- package/lib/cjs/graph/log/LogParameters.cjs.map +1 -1
- package/lib/cjs/index.cjs +2 -2
- package/lib/cjs/nest/graph/GraphExecutionController.cjs +140 -16
- package/lib/cjs/nest/graph/GraphExecutionController.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs +94 -7
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs +11 -0
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +63 -61
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphNodeCatalogueController.cjs +270 -0
- package/lib/cjs/nest/graph/GraphNodeCatalogueController.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphResultService.cjs +16 -1
- package/lib/cjs/nest/graph/GraphResultService.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphRunController.cjs +279 -0
- package/lib/cjs/nest/graph/GraphRunController.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphRunModel.cjs +83 -0
- package/lib/cjs/nest/graph/GraphRunModel.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphRunModelService.cjs +121 -0
- package/lib/cjs/nest/graph/GraphRunModelService.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs +169 -0
- package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs +162 -0
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphWorkflowDocumentLimits.cjs +12 -0
- package/lib/cjs/nest/graph/GraphWorkflowDocumentLimits.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphWorkflowErrors.cjs +23 -0
- package/lib/cjs/nest/graph/GraphWorkflowErrors.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs +27 -1
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs +211 -8
- package/lib/cjs/nest/graph/GraphWorkflowService.cjs.map +1 -1
- package/lib/cjs/nest/graph/index.cjs +8 -0
- package/lib/cjs/nest/graph/index.cjs.map +1 -1
- package/lib/cjs/nest/graph/main.cjs +22 -5
- package/lib/cjs/nest/graph/main.cjs.map +1 -1
- package/lib/cjs/nest/keycloakModule.cjs +3 -1
- package/lib/cjs/nest/keycloakModule.cjs.map +1 -1
- package/lib/cjs/secrets/aws/AwsSecretEnvironment.cjs +27 -0
- package/lib/cjs/secrets/aws/AwsSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/aws/AwsSecretService.cjs +53 -19
- package/lib/cjs/secrets/aws/AwsSecretService.cjs.map +1 -1
- package/lib/cjs/secrets/aws/index.cjs +1 -0
- package/lib/cjs/secrets/aws/index.cjs.map +1 -1
- package/lib/cjs/secrets/azure/AzureKeyVaultSecretService.cjs +45 -16
- package/lib/cjs/secrets/azure/AzureKeyVaultSecretService.cjs.map +1 -1
- package/lib/cjs/secrets/azure/AzureSecretEnvironment.cjs +23 -0
- package/lib/cjs/secrets/azure/AzureSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/azure/index.cjs +1 -0
- package/lib/cjs/secrets/azure/index.cjs.map +1 -1
- package/lib/cjs/secrets/core/ClientBasedSecretService.cjs +29 -0
- package/lib/cjs/secrets/core/ClientBasedSecretService.cjs.map +1 -0
- package/lib/cjs/secrets/core/SecretEnvironment.cjs +19 -0
- package/lib/cjs/secrets/core/SecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/core/index.cjs +2 -0
- package/lib/cjs/secrets/core/index.cjs.map +1 -1
- package/lib/cjs/secrets/gcp/GcpSecretEnvironment.cjs +25 -0
- package/lib/cjs/secrets/gcp/GcpSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/gcp/GcpSecretManagerService.cjs +45 -17
- package/lib/cjs/secrets/gcp/GcpSecretManagerService.cjs.map +1 -1
- package/lib/cjs/secrets/gcp/index.cjs +1 -0
- package/lib/cjs/secrets/gcp/index.cjs.map +1 -1
- package/lib/cjs/secrets/model/ModelSecretEnvironment.cjs +21 -0
- package/lib/cjs/secrets/model/ModelSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/model/ModelSecretService.cjs +29 -3
- package/lib/cjs/secrets/model/ModelSecretService.cjs.map +1 -1
- package/lib/cjs/secrets/model/index.cjs +1 -0
- package/lib/cjs/secrets/model/index.cjs.map +1 -1
- package/lib/cjs/secrets/onepassword/OnePasswordSecretEnvironment.cjs +24 -0
- package/lib/cjs/secrets/onepassword/OnePasswordSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/onepassword/OnePasswordSecretService.cjs +34 -3
- package/lib/cjs/secrets/onepassword/OnePasswordSecretService.cjs.map +1 -1
- package/lib/cjs/secrets/onepassword/index.cjs +1 -0
- package/lib/cjs/secrets/onepassword/index.cjs.map +1 -1
- package/lib/cjs/secrets/vault/VaultSecretEnvironment.cjs +24 -0
- package/lib/cjs/secrets/vault/VaultSecretEnvironment.cjs.map +1 -0
- package/lib/cjs/secrets/vault/VaultSecretService.cjs +47 -16
- package/lib/cjs/secrets/vault/VaultSecretService.cjs.map +1 -1
- package/lib/cjs/secrets/vault/index.cjs +1 -0
- package/lib/cjs/secrets/vault/index.cjs.map +1 -1
- package/lib/cjs/sftp/aws/AwsSftpEnvironment.cjs +31 -0
- package/lib/cjs/sftp/aws/AwsSftpEnvironment.cjs.map +1 -0
- package/lib/cjs/sftp/aws/AwsSftpService.cjs +55 -5
- package/lib/cjs/sftp/aws/AwsSftpService.cjs.map +1 -1
- package/lib/cjs/sftp/core/SftpEnvironment.cjs +19 -0
- package/lib/cjs/sftp/core/SftpEnvironment.cjs.map +1 -0
- package/lib/cjs/sftp/core/SftpSource.cjs +10 -0
- package/lib/cjs/sftp/core/SftpSource.cjs.map +1 -1
- package/lib/cjs/sftp/core/index.cjs +1 -0
- package/lib/cjs/sftp/core/index.cjs.map +1 -1
- package/lib/cjs/sftp/index.cjs +3 -0
- package/lib/cjs/sftp/index.cjs.map +1 -1
- package/lib/cjs/sftp/ssh2/Ssh2SftpEnvironment.cjs +28 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpEnvironment.cjs.map +1 -0
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs +46 -5
- package/lib/cjs/sftp/ssh2/Ssh2SftpService.cjs.map +1 -1
- package/lib/cjs/shared/environmentValue.cjs +31 -0
- package/lib/cjs/shared/environmentValue.cjs.map +1 -0
- package/lib/esm/blob/azure/AzureBlobEnvironment.js +21 -0
- package/lib/esm/blob/azure/AzureBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/azure/AzureBlobStoreService.js +51 -12
- package/lib/esm/blob/azure/AzureBlobStoreService.js.map +1 -1
- package/lib/esm/blob/azure/index.js +1 -0
- package/lib/esm/blob/azure/index.js.map +1 -1
- package/lib/esm/blob/core/BlobEnvironment.js +15 -0
- package/lib/esm/blob/core/BlobEnvironment.js.map +1 -0
- package/lib/esm/blob/core/BlobStoreService.js +6 -3
- package/lib/esm/blob/core/BlobStoreService.js.map +1 -1
- package/lib/esm/blob/core/index.js +1 -0
- package/lib/esm/blob/core/index.js.map +1 -1
- package/lib/esm/blob/gcp/GcsBlobEnvironment.js +22 -0
- package/lib/esm/blob/gcp/GcsBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/gcp/GcsBlobStoreService.js +29 -3
- package/lib/esm/blob/gcp/GcsBlobStoreService.js.map +1 -1
- package/lib/esm/blob/gcp/index.js +1 -0
- package/lib/esm/blob/gcp/index.js.map +1 -1
- package/lib/esm/blob/ipfs/IpfsBlobEnvironment.js +26 -0
- package/lib/esm/blob/ipfs/IpfsBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/ipfs/IpfsBlobStoreService.js +35 -3
- package/lib/esm/blob/ipfs/IpfsBlobStoreService.js.map +1 -1
- package/lib/esm/blob/ipfs/index.js +1 -0
- package/lib/esm/blob/ipfs/index.js.map +1 -1
- package/lib/esm/blob/local/LocalBlobEnvironment.js +18 -0
- package/lib/esm/blob/local/LocalBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/local/LocalBlobStoreService.js +27 -3
- package/lib/esm/blob/local/LocalBlobStoreService.js.map +1 -1
- package/lib/esm/blob/local/index.js +1 -0
- package/lib/esm/blob/local/index.js.map +1 -1
- package/lib/esm/blob/memory/MemoryBlobEnvironment.js +17 -0
- package/lib/esm/blob/memory/MemoryBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/memory/MemoryBlobStoreService.js +26 -3
- package/lib/esm/blob/memory/MemoryBlobStoreService.js.map +1 -1
- package/lib/esm/blob/memory/index.js +1 -0
- package/lib/esm/blob/memory/index.js.map +1 -1
- package/lib/esm/blob/s3/MinioBlobEnvironment.js +28 -0
- package/lib/esm/blob/s3/MinioBlobEnvironment.js.map +1 -0
- package/lib/esm/blob/s3/MinioBlobStoreService.js +42 -4
- package/lib/esm/blob/s3/MinioBlobStoreService.js.map +1 -1
- package/lib/esm/blob/s3/R2BlobEnvironment.js +28 -0
- package/lib/esm/blob/s3/R2BlobEnvironment.js.map +1 -0
- package/lib/esm/blob/s3/R2BlobStoreService.js +42 -4
- package/lib/esm/blob/s3/R2BlobStoreService.js.map +1 -1
- package/lib/esm/blob/s3/S3BlobEnvironment.js +28 -0
- package/lib/esm/blob/s3/S3BlobEnvironment.js.map +1 -0
- package/lib/esm/blob/s3/S3BlobStoreService.js +41 -311
- package/lib/esm/blob/s3/S3BlobStoreService.js.map +1 -1
- package/lib/esm/blob/s3/S3CompatibleBlobStoreService.js +322 -0
- package/lib/esm/blob/s3/S3CompatibleBlobStoreService.js.map +1 -0
- package/lib/esm/blob/s3/index.js +4 -0
- package/lib/esm/blob/s3/index.js.map +1 -1
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js +95 -0
- package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js.map +1 -0
- package/lib/esm/graph/engine/catalog/GraphCatalogueErrors.js +22 -0
- package/lib/esm/graph/engine/catalog/GraphCatalogueErrors.js.map +1 -0
- package/lib/esm/graph/engine/catalog/GraphNodeCatalogue.js +265 -0
- package/lib/esm/graph/engine/catalog/GraphNodeCatalogue.js.map +1 -0
- package/lib/esm/graph/engine/catalog/GraphNodeManifestResolver.js +162 -0
- package/lib/esm/graph/engine/catalog/GraphNodeManifestResolver.js.map +1 -0
- package/lib/esm/graph/engine/catalog/GraphNodeMethodRegistry.js +59 -0
- package/lib/esm/graph/engine/catalog/GraphNodeMethodRegistry.js.map +1 -0
- package/lib/esm/graph/engine/catalog/GraphNodeRegistration.js +12 -0
- package/lib/esm/graph/engine/catalog/GraphNodeRegistration.js.map +1 -0
- package/lib/esm/graph/engine/catalog/index.js +7 -0
- package/lib/esm/graph/engine/catalog/index.js.map +1 -0
- package/lib/esm/graph/engine/constants.js +2 -2
- package/lib/esm/graph/engine/errors/GraphExecutionError.js +1 -0
- package/lib/esm/graph/engine/errors/GraphExecutionError.js.map +1 -1
- package/lib/esm/graph/engine/errors/GraphRunCancelledError.js +13 -0
- package/lib/esm/graph/engine/errors/GraphRunCancelledError.js.map +1 -0
- package/lib/esm/graph/engine/errors/index.js +1 -0
- package/lib/esm/graph/engine/errors/index.js.map +1 -1
- package/lib/esm/graph/engine/events/GraphExecutionEventEmitter.js.map +1 -1
- package/lib/esm/graph/engine/events/GraphExecutionEventFactory.js.map +1 -1
- package/lib/esm/graph/engine/events/index.js +0 -1
- package/lib/esm/graph/engine/events/index.js.map +1 -1
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js +2 -2
- package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js +10 -6
- package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js +28 -16
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +322 -41
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionFrame.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionResult.js +3 -3
- package/lib/esm/graph/engine/execution/GraphExecutionResult.js.map +1 -1
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +9 -6
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +11 -10
- package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/index.js +8 -11
- package/lib/esm/graph/engine/index.js.map +1 -1
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js +32 -7
- package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js +32 -7
- package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js +32 -7
- package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/engine/pinning/GraphPinningPolicy.js +2 -2
- package/lib/esm/graph/engine/pinning/GraphPinningPolicy.js.map +1 -1
- package/lib/esm/graph/engine/pinning/GraphPinningService.js +43 -14
- package/lib/esm/graph/engine/pinning/GraphPinningService.js.map +1 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanEdge.js +3 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanEdge.js.map +1 -1
- package/lib/esm/graph/engine/planning/GraphExecutionPlanner.js +79 -88
- package/lib/esm/graph/engine/planning/GraphExecutionPlanner.js.map +1 -1
- package/lib/esm/graph/engine/planning/index.js +0 -1
- package/lib/esm/graph/engine/planning/index.js.map +1 -1
- package/lib/esm/graph/engine/registry/GraphNodeExecutorRegistry.js +28 -15
- package/lib/esm/graph/engine/registry/GraphNodeExecutorRegistry.js.map +1 -1
- package/lib/esm/graph/engine/runs/GraphRunEventPublisher.js +64 -0
- package/lib/esm/graph/engine/runs/GraphRunEventPublisher.js.map +1 -0
- package/lib/esm/graph/engine/runs/GraphRunExecutor.js +286 -0
- package/lib/esm/graph/engine/runs/GraphRunExecutor.js.map +1 -0
- package/lib/esm/graph/engine/runs/GraphRunFingerprint.js +25 -0
- package/lib/esm/graph/engine/runs/GraphRunFingerprint.js.map +1 -0
- package/lib/esm/graph/engine/runs/GraphRunService.js +254 -0
- package/lib/esm/graph/engine/runs/GraphRunService.js.map +1 -0
- package/lib/esm/graph/engine/runs/InMemoryGraphRunEventStore.js +64 -0
- package/lib/esm/graph/engine/runs/InMemoryGraphRunEventStore.js.map +1 -0
- package/lib/esm/graph/engine/runs/InMemoryGraphRunStore.js +21 -0
- package/lib/esm/graph/engine/runs/InMemoryGraphRunStore.js.map +1 -0
- package/lib/esm/graph/engine/runs/index.js +9 -0
- package/lib/esm/graph/engine/runs/index.js.map +1 -0
- package/lib/esm/graph/engine/runs/ownership.js +30 -0
- package/lib/esm/graph/engine/runs/ownership.js.map +1 -0
- package/lib/esm/graph/engine/runs/types.js.map +1 -0
- package/lib/esm/graph/engine/snapshots/GraphExecutionSnapshotMapper.js +1 -1
- package/lib/esm/graph/engine/snapshots/GraphExecutionSnapshotMapper.js.map +1 -1
- package/lib/esm/graph/engine/validation/GraphConnectionPolicyValidator.js +137 -0
- package/lib/esm/graph/engine/validation/GraphConnectionPolicyValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphCredentialReferenceValidator.js +155 -0
- package/lib/esm/graph/engine/validation/GraphCredentialReferenceValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphDefinitionValidator.js +6 -10
- package/lib/esm/graph/engine/validation/GraphDefinitionValidator.js.map +1 -1
- package/lib/esm/graph/engine/validation/GraphEdgeInstanceValidator.js +161 -0
- package/lib/esm/graph/engine/validation/GraphEdgeInstanceValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphNodeInstanceValidator.js +81 -0
- package/lib/esm/graph/engine/validation/GraphNodeInstanceValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js +416 -0
- package/lib/esm/graph/engine/validation/GraphParameterValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphResolvedWorkflow.js +2 -0
- package/lib/esm/graph/engine/validation/GraphResolvedWorkflow.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphValidationErrors.js +43 -0
- package/lib/esm/graph/engine/validation/GraphValidationErrors.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphValidationIssue.js +2 -0
- package/lib/esm/graph/engine/validation/GraphValidationIssue.js.map +1 -0
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js +472 -0
- package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js.map +1 -0
- package/lib/esm/graph/engine/validation/index.js +12 -1
- package/lib/esm/graph/engine/validation/index.js.map +1 -1
- package/lib/esm/graph/index.js +4 -4
- package/lib/esm/graph/log/GraphRunLogger.js +5 -1
- package/lib/esm/graph/log/GraphRunLogger.js.map +1 -1
- package/lib/esm/graph/log/LogParameters.js +1 -1
- package/lib/esm/graph/log/LogParameters.js.map +1 -1
- package/lib/esm/index.js +2 -2
- package/lib/esm/nest/graph/GraphExecutionController.js +143 -19
- package/lib/esm/nest/graph/GraphExecutionController.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutionModule.js +97 -10
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutionResultModel.js +11 -0
- package/lib/esm/nest/graph/GraphExecutionResultModel.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +62 -62
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
- package/lib/esm/nest/graph/GraphNodeCatalogueController.js +261 -0
- package/lib/esm/nest/graph/GraphNodeCatalogueController.js.map +1 -0
- package/lib/esm/nest/graph/GraphResultService.js +16 -1
- package/lib/esm/nest/graph/GraphResultService.js.map +1 -1
- package/lib/esm/nest/graph/GraphRunController.js +270 -0
- package/lib/esm/nest/graph/GraphRunController.js.map +1 -0
- package/lib/esm/nest/graph/GraphRunModel.js +74 -0
- package/lib/esm/nest/graph/GraphRunModel.js.map +1 -0
- package/lib/esm/nest/graph/GraphRunModelService.js +112 -0
- package/lib/esm/nest/graph/GraphRunModelService.js.map +1 -0
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js +164 -0
- package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js.map +1 -0
- package/lib/esm/nest/graph/GraphWorkflowController.js +153 -0
- package/lib/esm/nest/graph/GraphWorkflowController.js.map +1 -0
- package/lib/esm/nest/graph/GraphWorkflowDocumentLimits.js +8 -0
- package/lib/esm/nest/graph/GraphWorkflowDocumentLimits.js.map +1 -0
- package/lib/esm/nest/graph/GraphWorkflowErrors.js +18 -0
- package/lib/esm/nest/graph/GraphWorkflowErrors.js.map +1 -0
- package/lib/esm/nest/graph/GraphWorkflowModel.js +27 -1
- package/lib/esm/nest/graph/GraphWorkflowModel.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowService.js +210 -8
- package/lib/esm/nest/graph/GraphWorkflowService.js.map +1 -1
- package/lib/esm/nest/graph/index.js +8 -0
- package/lib/esm/nest/graph/index.js.map +1 -1
- package/lib/esm/nest/graph/main.js +22 -5
- package/lib/esm/nest/graph/main.js.map +1 -1
- package/lib/esm/nest/keycloakModule.js +3 -1
- package/lib/esm/nest/keycloakModule.js.map +1 -1
- package/lib/esm/secrets/aws/AwsSecretEnvironment.js +23 -0
- package/lib/esm/secrets/aws/AwsSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/aws/AwsSecretService.js +39 -8
- package/lib/esm/secrets/aws/AwsSecretService.js.map +1 -1
- package/lib/esm/secrets/aws/index.js +1 -0
- package/lib/esm/secrets/aws/index.js.map +1 -1
- package/lib/esm/secrets/azure/AzureKeyVaultSecretService.js +30 -4
- package/lib/esm/secrets/azure/AzureKeyVaultSecretService.js.map +1 -1
- package/lib/esm/secrets/azure/AzureSecretEnvironment.js +19 -0
- package/lib/esm/secrets/azure/AzureSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/azure/index.js +1 -0
- package/lib/esm/secrets/azure/index.js.map +1 -1
- package/lib/esm/secrets/core/ClientBasedSecretService.js +24 -0
- package/lib/esm/secrets/core/ClientBasedSecretService.js.map +1 -0
- package/lib/esm/secrets/core/SecretEnvironment.js +15 -0
- package/lib/esm/secrets/core/SecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/core/index.js +2 -0
- package/lib/esm/secrets/core/index.js.map +1 -1
- package/lib/esm/secrets/gcp/GcpSecretEnvironment.js +21 -0
- package/lib/esm/secrets/gcp/GcpSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/gcp/GcpSecretManagerService.js +30 -5
- package/lib/esm/secrets/gcp/GcpSecretManagerService.js.map +1 -1
- package/lib/esm/secrets/gcp/index.js +1 -0
- package/lib/esm/secrets/gcp/index.js.map +1 -1
- package/lib/esm/secrets/model/ModelSecretEnvironment.js +17 -0
- package/lib/esm/secrets/model/ModelSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/model/ModelSecretService.js +28 -5
- package/lib/esm/secrets/model/ModelSecretService.js.map +1 -1
- package/lib/esm/secrets/model/index.js +1 -0
- package/lib/esm/secrets/model/index.js.map +1 -1
- package/lib/esm/secrets/onepassword/OnePasswordSecretEnvironment.js +20 -0
- package/lib/esm/secrets/onepassword/OnePasswordSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/onepassword/OnePasswordSecretService.js +33 -5
- package/lib/esm/secrets/onepassword/OnePasswordSecretService.js.map +1 -1
- package/lib/esm/secrets/onepassword/index.js +1 -0
- package/lib/esm/secrets/onepassword/index.js.map +1 -1
- package/lib/esm/secrets/vault/VaultSecretEnvironment.js +20 -0
- package/lib/esm/secrets/vault/VaultSecretEnvironment.js.map +1 -0
- package/lib/esm/secrets/vault/VaultSecretService.js +33 -5
- package/lib/esm/secrets/vault/VaultSecretService.js.map +1 -1
- package/lib/esm/secrets/vault/index.js +1 -0
- package/lib/esm/secrets/vault/index.js.map +1 -1
- package/lib/esm/sftp/aws/AwsSftpEnvironment.js +27 -0
- package/lib/esm/sftp/aws/AwsSftpEnvironment.js.map +1 -0
- package/lib/esm/sftp/aws/AwsSftpService.js +52 -6
- package/lib/esm/sftp/aws/AwsSftpService.js.map +1 -1
- package/lib/esm/sftp/core/SftpEnvironment.js +15 -0
- package/lib/esm/sftp/core/SftpEnvironment.js.map +1 -0
- package/lib/esm/sftp/core/SftpSource.js +12 -2
- package/lib/esm/sftp/core/SftpSource.js.map +1 -1
- package/lib/esm/sftp/core/index.js +1 -0
- package/lib/esm/sftp/core/index.js.map +1 -1
- package/lib/esm/sftp/index.js +3 -0
- package/lib/esm/sftp/index.js.map +1 -1
- package/lib/esm/sftp/ssh2/Ssh2SftpEnvironment.js +24 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpEnvironment.js.map +1 -0
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js +43 -6
- package/lib/esm/sftp/ssh2/Ssh2SftpService.js.map +1 -1
- package/lib/esm/shared/environmentValue.js +25 -0
- package/lib/esm/shared/environmentValue.js.map +1 -0
- package/lib/types/blob/azure/AzureBlobEnvironment.d.cts +25 -0
- package/lib/types/blob/azure/AzureBlobEnvironment.d.mts +25 -0
- package/lib/types/blob/azure/AzureBlobStoreService.d.cts +1 -0
- package/lib/types/blob/azure/AzureBlobStoreService.d.mts +1 -0
- package/lib/types/blob/azure/index.d.cts +1 -0
- package/lib/types/blob/azure/index.d.mts +1 -0
- package/lib/types/blob/core/BlobEnvironment.d.cts +11 -0
- package/lib/types/blob/core/BlobEnvironment.d.mts +11 -0
- package/lib/types/blob/core/BlobStoreService.d.cts +6 -0
- package/lib/types/blob/core/BlobStoreService.d.mts +6 -0
- package/lib/types/blob/core/index.d.cts +1 -0
- package/lib/types/blob/core/index.d.mts +1 -0
- package/lib/types/blob/gcp/GcsBlobEnvironment.d.cts +17 -0
- package/lib/types/blob/gcp/GcsBlobEnvironment.d.mts +17 -0
- package/lib/types/blob/gcp/GcsBlobStoreService.d.cts +1 -0
- package/lib/types/blob/gcp/GcsBlobStoreService.d.mts +1 -0
- package/lib/types/blob/gcp/index.d.cts +1 -0
- package/lib/types/blob/gcp/index.d.mts +1 -0
- package/lib/types/blob/ipfs/IpfsBlobEnvironment.d.cts +24 -0
- package/lib/types/blob/ipfs/IpfsBlobEnvironment.d.mts +24 -0
- package/lib/types/blob/ipfs/IpfsBlobStoreService.d.cts +1 -0
- package/lib/types/blob/ipfs/IpfsBlobStoreService.d.mts +1 -0
- package/lib/types/blob/ipfs/index.d.cts +1 -0
- package/lib/types/blob/ipfs/index.d.mts +1 -0
- package/lib/types/blob/local/LocalBlobEnvironment.d.cts +15 -0
- package/lib/types/blob/local/LocalBlobEnvironment.d.mts +15 -0
- package/lib/types/blob/local/LocalBlobStoreService.d.cts +1 -0
- package/lib/types/blob/local/LocalBlobStoreService.d.mts +1 -0
- package/lib/types/blob/local/index.d.cts +1 -0
- package/lib/types/blob/local/index.d.mts +1 -0
- package/lib/types/blob/memory/MemoryBlobEnvironment.d.cts +14 -0
- package/lib/types/blob/memory/MemoryBlobEnvironment.d.mts +14 -0
- package/lib/types/blob/memory/MemoryBlobStoreService.d.cts +1 -0
- package/lib/types/blob/memory/MemoryBlobStoreService.d.mts +1 -0
- package/lib/types/blob/memory/index.d.cts +1 -0
- package/lib/types/blob/memory/index.d.mts +1 -0
- package/lib/types/blob/s3/MinioBlobEnvironment.d.cts +11 -0
- package/lib/types/blob/s3/MinioBlobEnvironment.d.mts +11 -0
- package/lib/types/blob/s3/MinioBlobStoreService.d.cts +4 -7
- package/lib/types/blob/s3/MinioBlobStoreService.d.mts +4 -7
- package/lib/types/blob/s3/R2BlobEnvironment.d.cts +11 -0
- package/lib/types/blob/s3/R2BlobEnvironment.d.mts +11 -0
- package/lib/types/blob/s3/R2BlobStoreService.d.cts +4 -7
- package/lib/types/blob/s3/R2BlobStoreService.d.mts +4 -7
- package/lib/types/blob/s3/S3BlobEnvironment.d.cts +26 -0
- package/lib/types/blob/s3/S3BlobEnvironment.d.mts +26 -0
- package/lib/types/blob/s3/S3BlobStoreService.d.cts +4 -24
- package/lib/types/blob/s3/S3BlobStoreService.d.mts +4 -24
- package/lib/types/blob/s3/S3CompatibleBlobStoreService.d.cts +30 -0
- package/lib/types/blob/s3/S3CompatibleBlobStoreService.d.mts +30 -0
- package/lib/types/blob/s3/index.d.cts +4 -0
- package/lib/types/blob/s3/index.d.mts +4 -0
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.cts +17 -0
- package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.mts +17 -0
- package/lib/types/graph/engine/catalog/GraphCatalogueErrors.d.cts +13 -0
- package/lib/types/graph/engine/catalog/GraphCatalogueErrors.d.mts +13 -0
- package/lib/types/graph/engine/catalog/GraphNodeCatalogue.d.cts +71 -0
- package/lib/types/graph/engine/catalog/GraphNodeCatalogue.d.mts +71 -0
- package/lib/types/graph/engine/catalog/GraphNodeManifestResolver.d.cts +42 -0
- package/lib/types/graph/engine/catalog/GraphNodeManifestResolver.d.mts +42 -0
- package/lib/types/graph/engine/catalog/GraphNodeMethodRegistry.d.cts +22 -0
- package/lib/types/graph/engine/catalog/GraphNodeMethodRegistry.d.mts +22 -0
- package/lib/types/graph/engine/catalog/GraphNodeRegistration.d.cts +68 -0
- package/lib/types/graph/engine/catalog/GraphNodeRegistration.d.mts +68 -0
- package/lib/types/graph/engine/catalog/index.d.cts +6 -0
- package/lib/types/graph/engine/catalog/index.d.mts +6 -0
- package/lib/types/graph/engine/constants.d.cts +2 -2
- package/lib/types/graph/engine/constants.d.mts +2 -2
- package/lib/types/graph/engine/errors/GraphRunCancelledError.d.cts +9 -0
- package/lib/types/graph/engine/errors/GraphRunCancelledError.d.mts +9 -0
- package/lib/types/graph/engine/errors/index.d.cts +1 -0
- package/lib/types/graph/engine/errors/index.d.mts +1 -0
- package/lib/types/graph/engine/events/GraphExecutionEventEmitter.d.cts +1 -1
- package/lib/types/graph/engine/events/GraphExecutionEventEmitter.d.mts +1 -1
- package/lib/types/graph/engine/events/GraphExecutionEventFactory.d.cts +1 -1
- package/lib/types/graph/engine/events/GraphExecutionEventFactory.d.mts +1 -1
- package/lib/types/graph/engine/events/GraphExecutionObserver.d.cts +1 -1
- package/lib/types/graph/engine/events/GraphExecutionObserver.d.mts +1 -1
- package/lib/types/graph/engine/events/index.d.cts +0 -1
- package/lib/types/graph/engine/events/index.d.mts +0 -1
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +28 -14
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +28 -14
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +106 -23
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +106 -23
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.cts +2 -1
- package/lib/types/graph/engine/execution/GraphExecutionFrame.d.mts +2 -1
- package/lib/types/graph/engine/execution/GraphExecutionResult.d.cts +3 -3
- package/lib/types/graph/engine/execution/GraphExecutionResult.d.mts +3 -3
- package/lib/types/graph/engine/execution/GraphNodeExecutor.d.cts +17 -9
- package/lib/types/graph/engine/execution/GraphNodeExecutor.d.mts +17 -9
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +3 -3
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +3 -3
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/index.d.cts +6 -9
- package/lib/types/graph/engine/index.d.mts +6 -9
- package/lib/types/graph/engine/loops/ConditionExpressionEvaluator.d.cts +1 -1
- package/lib/types/graph/engine/loops/ConditionExpressionEvaluator.d.mts +1 -1
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/loops/GraphConditionEvaluator.d.cts +1 -1
- package/lib/types/graph/engine/loops/GraphConditionEvaluator.d.mts +1 -1
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.cts +2 -2
- package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.mts +2 -2
- package/lib/types/graph/engine/pinning/GraphPinningService.d.cts +16 -5
- package/lib/types/graph/engine/pinning/GraphPinningService.d.mts +16 -5
- package/lib/types/graph/engine/planning/GraphExecutionPlan.d.cts +8 -4
- package/lib/types/graph/engine/planning/GraphExecutionPlan.d.mts +8 -4
- package/lib/types/graph/engine/planning/GraphExecutionPlanEdge.d.cts +9 -4
- package/lib/types/graph/engine/planning/GraphExecutionPlanEdge.d.mts +9 -4
- package/lib/types/graph/engine/planning/GraphExecutionPlanNode.d.cts +17 -9
- package/lib/types/graph/engine/planning/GraphExecutionPlanNode.d.mts +17 -9
- package/lib/types/graph/engine/planning/GraphExecutionPlanner.d.cts +21 -33
- package/lib/types/graph/engine/planning/GraphExecutionPlanner.d.mts +21 -33
- package/lib/types/graph/engine/planning/index.d.cts +0 -1
- package/lib/types/graph/engine/planning/index.d.mts +0 -1
- package/lib/types/graph/engine/registry/GraphNodeExecutorRegistry.d.cts +22 -8
- package/lib/types/graph/engine/registry/GraphNodeExecutorRegistry.d.mts +22 -8
- package/lib/types/graph/engine/runs/GraphRunEventPublisher.d.cts +26 -0
- package/lib/types/graph/engine/runs/GraphRunEventPublisher.d.mts +26 -0
- package/lib/types/graph/engine/runs/GraphRunExecutor.d.cts +75 -0
- package/lib/types/graph/engine/runs/GraphRunExecutor.d.mts +75 -0
- package/lib/types/graph/engine/runs/GraphRunFingerprint.d.cts +8 -0
- package/lib/types/graph/engine/runs/GraphRunFingerprint.d.mts +8 -0
- package/lib/types/graph/engine/runs/GraphRunService.d.cts +93 -0
- package/lib/types/graph/engine/runs/GraphRunService.d.mts +93 -0
- package/lib/types/graph/engine/runs/InMemoryGraphRunEventStore.d.cts +28 -0
- package/lib/types/graph/engine/runs/InMemoryGraphRunEventStore.d.mts +28 -0
- package/lib/types/graph/engine/runs/InMemoryGraphRunStore.d.cts +12 -0
- package/lib/types/graph/engine/runs/InMemoryGraphRunStore.d.mts +12 -0
- package/lib/types/graph/engine/runs/index.d.cts +8 -0
- package/lib/types/graph/engine/runs/index.d.mts +8 -0
- package/lib/types/graph/engine/runs/ownership.d.cts +25 -0
- package/lib/types/graph/engine/runs/ownership.d.mts +25 -0
- package/lib/types/graph/engine/runs/types.d.cts +83 -0
- package/lib/types/graph/engine/runs/types.d.mts +83 -0
- package/lib/types/graph/engine/types.d.cts +37 -12
- package/lib/types/graph/engine/types.d.mts +37 -12
- package/lib/types/graph/engine/validation/GraphConnectionPolicyValidator.d.cts +32 -0
- package/lib/types/graph/engine/validation/GraphConnectionPolicyValidator.d.mts +32 -0
- package/lib/types/graph/engine/validation/GraphCredentialReferenceValidator.d.cts +62 -0
- package/lib/types/graph/engine/validation/GraphCredentialReferenceValidator.d.mts +62 -0
- package/lib/types/graph/engine/validation/GraphDefinitionValidator.d.cts +11 -9
- package/lib/types/graph/engine/validation/GraphDefinitionValidator.d.mts +11 -9
- package/lib/types/graph/engine/validation/GraphEdgeInstanceValidator.d.cts +32 -0
- package/lib/types/graph/engine/validation/GraphEdgeInstanceValidator.d.mts +32 -0
- package/lib/types/graph/engine/validation/GraphNodeInstanceValidator.d.cts +37 -0
- package/lib/types/graph/engine/validation/GraphNodeInstanceValidator.d.mts +37 -0
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.cts +92 -0
- package/lib/types/graph/engine/validation/GraphParameterValidator.d.mts +92 -0
- package/lib/types/graph/engine/validation/GraphResolvedWorkflow.d.cts +66 -0
- package/lib/types/graph/engine/validation/GraphResolvedWorkflow.d.mts +66 -0
- package/lib/types/graph/engine/validation/GraphValidationErrors.d.cts +34 -0
- package/lib/types/graph/engine/validation/GraphValidationErrors.d.mts +34 -0
- package/lib/types/graph/engine/validation/GraphValidationIssue.d.cts +39 -0
- package/lib/types/graph/engine/validation/GraphValidationIssue.d.mts +39 -0
- package/lib/types/graph/engine/validation/GraphWorkflowDocumentValidator.d.cts +162 -0
- package/lib/types/graph/engine/validation/GraphWorkflowDocumentValidator.d.mts +162 -0
- package/lib/types/graph/engine/validation/index.d.cts +12 -1
- package/lib/types/graph/engine/validation/index.d.mts +12 -1
- package/lib/types/graph/index.d.cts +4 -4
- package/lib/types/graph/index.d.mts +4 -4
- package/lib/types/graph/log/GraphRunLogger.d.cts +3 -1
- package/lib/types/graph/log/GraphRunLogger.d.mts +3 -1
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/nest/graph/GraphExecutionController.d.cts +83 -4
- package/lib/types/nest/graph/GraphExecutionController.d.mts +83 -4
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +64 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +64 -0
- package/lib/types/nest/graph/GraphExecutionResultModel.d.cts +12 -0
- package/lib/types/nest/graph/GraphExecutionResultModel.d.mts +12 -0
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +42 -28
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +42 -28
- package/lib/types/nest/graph/GraphNodeCatalogueController.d.cts +70 -0
- package/lib/types/nest/graph/GraphNodeCatalogueController.d.mts +70 -0
- package/lib/types/nest/graph/GraphResultService.d.cts +12 -0
- package/lib/types/nest/graph/GraphResultService.d.mts +12 -0
- package/lib/types/nest/graph/GraphRunController.d.cts +87 -0
- package/lib/types/nest/graph/GraphRunController.d.mts +87 -0
- package/lib/types/nest/graph/GraphRunModel.d.cts +22 -0
- package/lib/types/nest/graph/GraphRunModel.d.mts +22 -0
- package/lib/types/nest/graph/GraphRunModelService.d.cts +21 -0
- package/lib/types/nest/graph/GraphRunModelService.d.mts +21 -0
- package/lib/types/nest/graph/GraphWorkflowBoundaryValidation.d.cts +28 -0
- package/lib/types/nest/graph/GraphWorkflowBoundaryValidation.d.mts +28 -0
- package/lib/types/nest/graph/GraphWorkflowController.d.cts +62 -0
- package/lib/types/nest/graph/GraphWorkflowController.d.mts +62 -0
- package/lib/types/nest/graph/GraphWorkflowDocumentLimits.d.cts +33 -0
- package/lib/types/nest/graph/GraphWorkflowDocumentLimits.d.mts +33 -0
- package/lib/types/nest/graph/GraphWorkflowErrors.d.cts +13 -0
- package/lib/types/nest/graph/GraphWorkflowErrors.d.mts +13 -0
- package/lib/types/nest/graph/GraphWorkflowModel.d.cts +19 -1
- package/lib/types/nest/graph/GraphWorkflowModel.d.mts +19 -1
- package/lib/types/nest/graph/GraphWorkflowService.d.cts +48 -1
- package/lib/types/nest/graph/GraphWorkflowService.d.mts +48 -1
- package/lib/types/nest/graph/index.d.cts +8 -0
- package/lib/types/nest/graph/index.d.mts +8 -0
- package/lib/types/nest/keycloakModule.d.cts +9 -1
- package/lib/types/nest/keycloakModule.d.mts +9 -1
- package/lib/types/secrets/aws/AwsSecretEnvironment.d.cts +21 -0
- package/lib/types/secrets/aws/AwsSecretEnvironment.d.mts +21 -0
- package/lib/types/secrets/aws/AwsSecretService.d.cts +4 -3
- package/lib/types/secrets/aws/AwsSecretService.d.mts +4 -3
- package/lib/types/secrets/aws/index.d.cts +1 -0
- package/lib/types/secrets/aws/index.d.mts +1 -0
- package/lib/types/secrets/azure/AzureKeyVaultSecretService.d.cts +4 -3
- package/lib/types/secrets/azure/AzureKeyVaultSecretService.d.mts +4 -3
- package/lib/types/secrets/azure/AzureSecretEnvironment.d.cts +14 -0
- package/lib/types/secrets/azure/AzureSecretEnvironment.d.mts +14 -0
- package/lib/types/secrets/azure/index.d.cts +1 -0
- package/lib/types/secrets/azure/index.d.mts +1 -0
- package/lib/types/secrets/core/ClientBasedSecretService.d.cts +20 -0
- package/lib/types/secrets/core/ClientBasedSecretService.d.mts +20 -0
- package/lib/types/secrets/core/SecretEnvironment.d.cts +11 -0
- package/lib/types/secrets/core/SecretEnvironment.d.mts +11 -0
- package/lib/types/secrets/core/index.d.cts +2 -0
- package/lib/types/secrets/core/index.d.mts +2 -0
- package/lib/types/secrets/gcp/GcpSecretEnvironment.d.cts +16 -0
- package/lib/types/secrets/gcp/GcpSecretEnvironment.d.mts +16 -0
- package/lib/types/secrets/gcp/GcpSecretManagerService.d.cts +4 -3
- package/lib/types/secrets/gcp/GcpSecretManagerService.d.mts +4 -3
- package/lib/types/secrets/gcp/index.d.cts +1 -0
- package/lib/types/secrets/gcp/index.d.mts +1 -0
- package/lib/types/secrets/model/ModelSecretEnvironment.d.cts +14 -0
- package/lib/types/secrets/model/ModelSecretEnvironment.d.mts +14 -0
- package/lib/types/secrets/model/ModelSecretService.d.cts +4 -3
- package/lib/types/secrets/model/ModelSecretService.d.mts +4 -3
- package/lib/types/secrets/model/ModelSecretServiceConfig.d.cts +2 -1
- package/lib/types/secrets/model/ModelSecretServiceConfig.d.mts +2 -1
- package/lib/types/secrets/model/index.d.cts +1 -0
- package/lib/types/secrets/model/index.d.mts +1 -0
- package/lib/types/secrets/onepassword/OnePasswordSecretEnvironment.d.cts +17 -0
- package/lib/types/secrets/onepassword/OnePasswordSecretEnvironment.d.mts +17 -0
- package/lib/types/secrets/onepassword/OnePasswordSecretService.d.cts +4 -3
- package/lib/types/secrets/onepassword/OnePasswordSecretService.d.mts +4 -3
- package/lib/types/secrets/onepassword/index.d.cts +1 -0
- package/lib/types/secrets/onepassword/index.d.mts +1 -0
- package/lib/types/secrets/vault/VaultSecretEnvironment.d.cts +17 -0
- package/lib/types/secrets/vault/VaultSecretEnvironment.d.mts +17 -0
- package/lib/types/secrets/vault/VaultSecretService.d.cts +4 -3
- package/lib/types/secrets/vault/VaultSecretService.d.mts +4 -3
- package/lib/types/secrets/vault/index.d.cts +1 -0
- package/lib/types/secrets/vault/index.d.mts +1 -0
- package/lib/types/sftp/aws/AwsSftpEnvironment.d.cts +24 -0
- package/lib/types/sftp/aws/AwsSftpEnvironment.d.mts +24 -0
- package/lib/types/sftp/aws/AwsSftpService.d.cts +1 -0
- package/lib/types/sftp/aws/AwsSftpService.d.mts +1 -0
- package/lib/types/sftp/core/SftpEnvironment.d.cts +11 -0
- package/lib/types/sftp/core/SftpEnvironment.d.mts +11 -0
- package/lib/types/sftp/core/SftpSource.d.cts +7 -0
- package/lib/types/sftp/core/SftpSource.d.mts +7 -0
- package/lib/types/sftp/core/index.d.cts +1 -0
- package/lib/types/sftp/core/index.d.mts +1 -0
- package/lib/types/sftp/index.d.cts +3 -0
- package/lib/types/sftp/index.d.mts +3 -0
- package/lib/types/sftp/ssh2/Ssh2SftpEnvironment.d.cts +21 -0
- package/lib/types/sftp/ssh2/Ssh2SftpEnvironment.d.mts +21 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.cts +1 -0
- package/lib/types/sftp/ssh2/Ssh2SftpService.d.mts +1 -0
- package/lib/types/shared/environmentValue.d.cts +16 -0
- package/lib/types/shared/environmentValue.d.mts +16 -0
- package/package.json +6 -16
- package/lib/cjs/graph/engine/events/GraphExecutionEvent.cjs +0 -4
- package/lib/cjs/graph/engine/events/GraphExecutionEvent.cjs.map +0 -1
- package/lib/cjs/graph/engine/planning/GraphRelationResolver.cjs +0 -172
- package/lib/cjs/graph/engine/planning/GraphRelationResolver.cjs.map +0 -1
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs +0 -97
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs.map +0 -1
- package/lib/cjs/graph/shared/constants.cjs +0 -99
- package/lib/cjs/graph/shared/constants.cjs.map +0 -1
- package/lib/cjs/graph/shared/index.cjs +0 -46
- package/lib/cjs/graph/shared/index.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/agent.cjs +0 -110
- package/lib/cjs/graph/shared/nodes/agent.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/base.cjs +0 -36
- package/lib/cjs/graph/shared/nodes/base.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/category-styles.cjs +0 -38
- package/lib/cjs/graph/shared/nodes/category-styles.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/flow-control.cjs +0 -630
- package/lib/cjs/graph/shared/nodes/flow-control.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/index.cjs +0 -35
- package/lib/cjs/graph/shared/nodes/index.cjs.map +0 -1
- package/lib/cjs/graph/shared/nodes/triggers.cjs +0 -250
- package/lib/cjs/graph/shared/nodes/triggers.cjs.map +0 -1
- package/lib/cjs/graph/shared/types.cjs.map +0 -1
- package/lib/esm/graph/engine/events/GraphExecutionEvent.js +0 -2
- package/lib/esm/graph/engine/events/GraphExecutionEvent.js.map +0 -1
- package/lib/esm/graph/engine/planning/GraphRelationResolver.js +0 -167
- package/lib/esm/graph/engine/planning/GraphRelationResolver.js.map +0 -1
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js +0 -91
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js.map +0 -1
- package/lib/esm/graph/shared/constants.js +0 -135
- package/lib/esm/graph/shared/constants.js.map +0 -1
- package/lib/esm/graph/shared/index.js +0 -25
- package/lib/esm/graph/shared/index.js.map +0 -1
- package/lib/esm/graph/shared/nodes/agent.js +0 -101
- package/lib/esm/graph/shared/nodes/agent.js.map +0 -1
- package/lib/esm/graph/shared/nodes/base.js +0 -31
- package/lib/esm/graph/shared/nodes/base.js.map +0 -1
- package/lib/esm/graph/shared/nodes/category-styles.js +0 -34
- package/lib/esm/graph/shared/nodes/category-styles.js.map +0 -1
- package/lib/esm/graph/shared/nodes/flow-control.js +0 -621
- package/lib/esm/graph/shared/nodes/flow-control.js.map +0 -1
- package/lib/esm/graph/shared/nodes/index.js +0 -18
- package/lib/esm/graph/shared/nodes/index.js.map +0 -1
- package/lib/esm/graph/shared/nodes/triggers.js +0 -241
- package/lib/esm/graph/shared/nodes/triggers.js.map +0 -1
- package/lib/esm/graph/shared/types.js.map +0 -1
- package/lib/types/graph/engine/events/GraphExecutionEvent.d.cts +0 -6
- package/lib/types/graph/engine/events/GraphExecutionEvent.d.mts +0 -6
- package/lib/types/graph/engine/planning/GraphRelationResolver.d.cts +0 -62
- package/lib/types/graph/engine/planning/GraphRelationResolver.d.mts +0 -62
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.cts +0 -66
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.mts +0 -66
- package/lib/types/graph/shared/constants.d.cts +0 -120
- package/lib/types/graph/shared/constants.d.mts +0 -120
- package/lib/types/graph/shared/index.d.cts +0 -21
- package/lib/types/graph/shared/index.d.mts +0 -21
- package/lib/types/graph/shared/nodes/agent.d.cts +0 -44
- package/lib/types/graph/shared/nodes/agent.d.mts +0 -44
- package/lib/types/graph/shared/nodes/base.d.cts +0 -28
- package/lib/types/graph/shared/nodes/base.d.mts +0 -28
- package/lib/types/graph/shared/nodes/category-styles.d.cts +0 -8
- package/lib/types/graph/shared/nodes/category-styles.d.mts +0 -8
- package/lib/types/graph/shared/nodes/flow-control.d.cts +0 -163
- package/lib/types/graph/shared/nodes/flow-control.d.mts +0 -163
- package/lib/types/graph/shared/nodes/index.d.cts +0 -17
- package/lib/types/graph/shared/nodes/index.d.mts +0 -17
- package/lib/types/graph/shared/nodes/triggers.d.cts +0 -53
- package/lib/types/graph/shared/nodes/triggers.d.mts +0 -53
- package/lib/types/graph/shared/types.d.cts +0 -257
- package/lib/types/graph/shared/types.d.mts +0 -257
- /package/lib/cjs/graph/{shared → engine/runs}/types.cjs +0 -0
- /package/lib/esm/graph/{shared → engine/runs}/types.js +0 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @module integrations/nest/graph/GraphNodeCatalogueController
|
|
15
|
+
* @summary Catalogue HTTP API (DECAF-50 §4.12–§4.13).
|
|
16
|
+
* @description Serves the trusted node catalogue over HTTP — manifest
|
|
17
|
+
* listing (`node-types`), per-kind manifests/icons, parameterized `resolve`,
|
|
18
|
+
* and node-method invocation — with optional authentication and per-user
|
|
19
|
+
* rate limits on the expensive `resolve`/`methods` operations; non-JSON-safe
|
|
20
|
+
* request bodies are rejected.
|
|
21
|
+
*/
|
|
22
|
+
import { Controller, Get, Post, Body, Param, Headers, HttpException, HttpStatus, Optional, Inject, Res, } from "@nestjs/common";
|
|
23
|
+
import { createHash } from "node:crypto";
|
|
24
|
+
import { DecafRequestContext } from "@decaf-ts/for-nest";
|
|
25
|
+
import { cloneGraphJsonValue, isGraphNodeMethodType, isGraphJsonSafeValue, } from "@decaf-ts/ui-decorators/graph";
|
|
26
|
+
import { GraphNodeCatalogue } from "./../../graph/index.js";
|
|
27
|
+
import { graphWorkflowOwnerOf } from "./GraphWorkflowService.js";
|
|
28
|
+
/** DI token for {@link GraphCatalogueControllerOptions}. */
|
|
29
|
+
export const GRAPH_CATALOGUE_CONTROLLER_OPTIONS = "GRAPH_CATALOGUE_CONTROLLER_OPTIONS";
|
|
30
|
+
const DEFAULT_RATE_LIMIT = {
|
|
31
|
+
windowMs: 60_000,
|
|
32
|
+
maxRequests: 60,
|
|
33
|
+
};
|
|
34
|
+
function sanitizeGraphJsonInput(value, scope) {
|
|
35
|
+
if (!isGraphJsonSafeValue(value)) {
|
|
36
|
+
throw new HttpException(`${scope} must be JSON-safe: functions, class instances, undefined, NaN/Infinity, symbol keys and unsafe prototype keys (__proto__/prototype/constructor) are not allowed`, HttpStatus.UNPROCESSABLE_ENTITY);
|
|
37
|
+
}
|
|
38
|
+
return cloneGraphJsonValue(value);
|
|
39
|
+
}
|
|
40
|
+
function manifestDigest(payload) {
|
|
41
|
+
return `"${createHash("sha1")
|
|
42
|
+
.update(JSON.stringify(payload))
|
|
43
|
+
.digest("base64url")}"`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Catalogue HTTP API (DECAF-50 §4.13): serves registered node manifests as
|
|
47
|
+
* data (never constructors), resolves effective manifests for node
|
|
48
|
+
* instances, and invokes declared node methods. Enforces configured
|
|
49
|
+
* authentication and per-user rate limits on the expensive
|
|
50
|
+
* `resolve`/`methods` operations, and rejects non-JSON-safe request bodies.
|
|
51
|
+
*/
|
|
52
|
+
let GraphNodeCatalogueController = class GraphNodeCatalogueController {
|
|
53
|
+
constructor(catalogue, requestContext, options = {}) {
|
|
54
|
+
this.catalogue = catalogue;
|
|
55
|
+
this.requestContext = requestContext;
|
|
56
|
+
this.options = options;
|
|
57
|
+
this.rateBuckets = new Map();
|
|
58
|
+
}
|
|
59
|
+
requireAuthenticatedContext() {
|
|
60
|
+
if ((this.options.auth ?? "required") !== "required") {
|
|
61
|
+
return this.requestContext;
|
|
62
|
+
}
|
|
63
|
+
if (!this.requestContext) {
|
|
64
|
+
throw new HttpException("Graph node catalogue access requires an authenticated request context", HttpStatus.UNAUTHORIZED);
|
|
65
|
+
}
|
|
66
|
+
return this.requestContext;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Builds the rate-limit bucket key for an operation: the authenticated
|
|
70
|
+
* owner resolved via {@link graphWorkflowOwnerOf} (SAA-595 F6), falling
|
|
71
|
+
* back to the context `user.id`, then the request IP, then a shared
|
|
72
|
+
* `"anonymous"` bucket.
|
|
73
|
+
*/
|
|
74
|
+
rateLimitKey(operation) {
|
|
75
|
+
const context = this.requestContext;
|
|
76
|
+
const user = context?.["user"];
|
|
77
|
+
const identity = graphWorkflowOwnerOf(context) ||
|
|
78
|
+
(typeof user?.["id"] === "string" && user["id"]) ||
|
|
79
|
+
context?.request
|
|
80
|
+
?.ip ||
|
|
81
|
+
"anonymous";
|
|
82
|
+
return `${operation}:${identity}`;
|
|
83
|
+
}
|
|
84
|
+
enforceRateLimit(operation, limits) {
|
|
85
|
+
const config = { ...DEFAULT_RATE_LIMIT, ...limits };
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
const key = this.rateLimitKey(operation);
|
|
88
|
+
const bucket = this.rateBuckets.get(key);
|
|
89
|
+
if (!bucket || bucket.resetAt <= now) {
|
|
90
|
+
this.rateBuckets.set(key, { count: 1, resetAt: now + config.windowMs });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (bucket.count >= config.maxRequests) {
|
|
94
|
+
throw new HttpException(`Rate limit exceeded for graph catalogue operation '${operation}' (max ${config.maxRequests} per ${config.windowMs}ms)`, HttpStatus.TOO_MANY_REQUESTS);
|
|
95
|
+
}
|
|
96
|
+
bucket.count += 1;
|
|
97
|
+
}
|
|
98
|
+
async listNodeTypes(ifNoneMatch, res) {
|
|
99
|
+
this.requireAuthenticatedContext();
|
|
100
|
+
const manifests = this.catalogue.listManifests();
|
|
101
|
+
const etag = manifestDigest(manifests);
|
|
102
|
+
res.setHeader("ETag", etag);
|
|
103
|
+
if (ifNoneMatch && ifNoneMatch === etag) {
|
|
104
|
+
res.status(HttpStatus.NOT_MODIFIED);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
return manifests;
|
|
108
|
+
}
|
|
109
|
+
async getNodeType(kind) {
|
|
110
|
+
this.requireAuthenticatedContext();
|
|
111
|
+
this.assertKnownKind(kind);
|
|
112
|
+
return this.catalogue.getManifest(kind);
|
|
113
|
+
}
|
|
114
|
+
async getNodeTypeIcon(kind) {
|
|
115
|
+
this.requireAuthenticatedContext();
|
|
116
|
+
this.assertKnownKind(kind);
|
|
117
|
+
const manifest = this.catalogue.getManifest(kind);
|
|
118
|
+
return { kind, icon: manifest.display.icon ?? null };
|
|
119
|
+
}
|
|
120
|
+
async resolveNodeType(kind, body = {}) {
|
|
121
|
+
this.requireAuthenticatedContext();
|
|
122
|
+
this.enforceRateLimit("resolve", this.options.resolveRateLimit);
|
|
123
|
+
this.assertKnownKind(kind);
|
|
124
|
+
const parameters = body?.parameters
|
|
125
|
+
? sanitizeGraphJsonInput(body.parameters, "resolve parameters")
|
|
126
|
+
: {};
|
|
127
|
+
const metadata = body?.metadata
|
|
128
|
+
? sanitizeGraphJsonInput(body.metadata, "resolve metadata")
|
|
129
|
+
: undefined;
|
|
130
|
+
const instance = {
|
|
131
|
+
id: `resolve:${kind}`,
|
|
132
|
+
kind,
|
|
133
|
+
parameters,
|
|
134
|
+
...(metadata ? { metadata } : {}),
|
|
135
|
+
};
|
|
136
|
+
const context = {
|
|
137
|
+
requestContext: this.requestContext,
|
|
138
|
+
};
|
|
139
|
+
return this.catalogue.resolveManifest(kind, instance, context);
|
|
140
|
+
}
|
|
141
|
+
async invokeNodeMethod(kind, method, body = {}) {
|
|
142
|
+
this.requireAuthenticatedContext();
|
|
143
|
+
this.enforceRateLimit("methods", this.options.methodsRateLimit);
|
|
144
|
+
this.assertKnownKind(kind);
|
|
145
|
+
this.declaredMethod(kind, method, body?.methodType);
|
|
146
|
+
const parameters = body?.parameters
|
|
147
|
+
? sanitizeGraphJsonInput(body.parameters, "method parameters")
|
|
148
|
+
: {};
|
|
149
|
+
const payload = body?.payload !== undefined
|
|
150
|
+
? sanitizeGraphJsonInput(body.payload, "method payload")
|
|
151
|
+
: undefined;
|
|
152
|
+
const credentials = this.authorizeCredentials(kind, body?.credentials);
|
|
153
|
+
const nodeMethod = this.catalogue.getMethod(kind, method);
|
|
154
|
+
return nodeMethod({
|
|
155
|
+
kind,
|
|
156
|
+
method,
|
|
157
|
+
parameters,
|
|
158
|
+
...(payload !== undefined ? { payload } : {}),
|
|
159
|
+
}, {
|
|
160
|
+
requestContext: this.requestContext,
|
|
161
|
+
...(credentials.length ? { credentials } : {}),
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
assertKnownKind(kind) {
|
|
165
|
+
if (!this.catalogue.has(kind)) {
|
|
166
|
+
throw new HttpException(`No graph node kind '${kind}' is registered in the catalogue`, HttpStatus.NOT_FOUND);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
declaredMethod(kind, method, expectedType) {
|
|
170
|
+
let declaration;
|
|
171
|
+
try {
|
|
172
|
+
declaration = this.catalogue.getMethodDeclaration(kind, method);
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
throw new HttpException(`Graph node kind '${kind}' does not declare method '${method}'`, HttpStatus.NOT_FOUND);
|
|
176
|
+
}
|
|
177
|
+
if (!isGraphNodeMethodType(declaration.type)) {
|
|
178
|
+
throw new HttpException(`Graph node kind '${kind}' declares method '${method}' with an invalid type '${String(declaration.type)}'`, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
179
|
+
}
|
|
180
|
+
if (expectedType && expectedType !== declaration.type) {
|
|
181
|
+
throw new HttpException(`Method '${method}' on kind '${kind}' has type '${declaration.type}', not '${expectedType}'`, HttpStatus.BAD_REQUEST);
|
|
182
|
+
}
|
|
183
|
+
return declaration;
|
|
184
|
+
}
|
|
185
|
+
authorizeCredentials(kind, provided) {
|
|
186
|
+
const requirements = this.catalogue.getManifest(kind).credentials ?? [];
|
|
187
|
+
const references = provided ?? [];
|
|
188
|
+
for (const reference of references) {
|
|
189
|
+
if (!reference ||
|
|
190
|
+
typeof reference.credentialId !== "string" ||
|
|
191
|
+
!reference.credentialId ||
|
|
192
|
+
typeof reference.credentialType !== "string" ||
|
|
193
|
+
!reference.credentialType) {
|
|
194
|
+
throw new HttpException("Credential references must carry a credentialId and a credentialType", HttpStatus.BAD_REQUEST);
|
|
195
|
+
}
|
|
196
|
+
const declared = requirements.some((requirement) => requirement.type === reference.credentialType);
|
|
197
|
+
if (!declared) {
|
|
198
|
+
throw new HttpException(`Graph node kind '${kind}' does not accept credentials of type '${reference.credentialType}'`, HttpStatus.FORBIDDEN);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
for (const requirement of requirements) {
|
|
202
|
+
if (!requirement.required)
|
|
203
|
+
continue;
|
|
204
|
+
const satisfied = references.some((reference) => reference.credentialType === requirement.type);
|
|
205
|
+
if (!satisfied) {
|
|
206
|
+
throw new HttpException(`Graph node kind '${kind}' requires a credential of type '${requirement.type}'`, HttpStatus.UNAUTHORIZED);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return references;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
__decorate([
|
|
213
|
+
Get("node-types"),
|
|
214
|
+
__param(0, Headers("if-none-match")),
|
|
215
|
+
__param(1, Res({ passthrough: true })),
|
|
216
|
+
__metadata("design:type", Function),
|
|
217
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
218
|
+
__metadata("design:returntype", Promise)
|
|
219
|
+
], GraphNodeCatalogueController.prototype, "listNodeTypes", null);
|
|
220
|
+
__decorate([
|
|
221
|
+
Get("node-types/:kind"),
|
|
222
|
+
__param(0, Param("kind")),
|
|
223
|
+
__metadata("design:type", Function),
|
|
224
|
+
__metadata("design:paramtypes", [String]),
|
|
225
|
+
__metadata("design:returntype", Promise)
|
|
226
|
+
], GraphNodeCatalogueController.prototype, "getNodeType", null);
|
|
227
|
+
__decorate([
|
|
228
|
+
Get("node-types/:kind/icon"),
|
|
229
|
+
__param(0, Param("kind")),
|
|
230
|
+
__metadata("design:type", Function),
|
|
231
|
+
__metadata("design:paramtypes", [String]),
|
|
232
|
+
__metadata("design:returntype", Promise)
|
|
233
|
+
], GraphNodeCatalogueController.prototype, "getNodeTypeIcon", null);
|
|
234
|
+
__decorate([
|
|
235
|
+
Post("node-types/:kind/resolve"),
|
|
236
|
+
__param(0, Param("kind")),
|
|
237
|
+
__param(1, Body()),
|
|
238
|
+
__metadata("design:type", Function),
|
|
239
|
+
__metadata("design:paramtypes", [String, Object]),
|
|
240
|
+
__metadata("design:returntype", Promise)
|
|
241
|
+
], GraphNodeCatalogueController.prototype, "resolveNodeType", null);
|
|
242
|
+
__decorate([
|
|
243
|
+
Post("node-types/:kind/methods/:method"),
|
|
244
|
+
__param(0, Param("kind")),
|
|
245
|
+
__param(1, Param("method")),
|
|
246
|
+
__param(2, Body()),
|
|
247
|
+
__metadata("design:type", Function),
|
|
248
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
249
|
+
__metadata("design:returntype", Promise)
|
|
250
|
+
], GraphNodeCatalogueController.prototype, "invokeNodeMethod", null);
|
|
251
|
+
GraphNodeCatalogueController = __decorate([
|
|
252
|
+
Controller("graph"),
|
|
253
|
+
__param(1, Optional()),
|
|
254
|
+
__param(1, Inject(DecafRequestContext)),
|
|
255
|
+
__param(2, Optional()),
|
|
256
|
+
__param(2, Inject(GRAPH_CATALOGUE_CONTROLLER_OPTIONS)),
|
|
257
|
+
__metadata("design:paramtypes", [GraphNodeCatalogue,
|
|
258
|
+
DecafRequestContext, Object])
|
|
259
|
+
], GraphNodeCatalogueController);
|
|
260
|
+
export { GraphNodeCatalogueController };
|
|
261
|
+
//# sourceMappingURL=GraphNodeCatalogueController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphNodeCatalogueController.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphNodeCatalog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AI,CAAC,0BAA0B,CAAC;IAE9B,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAI,EAAE,CAAA;;;;mEAqBR;AAGK;IADL,IAAI,CAAC,kCAAkC,CAAC;IAEtC,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IACb,WAAA,KAAK,CAAC,QAAQ,CAAC,CAAA;IACf,WAAA,IAAI,EAAE,CAAA;;;;oEA2BR;AA3JU,4BAA4B;IADxC,UAAU,CAAC,OAAO,CAAC;IAMf,WAAA,QAAQ,EAAE,CAAA;IAAE,WAAA,MAAM,CAAC,mBAAmB,CAAC,CAAA;IAEvC,WAAA,QAAQ,EAAE,CAAA;IAAE,WAAA,MAAM,CAAC,kCAAkC,CAAC,CAAA;qCAH3B,kBAAkB;QAEZ,mBAAmB;GAN5C,4BAA4B,CA8OxC"}
|
|
@@ -9,15 +9,29 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { ModelService, service } from "@decaf-ts/core";
|
|
11
11
|
import { GraphExecutionResultModel } from "./GraphExecutionResultModel.js";
|
|
12
|
+
import { graphWorkflowOwnerOf } from "./GraphWorkflowService.js";
|
|
13
|
+
/**
|
|
14
|
+
* Model-backed persistence for {@link GraphExecutionResultModel} rows: the
|
|
15
|
+
* terminal snapshot the (deprecated) synchronous `POST /graph/execute`
|
|
16
|
+
* surface persists after a run completes. Access control lives at the
|
|
17
|
+
* controller/route layer, which gates reads through the run ownership check.
|
|
18
|
+
*/
|
|
12
19
|
let GraphResultService = class GraphResultService extends ModelService {
|
|
13
20
|
constructor() {
|
|
14
21
|
super(GraphExecutionResultModel);
|
|
15
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Persists a finished run's result, stamping the owning user resolved
|
|
25
|
+
* from the request context onto the `owner` column (SAA-595 F1); results
|
|
26
|
+
* saved without a resolved identity carry no owner.
|
|
27
|
+
*/
|
|
16
28
|
async saveResult(result, ...args) {
|
|
17
|
-
const { ctxArgs } = (await this.logCtx(args, "saveResult", true)).for(this.saveResult);
|
|
29
|
+
const { ctx, ctxArgs } = (await this.logCtx(args, "saveResult", true)).for(this.saveResult);
|
|
30
|
+
const owner = graphWorkflowOwnerOf(ctx);
|
|
18
31
|
const model = new GraphExecutionResultModel({
|
|
19
32
|
runId: result.runId,
|
|
20
33
|
workflowId: result.workflowId,
|
|
34
|
+
...(owner ? { owner } : {}),
|
|
21
35
|
status: result.status,
|
|
22
36
|
inputs: result.inputs,
|
|
23
37
|
outputs: result.outputs,
|
|
@@ -27,6 +41,7 @@ let GraphResultService = class GraphResultService extends ModelService {
|
|
|
27
41
|
});
|
|
28
42
|
return this.create(model, ...ctxArgs);
|
|
29
43
|
}
|
|
44
|
+
/** Reads a result row by run id; returns `null` when no result was persisted (never throws). */
|
|
30
45
|
async findByRunId(runId, ...args) {
|
|
31
46
|
const { ctxArgs } = (await this.logCtx(args, "findByRunId", true)).for(this.findByRunId);
|
|
32
47
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphResultService.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphResultService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAyC,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,uCAAoC;
|
|
1
|
+
{"version":3,"file":"GraphResultService.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphResultService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAyC,MAAM,gBAAgB,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,uCAAoC;AAExE,OAAO,EAAE,oBAAoB,EAAE,kCAA+B;AAE9D;;;;;GAKG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,YAAuC;IAC7E;QACE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;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AC;CACF,CAAA;AA1CY,kBAAkB;IAD9B,OAAO,CAAC,yBAAyB,CAAC;;GACtB,kBAAkB,CA0C9B"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @module integrations/nest/graph/GraphRunController
|
|
15
|
+
* @summary Asynchronous run lifecycle HTTP API (DECAF-50 §4.14–§4.15).
|
|
16
|
+
* @description Creates (`POST /graph/runs`), reads
|
|
17
|
+
* (`GET /graph/runs/:runId`), cancels (`DELETE /graph/runs/:runId`), and
|
|
18
|
+
* replays (`SSE /graph/runs/:runId/events`) graph runs on top of
|
|
19
|
+
* {@link GraphRunService}, enforcing authentication, run limits, and
|
|
20
|
+
* ownership; engine errors surface as `500` with their message while Nest
|
|
21
|
+
* {@link HttpException}s pass through unchanged.
|
|
22
|
+
*/
|
|
23
|
+
import { Body, Controller, Delete, Get, HttpException, HttpStatus, NotFoundException, Optional, Param, Post, Query, Sse, Inject, HttpCode, } from "@nestjs/common";
|
|
24
|
+
import { Observable } from "rxjs";
|
|
25
|
+
import { NotFoundError, ValidationError } from "@decaf-ts/db-decorators";
|
|
26
|
+
import { AuthorizationError, ForbiddenError } from "@decaf-ts/core";
|
|
27
|
+
import { DecafRequestContext } from "@decaf-ts/for-nest";
|
|
28
|
+
import { isGraphRunTerminalEventType } from "@decaf-ts/ui-decorators/graph";
|
|
29
|
+
import { GraphRunService } from "./../../graph/index.js";
|
|
30
|
+
import { graphWorkflowOwnerOf } from "./GraphWorkflowService.js";
|
|
31
|
+
/** DI token for {@link GraphRunControllerOptions}. */
|
|
32
|
+
export const GRAPH_RUN_OPTIONS = "GRAPH_RUN_OPTIONS";
|
|
33
|
+
/**
|
|
34
|
+
* Maps a thrown Decaf error to the Nest HTTP equivalent for the run
|
|
35
|
+
* lifecycle API: ownership/authorization failures become `403` (naming the
|
|
36
|
+
* run), missing runs `404`, validation failures `400`, and anything else
|
|
37
|
+
* surfaces as `500` with its message. Nest {@link HttpException}s pass
|
|
38
|
+
* through unchanged.
|
|
39
|
+
*/
|
|
40
|
+
function graphRunHttpErrorOf(e, runId) {
|
|
41
|
+
if (e instanceof ForbiddenError || e instanceof AuthorizationError) {
|
|
42
|
+
return new HttpException(runId
|
|
43
|
+
? `Graph run '${runId}' is owned by another user`
|
|
44
|
+
: e.message, HttpStatus.FORBIDDEN);
|
|
45
|
+
}
|
|
46
|
+
if (e instanceof NotFoundError) {
|
|
47
|
+
return new NotFoundException(e.message);
|
|
48
|
+
}
|
|
49
|
+
if (e instanceof ValidationError) {
|
|
50
|
+
return new HttpException(e.message, HttpStatus.BAD_REQUEST);
|
|
51
|
+
}
|
|
52
|
+
if (e instanceof HttpException)
|
|
53
|
+
return e;
|
|
54
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
55
|
+
return new HttpException(message, HttpStatus.INTERNAL_SERVER_ERROR);
|
|
56
|
+
}
|
|
57
|
+
function graphRunToHttp(run) {
|
|
58
|
+
return JSON.parse(JSON.stringify(run));
|
|
59
|
+
}
|
|
60
|
+
function graphRunEventMessage(event) {
|
|
61
|
+
return {
|
|
62
|
+
type: "message",
|
|
63
|
+
data: JSON.stringify(event),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Asynchronous run lifecycle HTTP API (DECAF-50 §4.14–§4.15):
|
|
68
|
+
* `POST /graph/runs` creates and schedules a run (202 Accepted), run
|
|
69
|
+
* read/cancel endpoints expose lifecycle state, and
|
|
70
|
+
* `GET /graph/runs/:runId/events` streams the run's sequenced event
|
|
71
|
+
* envelopes over SSE until a terminal event closes the stream. Every
|
|
72
|
+
* operation is ownership-checked against the requesting user.
|
|
73
|
+
*/
|
|
74
|
+
let GraphRunController = class GraphRunController {
|
|
75
|
+
constructor(runService, requestContext, options = {}) {
|
|
76
|
+
this.runService = runService;
|
|
77
|
+
this.requestContext = requestContext;
|
|
78
|
+
this.options = options;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Enforces the configured authentication mode: `auth` defaults to
|
|
82
|
+
* `"required"` (SAA-595 secure-defaults alignment) and rejects
|
|
83
|
+
* unauthenticated calls with `401`; `"optional"` admits anonymous
|
|
84
|
+
* requests for standalone module runs (DECAF-48 §4.15).
|
|
85
|
+
*/
|
|
86
|
+
requireAuthenticatedContext() {
|
|
87
|
+
if ((this.options.auth ?? "required") !== "required") {
|
|
88
|
+
return this.requestContext;
|
|
89
|
+
}
|
|
90
|
+
if (!this.requestContext) {
|
|
91
|
+
throw new HttpException("Graph run access requires an authenticated request context", HttpStatus.UNAUTHORIZED);
|
|
92
|
+
}
|
|
93
|
+
return this.requestContext;
|
|
94
|
+
}
|
|
95
|
+
ownerUserOf() {
|
|
96
|
+
return graphWorkflowOwnerOf(this.requestContext) ?? null;
|
|
97
|
+
}
|
|
98
|
+
/** Concurrency-bucket key for the per-caller run cap: the owner, else the request IP, else a shared anonymous bucket. */
|
|
99
|
+
concurrencyKeyOf(owner) {
|
|
100
|
+
if (owner)
|
|
101
|
+
return owner;
|
|
102
|
+
const ip = this.requestContext?.request?.ip;
|
|
103
|
+
return ip ? `ip:${ip}` : "anonymous";
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Creates and schedules a run (DECAF-50 §4.14): accepts an inline workflow
|
|
107
|
+
* document or a saved `workflowId` plus optional inputs, answers
|
|
108
|
+
* `202 Accepted` with the queued run's identity and its event/result URLs.
|
|
109
|
+
* The per-caller concurrency cap buckets by owner user, then request IP,
|
|
110
|
+
* then a shared anonymous bucket (SAA-595 F4).
|
|
111
|
+
*/
|
|
112
|
+
async createRun(body) {
|
|
113
|
+
const context = this.requireAuthenticatedContext();
|
|
114
|
+
const request = {
|
|
115
|
+
...(body?.workflow !== undefined ? { workflow: body.workflow } : {}),
|
|
116
|
+
...(body?.workflowId !== undefined
|
|
117
|
+
? { workflowId: body.workflowId }
|
|
118
|
+
: {}),
|
|
119
|
+
...(body?.inputs !== undefined ? { inputs: body.inputs } : {}),
|
|
120
|
+
};
|
|
121
|
+
try {
|
|
122
|
+
const owner = this.ownerUserOf();
|
|
123
|
+
const run = await this.runService.createRun(request, owner, this.concurrencyKeyOf(owner), context);
|
|
124
|
+
return {
|
|
125
|
+
runId: run.runId,
|
|
126
|
+
workflowId: run.workflowId,
|
|
127
|
+
status: "queued",
|
|
128
|
+
eventsUrl: `/graph/runs/${run.runId}/events`,
|
|
129
|
+
resultUrl: `/graph/runs/${run.runId}`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
throw graphRunHttpErrorOf(e);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async getRun(runId) {
|
|
137
|
+
const context = this.requireAuthenticatedContext();
|
|
138
|
+
try {
|
|
139
|
+
const run = await this.runService.getRun(runId, this.ownerUserOf(), context);
|
|
140
|
+
return graphRunToHttp(run);
|
|
141
|
+
}
|
|
142
|
+
catch (e) {
|
|
143
|
+
throw graphRunHttpErrorOf(e, runId);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async cancelRun(runId) {
|
|
147
|
+
const context = this.requireAuthenticatedContext();
|
|
148
|
+
try {
|
|
149
|
+
const run = await this.runService.cancelRun(runId, this.ownerUserOf(), context);
|
|
150
|
+
return graphRunToHttp(run);
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
throw graphRunHttpErrorOf(e, runId);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async events(runId, afterSequence) {
|
|
157
|
+
const context = this.requireAuthenticatedContext();
|
|
158
|
+
const owner = this.ownerUserOf();
|
|
159
|
+
const after = this.parseAfterSequence(afterSequence);
|
|
160
|
+
let run;
|
|
161
|
+
try {
|
|
162
|
+
run = await this.runService.getRun(runId, owner, context);
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
throw graphRunHttpErrorOf(e, runId);
|
|
166
|
+
}
|
|
167
|
+
const buffered = [];
|
|
168
|
+
let streaming = false;
|
|
169
|
+
let completed = false;
|
|
170
|
+
let sink;
|
|
171
|
+
const emit = (event) => {
|
|
172
|
+
if (completed || !sink)
|
|
173
|
+
return;
|
|
174
|
+
sink.next(graphRunEventMessage(event));
|
|
175
|
+
if (isGraphRunTerminalEventType(event.type)) {
|
|
176
|
+
completed = true;
|
|
177
|
+
unsubscribe();
|
|
178
|
+
sink.complete();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const unsubscribe = this.runService.subscribeRunEvents(run, (event) => {
|
|
182
|
+
if (completed)
|
|
183
|
+
return;
|
|
184
|
+
if (streaming)
|
|
185
|
+
emit(event);
|
|
186
|
+
else
|
|
187
|
+
buffered.push(event);
|
|
188
|
+
});
|
|
189
|
+
const replay = await this.runService.listEvents(runId, after, owner, context);
|
|
190
|
+
const replayTerminal = replay.length > 0 &&
|
|
191
|
+
isGraphRunTerminalEventType(replay[replay.length - 1].type);
|
|
192
|
+
return new Observable((subscriber) => {
|
|
193
|
+
sink = subscriber;
|
|
194
|
+
let last = after;
|
|
195
|
+
for (const event of replay) {
|
|
196
|
+
if (completed)
|
|
197
|
+
break;
|
|
198
|
+
emit(event);
|
|
199
|
+
last = Math.max(last, event.sequence);
|
|
200
|
+
}
|
|
201
|
+
if (!completed) {
|
|
202
|
+
while (buffered.length > 0 && buffered[0].sequence <= last) {
|
|
203
|
+
buffered.shift();
|
|
204
|
+
}
|
|
205
|
+
streaming = true;
|
|
206
|
+
while (buffered.length > 0 && !completed) {
|
|
207
|
+
emit(buffered.shift());
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (replayTerminal && !completed) {
|
|
211
|
+
completed = true;
|
|
212
|
+
unsubscribe();
|
|
213
|
+
subscriber.complete();
|
|
214
|
+
}
|
|
215
|
+
return () => {
|
|
216
|
+
completed = true;
|
|
217
|
+
unsubscribe();
|
|
218
|
+
};
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
parseAfterSequence(afterSequence) {
|
|
222
|
+
if (afterSequence === undefined || afterSequence === "")
|
|
223
|
+
return 0;
|
|
224
|
+
if (!/^\d+$/.test(afterSequence)) {
|
|
225
|
+
throw new HttpException(`Invalid afterSequence '${afterSequence}': must be a non-negative integer`, HttpStatus.BAD_REQUEST);
|
|
226
|
+
}
|
|
227
|
+
return Number.parseInt(afterSequence, 10);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
__decorate([
|
|
231
|
+
Post("runs"),
|
|
232
|
+
HttpCode(HttpStatus.ACCEPTED),
|
|
233
|
+
__param(0, Body()),
|
|
234
|
+
__metadata("design:type", Function),
|
|
235
|
+
__metadata("design:paramtypes", [Object]),
|
|
236
|
+
__metadata("design:returntype", Promise)
|
|
237
|
+
], GraphRunController.prototype, "createRun", null);
|
|
238
|
+
__decorate([
|
|
239
|
+
Get("runs/:runId"),
|
|
240
|
+
__param(0, Param("runId")),
|
|
241
|
+
__metadata("design:type", Function),
|
|
242
|
+
__metadata("design:paramtypes", [String]),
|
|
243
|
+
__metadata("design:returntype", Promise)
|
|
244
|
+
], GraphRunController.prototype, "getRun", null);
|
|
245
|
+
__decorate([
|
|
246
|
+
Delete("runs/:runId"),
|
|
247
|
+
__param(0, Param("runId")),
|
|
248
|
+
__metadata("design:type", Function),
|
|
249
|
+
__metadata("design:paramtypes", [String]),
|
|
250
|
+
__metadata("design:returntype", Promise)
|
|
251
|
+
], GraphRunController.prototype, "cancelRun", null);
|
|
252
|
+
__decorate([
|
|
253
|
+
Sse("runs/:runId/events"),
|
|
254
|
+
__param(0, Param("runId")),
|
|
255
|
+
__param(1, Query("afterSequence")),
|
|
256
|
+
__metadata("design:type", Function),
|
|
257
|
+
__metadata("design:paramtypes", [String, String]),
|
|
258
|
+
__metadata("design:returntype", Promise)
|
|
259
|
+
], GraphRunController.prototype, "events", null);
|
|
260
|
+
GraphRunController = __decorate([
|
|
261
|
+
Controller("graph"),
|
|
262
|
+
__param(1, Optional()),
|
|
263
|
+
__param(1, Inject(DecafRequestContext)),
|
|
264
|
+
__param(2, Optional()),
|
|
265
|
+
__param(2, Inject(GRAPH_RUN_OPTIONS)),
|
|
266
|
+
__metadata("design:paramtypes", [GraphRunService,
|
|
267
|
+
DecafRequestContext, Object])
|
|
268
|
+
], GraphRunController);
|
|
269
|
+
export { GraphRunController };
|
|
270
|
+
//# sourceMappingURL=GraphRunController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphRunController.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphRunController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,MAAM,EACN,GAAG,EACH,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EAEH,MAAM,EACN,QAAQ,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAy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