@versori/run 0.2.28 → 0.3.0-beta.2
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/esm/src/connection/DirectConnectionFactory.d.ts +29 -0
- package/esm/src/connection/DirectConnectionFactory.d.ts.map +1 -0
- package/esm/src/connection/DirectConnectionFactory.js +82 -0
- package/esm/src/connection/DynamicFetchFactory.d.ts +30 -0
- package/esm/src/connection/DynamicFetchFactory.d.ts.map +1 -0
- package/esm/src/connection/DynamicFetchFactory.js +113 -0
- package/esm/src/connection/StaticFetchFactory.d.ts +11 -0
- package/esm/src/connection/StaticFetchFactory.d.ts.map +1 -0
- package/esm/src/connection/StaticFetchFactory.js +35 -0
- package/esm/src/connection/internal/CredentialHolder.d.ts +11 -0
- package/esm/src/connection/internal/CredentialHolder.d.ts.map +1 -0
- package/esm/src/connection/internal/CredentialHolder.js +66 -0
- package/esm/src/connection/internal/FetchBuilder.d.ts +15 -0
- package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -0
- package/esm/src/connection/internal/FetchBuilder.js +89 -0
- package/esm/src/connection/internal/HttpClientFactory.d.ts +14 -0
- package/esm/src/connection/internal/HttpClientFactory.d.ts.map +1 -0
- package/esm/src/connection/internal/HttpClientFactory.js +42 -0
- package/esm/src/connection/internal/InboundConnectionFactory.d.ts +19 -0
- package/esm/src/connection/internal/InboundConnectionFactory.d.ts.map +1 -0
- package/esm/src/connection/internal/InboundConnectionFactory.js +390 -0
- package/esm/src/connection/internal/OutboundConnectionFactory.d.ts +31 -0
- package/esm/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -0
- package/esm/src/connection/internal/OutboundConnectionFactory.js +447 -0
- package/esm/src/connection/types.d.ts +32 -0
- package/esm/src/connection/types.d.ts.map +1 -0
- package/esm/src/connection/types.js +1 -0
- package/esm/src/context/ActivationImpl.d.ts +18 -0
- package/esm/src/context/ActivationImpl.d.ts.map +1 -0
- package/esm/src/context/ActivationImpl.js +82 -0
- package/esm/src/context/Context.d.ts +5 -6
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +9 -16
- package/esm/src/context/ContextProvider.d.ts +7 -3
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +28 -10
- package/esm/src/dsl/http/default.d.ts.map +1 -1
- package/esm/src/dsl/http/default.js +3 -1
- package/esm/src/dsl/http/types.d.ts +9 -4
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +3 -1
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/constants.js +1 -0
- package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts +5 -3
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/proxyroundtripper.js +31 -8
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts +8 -5
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.js +106 -115
- package/esm/src/dsl/tasks/HttpTask.d.ts +7 -5
- package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/esm/src/dsl/tasks/HttpTask.js +22 -22
- package/esm/src/internal/InternalAuth.d.ts +15 -0
- package/esm/src/internal/InternalAuth.d.ts.map +1 -0
- package/esm/src/internal/InternalAuth.js +90 -0
- package/esm/src/internal/cli.d.ts +2 -0
- package/esm/src/internal/cli.d.ts.map +1 -0
- package/esm/src/internal/cli.js +20 -0
- package/esm/src/internal/constants.d.ts +20 -0
- package/esm/src/internal/constants.d.ts.map +1 -0
- package/esm/src/internal/constants.js +24 -0
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts +14 -5
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +20 -18
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts +6 -3
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/durableworkflow.js +10 -1
- package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/http.js +26 -9
- package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/schedule.js +41 -18
- package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/webhook.js +30 -33
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +4 -4
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +14 -23
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +6 -3
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.js +26 -9
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +34 -18
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +31 -34
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +16 -0
- package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/sdk/SDKKeyValueProvider.js +14 -0
- package/esm/src/services/credentials/credential-v1alpha1.d.ts +4 -0
- package/esm/src/services/credentials/credential-v1alpha1.d.ts.map +1 -0
- package/esm/src/services/credentials/credential-v1alpha1.js +3 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.d.ts +119 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.d.ts.map +1 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.js +67 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.d.ts +245 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.d.ts.map +1 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.js +44 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth2/v1/token_pb.d.ts +38 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth2/v1/token_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/oauth2/v1/token_pb.js +1 -1
- package/esm/src/services/credentials/generated/versori/credential/oauth2/v1/token_service_pb.d.ts +471 -0
- package/esm/src/services/credentials/generated/versori/credential/oauth2/v1/token_service_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/oauth2/v1/token_service_pb.js +1 -1
- package/esm/src/services/credentials/generated/versori/credential/tokens/v1/token_pb.d.ts +38 -0
- package/esm/src/services/credentials/generated/versori/credential/tokens/v1/token_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/tokens/v1/token_pb.js +1 -1
- package/esm/src/services/credentials/generated/versori/credential/tokens/v1/token_service_pb.d.ts +128 -0
- package/esm/src/services/credentials/generated/versori/credential/tokens/v1/token_service_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/tokens/v1/token_service_pb.js +1 -1
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/common_pb.d.ts +90 -0
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/common_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/v1alpha1/common_pb.js +16 -6
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.d.ts +1468 -0
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.d.ts.map +1 -0
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.js +534 -0
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/credential_service_pb.d.ts +390 -0
- package/esm/src/services/credentials/generated/versori/credential/v1alpha1/credential_service_pb.d.ts.map +1 -0
- package/esm/src/{dsl/http → services/credentials/generated}/versori/credential/v1alpha1/credential_service_pb.js +1 -1
- package/esm/src/services/credentials/isTokenValid.d.ts +3 -0
- package/esm/src/services/credentials/isTokenValid.d.ts.map +1 -0
- package/esm/src/services/credentials/isTokenValid.js +8 -0
- package/esm/src/services/credentials/mod.d.ts +5 -0
- package/esm/src/services/credentials/mod.d.ts.map +1 -0
- package/esm/src/services/credentials/mod.js +4 -0
- package/esm/src/services/credentials/oauth1-v1.d.ts +3 -0
- package/esm/src/services/credentials/oauth1-v1.d.ts.map +1 -0
- package/esm/src/services/credentials/oauth1-v1.js +2 -0
- package/esm/src/services/credentials/oauth2-v1.d.ts +3 -0
- package/esm/src/services/credentials/oauth2-v1.d.ts.map +1 -0
- package/esm/src/services/credentials/oauth2-v1.js +2 -0
- package/esm/src/services/credentials/tokens-v1.d.ts +3 -0
- package/esm/src/services/credentials/tokens-v1.d.ts.map +1 -0
- package/esm/src/services/credentials/tokens-v1.js +2 -0
- package/esm/src/services/platform/PlatformApi.d.ts +7 -0
- package/esm/src/services/platform/PlatformApi.d.ts.map +1 -0
- package/esm/src/services/platform/PlatformApi.js +25 -0
- package/esm/src/services/platform/generated/client/client.gen.d.ts +3 -0
- package/esm/src/services/platform/generated/client/client.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/client/client.gen.js +176 -0
- package/esm/src/services/platform/generated/client/index.d.ts +8 -0
- package/esm/src/services/platform/generated/client/index.d.ts.map +1 -0
- package/esm/src/services/platform/generated/client/index.js +5 -0
- package/esm/src/services/platform/generated/client/types.gen.d.ts +125 -0
- package/esm/src/services/platform/generated/client/types.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/client/types.gen.js +2 -0
- package/esm/src/services/platform/generated/client/utils.gen.d.ts +39 -0
- package/esm/src/services/platform/generated/client/utils.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/client/utils.gen.js +234 -0
- package/esm/src/services/platform/generated/client.gen.d.ts +13 -0
- package/esm/src/services/platform/generated/client.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/client.gen.js +5 -0
- package/esm/src/services/platform/generated/core/auth.gen.d.ts +19 -0
- package/esm/src/services/platform/generated/core/auth.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/auth.gen.js +14 -0
- package/esm/src/services/platform/generated/core/bodySerializer.gen.d.ts +18 -0
- package/esm/src/services/platform/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/bodySerializer.gen.js +57 -0
- package/esm/src/services/platform/generated/core/params.gen.d.ts +34 -0
- package/esm/src/services/platform/generated/core/params.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/params.gen.js +88 -0
- package/esm/src/services/platform/generated/core/pathSerializer.gen.d.ts +34 -0
- package/esm/src/services/platform/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/pathSerializer.gen.js +114 -0
- package/esm/src/services/platform/generated/core/serverSentEvents.gen.d.ts +60 -0
- package/esm/src/services/platform/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/serverSentEvents.gen.js +121 -0
- package/esm/src/services/platform/generated/core/types.gen.d.ts +79 -0
- package/esm/src/services/platform/generated/core/types.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/types.gen.js +2 -0
- package/esm/src/services/platform/generated/core/utils.gen.d.ts +15 -0
- package/esm/src/services/platform/generated/core/utils.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/core/utils.gen.js +69 -0
- package/esm/src/services/platform/generated/index.d.ts +3 -0
- package/esm/src/services/platform/generated/index.d.ts.map +1 -0
- package/esm/src/services/platform/generated/index.js +3 -0
- package/esm/src/services/platform/generated/sdk.gen.d.ts +494 -0
- package/esm/src/services/platform/generated/sdk.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/sdk.gen.js +1908 -0
- package/esm/src/services/platform/generated/types.gen.d.ts +3798 -0
- package/esm/src/services/platform/generated/types.gen.d.ts.map +1 -0
- package/esm/src/services/platform/generated/types.gen.js +2 -0
- package/esm/src/services/platform/mod.d.ts +5 -0
- package/esm/src/services/platform/mod.d.ts.map +1 -0
- package/esm/src/services/platform/mod.js +2 -0
- package/package.json +4 -4
- package/script/src/connection/DirectConnectionFactory.d.ts +29 -0
- package/script/src/connection/DirectConnectionFactory.d.ts.map +1 -0
- package/script/src/connection/DirectConnectionFactory.js +86 -0
- package/script/src/connection/DynamicFetchFactory.d.ts +30 -0
- package/script/src/connection/DynamicFetchFactory.d.ts.map +1 -0
- package/script/src/connection/DynamicFetchFactory.js +117 -0
- package/script/src/connection/StaticFetchFactory.d.ts +11 -0
- package/script/src/connection/StaticFetchFactory.d.ts.map +1 -0
- package/script/src/connection/StaticFetchFactory.js +39 -0
- package/script/src/connection/internal/CredentialHolder.d.ts +11 -0
- package/script/src/connection/internal/CredentialHolder.d.ts.map +1 -0
- package/script/src/connection/internal/CredentialHolder.js +71 -0
- package/script/src/connection/internal/FetchBuilder.d.ts +15 -0
- package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -0
- package/script/src/connection/internal/FetchBuilder.js +93 -0
- package/script/src/connection/internal/HttpClientFactory.d.ts +14 -0
- package/script/src/connection/internal/HttpClientFactory.d.ts.map +1 -0
- package/script/src/connection/internal/HttpClientFactory.js +46 -0
- package/script/src/connection/internal/InboundConnectionFactory.d.ts +19 -0
- package/script/src/connection/internal/InboundConnectionFactory.d.ts.map +1 -0
- package/script/src/connection/internal/InboundConnectionFactory.js +394 -0
- package/script/src/connection/internal/OutboundConnectionFactory.d.ts +31 -0
- package/script/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -0
- package/script/src/connection/internal/OutboundConnectionFactory.js +454 -0
- package/script/src/connection/types.d.ts +32 -0
- package/script/src/connection/types.d.ts.map +1 -0
- package/script/src/connection/types.js +2 -0
- package/script/src/context/ActivationImpl.d.ts +18 -0
- package/script/src/context/ActivationImpl.d.ts.map +1 -0
- package/script/src/context/ActivationImpl.js +86 -0
- package/script/src/context/Context.d.ts +5 -6
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +9 -16
- package/script/src/context/ContextProvider.d.ts +7 -3
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +28 -10
- package/script/src/dsl/http/default.d.ts.map +1 -1
- package/script/src/dsl/http/default.js +3 -1
- package/script/src/dsl/http/types.d.ts +9 -4
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +3 -1
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/script/src/dsl/http/versori/constants.js +1 -0
- package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts +5 -3
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.js +31 -8
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts +8 -5
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.js +106 -115
- package/script/src/dsl/tasks/HttpTask.d.ts +7 -5
- package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/script/src/dsl/tasks/HttpTask.js +22 -22
- package/script/src/internal/InternalAuth.d.ts +15 -0
- package/script/src/internal/InternalAuth.d.ts.map +1 -0
- package/script/src/internal/InternalAuth.js +94 -0
- package/script/src/internal/cli.d.ts +2 -0
- package/script/src/internal/cli.d.ts.map +1 -0
- package/script/src/internal/cli.js +23 -0
- package/script/src/internal/constants.d.ts +20 -0
- package/script/src/internal/constants.d.ts.map +1 -0
- package/script/src/internal/constants.js +27 -0
- package/script/src/interpreter/durable/DurableInterpreter.d.ts +14 -5
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +20 -18
- package/script/src/interpreter/durable/ObservableCompiler.d.ts +6 -3
- package/script/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/durableworkflow.js +10 -1
- package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/http.js +26 -9
- package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/schedule.js +41 -18
- package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/webhook.js +30 -33
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +4 -4
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +14 -23
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +6 -3
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.js +26 -9
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +34 -18
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +31 -34
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +16 -0
- package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/sdk/SDKKeyValueProvider.js +14 -0
- package/script/src/services/credentials/credential-v1alpha1.d.ts +4 -0
- package/script/src/services/credentials/credential-v1alpha1.d.ts.map +1 -0
- package/script/src/services/credentials/credential-v1alpha1.js +19 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.d.ts +119 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.d.ts.map +1 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_metadata_pb.js +70 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.d.ts +245 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.d.ts.map +1 -0
- package/script/src/services/credentials/generated/versori/credential/oauth1/v1/authorization_service_pb.js +47 -0
- package/script/src/services/credentials/generated/versori/credential/oauth2/v1/token_pb.d.ts +38 -0
- package/script/src/services/credentials/generated/versori/credential/oauth2/v1/token_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/oauth2/v1/token_pb.js +1 -1
- package/script/src/services/credentials/generated/versori/credential/oauth2/v1/token_service_pb.d.ts +471 -0
- package/script/src/services/credentials/generated/versori/credential/oauth2/v1/token_service_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/oauth2/v1/token_service_pb.js +1 -1
- package/script/src/services/credentials/generated/versori/credential/tokens/v1/token_pb.d.ts +38 -0
- package/script/src/services/credentials/generated/versori/credential/tokens/v1/token_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/tokens/v1/token_pb.js +1 -1
- package/script/src/services/credentials/generated/versori/credential/tokens/v1/token_service_pb.d.ts +128 -0
- package/script/src/services/credentials/generated/versori/credential/tokens/v1/token_service_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/tokens/v1/token_service_pb.js +1 -1
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/common_pb.d.ts +90 -0
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/common_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/v1alpha1/common_pb.js +16 -6
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.d.ts +1468 -0
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.d.ts.map +1 -0
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/credential_pb.js +538 -0
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/credential_service_pb.d.ts +390 -0
- package/script/src/services/credentials/generated/versori/credential/v1alpha1/credential_service_pb.d.ts.map +1 -0
- package/script/src/{dsl/http → services/credentials/generated}/versori/credential/v1alpha1/credential_service_pb.js +1 -1
- package/script/src/services/credentials/isTokenValid.d.ts +3 -0
- package/script/src/services/credentials/isTokenValid.d.ts.map +1 -0
- package/script/src/services/credentials/isTokenValid.js +11 -0
- package/script/src/services/credentials/mod.d.ts +5 -0
- package/script/src/services/credentials/mod.d.ts.map +1 -0
- package/script/src/services/credentials/mod.js +30 -0
- package/script/src/services/credentials/oauth1-v1.d.ts +3 -0
- package/script/src/services/credentials/oauth1-v1.d.ts.map +1 -0
- package/script/src/services/credentials/oauth1-v1.js +18 -0
- package/script/src/services/credentials/oauth2-v1.d.ts +3 -0
- package/script/src/services/credentials/oauth2-v1.d.ts.map +1 -0
- package/script/src/services/credentials/oauth2-v1.js +18 -0
- package/script/src/services/credentials/tokens-v1.d.ts +3 -0
- package/script/src/services/credentials/tokens-v1.d.ts.map +1 -0
- package/script/src/services/credentials/tokens-v1.js +18 -0
- package/script/src/services/platform/PlatformApi.d.ts +7 -0
- package/script/src/services/platform/PlatformApi.d.ts.map +1 -0
- package/script/src/services/platform/PlatformApi.js +52 -0
- package/script/src/services/platform/generated/client/client.gen.d.ts +3 -0
- package/script/src/services/platform/generated/client/client.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/client/client.gen.js +180 -0
- package/script/src/services/platform/generated/client/index.d.ts +8 -0
- package/script/src/services/platform/generated/client/index.d.ts.map +1 -0
- package/script/src/services/platform/generated/client/index.js +15 -0
- package/script/src/services/platform/generated/client/types.gen.d.ts +125 -0
- package/script/src/services/platform/generated/client/types.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/client/types.gen.js +3 -0
- package/script/src/services/platform/generated/client/utils.gen.d.ts +39 -0
- package/script/src/services/platform/generated/client/utils.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/client/utils.gen.js +245 -0
- package/script/src/services/platform/generated/client.gen.d.ts +13 -0
- package/script/src/services/platform/generated/client.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/client.gen.js +8 -0
- package/script/src/services/platform/generated/core/auth.gen.d.ts +19 -0
- package/script/src/services/platform/generated/core/auth.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/auth.gen.js +18 -0
- package/script/src/services/platform/generated/core/bodySerializer.gen.d.ts +18 -0
- package/script/src/services/platform/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/bodySerializer.gen.js +60 -0
- package/script/src/services/platform/generated/core/params.gen.d.ts +34 -0
- package/script/src/services/platform/generated/core/params.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/params.gen.js +92 -0
- package/script/src/services/platform/generated/core/pathSerializer.gen.d.ts +34 -0
- package/script/src/services/platform/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/pathSerializer.gen.js +123 -0
- package/script/src/services/platform/generated/core/serverSentEvents.gen.d.ts +60 -0
- package/script/src/services/platform/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/serverSentEvents.gen.js +125 -0
- package/script/src/services/platform/generated/core/types.gen.d.ts +79 -0
- package/script/src/services/platform/generated/core/types.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/types.gen.js +3 -0
- package/script/src/services/platform/generated/core/utils.gen.d.ts +15 -0
- package/script/src/services/platform/generated/core/utils.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/core/utils.gen.js +74 -0
- package/script/src/services/platform/generated/index.d.ts +3 -0
- package/script/src/services/platform/generated/index.d.ts.map +1 -0
- package/script/src/services/platform/generated/index.js +19 -0
- package/script/src/services/platform/generated/sdk.gen.d.ts +494 -0
- package/script/src/services/platform/generated/sdk.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/sdk.gen.js +1992 -0
- package/script/src/services/platform/generated/types.gen.d.ts +3798 -0
- package/script/src/services/platform/generated/types.gen.d.ts.map +1 -0
- package/script/src/services/platform/generated/types.gen.js +3 -0
- package/script/src/services/platform/mod.d.ts +5 -0
- package/script/src/services/platform/mod.d.ts.map +1 -0
- package/script/src/services/platform/mod.js +18 -0
- package/esm/src/dsl/http/versori/credential/client.d.ts +0 -13
- package/esm/src/dsl/http/versori/credential/client.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/client.js +0 -35
- package/esm/src/dsl/http/versori/credential/credentials.d.ts +0 -98
- package/esm/src/dsl/http/versori/credential/credentials.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/credentials.js +0 -40
- package/esm/src/dsl/http/versori/credential/mod.d.ts +0 -2
- package/esm/src/dsl/http/versori/credential/mod.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/mod.js +0 -1
- package/esm/src/dsl/http/versori/credential/oauth2/v1/token_pb.d.ts +0 -13
- package/esm/src/dsl/http/versori/credential/oauth2/v1/token_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/oauth2/v1/token_service_pb.d.ts +0 -102
- package/esm/src/dsl/http/versori/credential/oauth2/v1/token_service_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/tokens/v1/token_pb.d.ts +0 -13
- package/esm/src/dsl/http/versori/credential/tokens/v1/token_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/tokens/v1/token_service_pb.d.ts +0 -46
- package/esm/src/dsl/http/versori/credential/tokens/v1/token_service_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/v1alpha1/common_pb.d.ts +0 -40
- package/esm/src/dsl/http/versori/credential/v1alpha1/common_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/credential/v1alpha1/credential_service_pb.d.ts +0 -129
- package/esm/src/dsl/http/versori/credential/v1alpha1/credential_service_pb.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/roundtripper.d.ts +0 -61
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/roundtripper.js +0 -967
- package/script/src/dsl/http/versori/credential/client.d.ts +0 -13
- package/script/src/dsl/http/versori/credential/client.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/client.js +0 -39
- package/script/src/dsl/http/versori/credential/credentials.d.ts +0 -98
- package/script/src/dsl/http/versori/credential/credentials.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/credentials.js +0 -46
- package/script/src/dsl/http/versori/credential/mod.d.ts +0 -2
- package/script/src/dsl/http/versori/credential/mod.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/mod.js +0 -5
- package/script/src/dsl/http/versori/credential/oauth2/v1/token_pb.d.ts +0 -13
- package/script/src/dsl/http/versori/credential/oauth2/v1/token_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/oauth2/v1/token_service_pb.d.ts +0 -102
- package/script/src/dsl/http/versori/credential/oauth2/v1/token_service_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/tokens/v1/token_pb.d.ts +0 -13
- package/script/src/dsl/http/versori/credential/tokens/v1/token_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/tokens/v1/token_service_pb.d.ts +0 -46
- package/script/src/dsl/http/versori/credential/tokens/v1/token_service_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/v1alpha1/common_pb.d.ts +0 -40
- package/script/src/dsl/http/versori/credential/v1alpha1/common_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/credential/v1alpha1/credential_service_pb.d.ts +0 -129
- package/script/src/dsl/http/versori/credential/v1alpha1/credential_service_pb.d.ts.map +0 -1
- package/script/src/dsl/http/versori/roundtripper.d.ts +0 -61
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +0 -1
- package/script/src/dsl/http/versori/roundtripper.js +0 -974
|
@@ -2,14 +2,23 @@ import { Tracer } from '@opentelemetry/api';
|
|
|
2
2
|
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
3
3
|
import { Router } from 'express';
|
|
4
4
|
import { Observable, Subscription } from 'rxjs';
|
|
5
|
+
import { DirectConnectionFactory } from '../../connection/DirectConnectionFactory.js';
|
|
5
6
|
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
6
|
-
import { ConfigReader,
|
|
7
|
+
import { ConfigReader, CronProvider } from '../../dsl/http/types.js';
|
|
7
8
|
import { Workflow } from '../../dsl/Workflow.js';
|
|
8
9
|
import { IssueAPI } from '../../issues/Issues.js';
|
|
9
10
|
import { ContextImpl, ContextOperatorFunction } from '../../mod.js';
|
|
10
11
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
12
|
+
import { PlatformApi } from '../../services/platform/PlatformApi.js';
|
|
11
13
|
import { ObservableCompiler } from './ObservableCompiler.js';
|
|
12
14
|
import { QueueAPI } from './Queue.js';
|
|
15
|
+
declare global {
|
|
16
|
+
namespace Express {
|
|
17
|
+
interface Request {
|
|
18
|
+
rawBody: Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
13
22
|
export type DurableInterpreterOptions = {
|
|
14
23
|
logger?: Logger;
|
|
15
24
|
compiler?: ObservableCompiler;
|
|
@@ -28,11 +37,11 @@ export declare class DurableInterpreter {
|
|
|
28
37
|
private readonly log;
|
|
29
38
|
private readonly compiler;
|
|
30
39
|
private readonly contextProvider;
|
|
31
|
-
private readonly roundTripperFactory;
|
|
32
40
|
private readonly webhookRouter;
|
|
33
41
|
private readonly cronRouter;
|
|
34
|
-
private cronRegistry;
|
|
35
|
-
private readonly
|
|
42
|
+
private readonly cronRegistry;
|
|
43
|
+
private readonly platformApi;
|
|
44
|
+
private readonly cnxFetchFactory;
|
|
36
45
|
private readonly cronProvider;
|
|
37
46
|
private readonly tracer;
|
|
38
47
|
private readonly issue;
|
|
@@ -44,7 +53,7 @@ export declare class DurableInterpreter {
|
|
|
44
53
|
private cronServer?;
|
|
45
54
|
private shutdownServer?;
|
|
46
55
|
private isShuttingDown;
|
|
47
|
-
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider,
|
|
56
|
+
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, webhookRouter: Router, cronRouter: Router, cronRegistry: Map<string, string>, platformApi: PlatformApi, cnxFetchFactory: DirectConnectionFactory, cronProvider: CronProvider, tracer: Tracer, issue: IssueAPI, cfgReader: ConfigReader, queueProvider: QueueAPI, otelSDK?: NodeSDK | undefined);
|
|
48
57
|
static newInstance(options?: DurableInterpreterOptions): Promise<DurableInterpreter>;
|
|
49
58
|
register<O>(workflow: Workflow<O>, options?: DurableInterpreterOptions): Registration;
|
|
50
59
|
start(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DurableInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/DurableInterpreter.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DurableInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/DurableInterpreter.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OA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E,OAAO,YAAA;WAWzB,WAAW,CAAC,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAuG9F,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAoDhE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4MtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAO9B"}
|
|
@@ -4,19 +4,19 @@ import { resourceFromAttributes } from '@opentelemetry/resources';
|
|
|
4
4
|
import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
5
5
|
import express from 'express';
|
|
6
6
|
import { catchError, EMPTY, mergeMap, of, tap } from 'rxjs';
|
|
7
|
+
import { DirectConnectionFactory } from '../../connection/DirectConnectionFactory.js';
|
|
7
8
|
import { ContextProviderImpl } from '../../context/ContextProvider.js';
|
|
8
9
|
import { DefaultRoundTripperFactory } from '../../dsl/http/default.js';
|
|
9
10
|
import { VersoriConfigReader } from '../../dsl/http/versori/configloader.js';
|
|
10
11
|
import { envVarEnvId, envVarEnvironmentName, envVarLocalRun, envVarOrgId, envVarOrgSlug, envVarOtelTracesURL, envVarProjectId, envVarSDKApiBaseURL, envVarVersion, } from '../../dsl/http/versori/constants.js';
|
|
11
12
|
import { CronAPIClient } from '../../dsl/http/versori/cronapi.js';
|
|
12
|
-
import { PlatformAPIClient } from '../../dsl/http/versori/platformapi.js';
|
|
13
13
|
import { ProxyRoundTripper } from '../../dsl/http/versori/proxyroundtripper.js';
|
|
14
|
-
import { VersoriCredentialsFactory } from '../../dsl/http/versori/roundtripper.js';
|
|
15
14
|
import { WorkflowImpl } from '../../dsl/Workflow.js';
|
|
16
15
|
import { IssueImpl } from '../../issues/Issues.js';
|
|
17
16
|
import { MemoryKeyValueProvider } from '../../kv/memory/MemoryKeyValueProvider.js';
|
|
18
17
|
import { SDKKeyValueProvider } from '../../kv/sdk/SDKKeyValueProvider.js';
|
|
19
18
|
import { ConsoleLogger } from '../../observability/logging/ConsoleLogger.js';
|
|
19
|
+
import { PlatformApiImpl } from '../../services/platform/PlatformApi.js';
|
|
20
20
|
import { ObservableCompiler } from './ObservableCompiler.js';
|
|
21
21
|
import { QueueImpl } from './Queue.js';
|
|
22
22
|
function getKVProvider(runLocal) {
|
|
@@ -30,14 +30,11 @@ function getRoundTripperFactory(log, tracer, opts) {
|
|
|
30
30
|
log.info('Running in local mode, using ProxyRoundTripperFactory');
|
|
31
31
|
return ProxyRoundTripper.fromEnv(log);
|
|
32
32
|
}
|
|
33
|
-
if (!opts || !opts.skipVersoriCredentials) {
|
|
34
|
-
return VersoriCredentialsFactory.fromEnv(log, tracer);
|
|
35
|
-
}
|
|
36
33
|
log.info('Running with default round tripper factory');
|
|
37
34
|
return new DefaultRoundTripperFactory();
|
|
38
35
|
}
|
|
39
36
|
export class DurableInterpreter {
|
|
40
|
-
constructor(log, compiler, contextProvider,
|
|
37
|
+
constructor(log, compiler, contextProvider, webhookRouter, cronRouter, cronRegistry, platformApi, cnxFetchFactory, cronProvider, tracer, issue, cfgReader, queueProvider, otelSDK) {
|
|
41
38
|
Object.defineProperty(this, "log", {
|
|
42
39
|
enumerable: true,
|
|
43
40
|
configurable: true,
|
|
@@ -56,12 +53,6 @@ export class DurableInterpreter {
|
|
|
56
53
|
writable: true,
|
|
57
54
|
value: contextProvider
|
|
58
55
|
});
|
|
59
|
-
Object.defineProperty(this, "roundTripperFactory", {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true,
|
|
62
|
-
writable: true,
|
|
63
|
-
value: roundTripperFactory
|
|
64
|
-
});
|
|
65
56
|
Object.defineProperty(this, "webhookRouter", {
|
|
66
57
|
enumerable: true,
|
|
67
58
|
configurable: true,
|
|
@@ -80,11 +71,17 @@ export class DurableInterpreter {
|
|
|
80
71
|
writable: true,
|
|
81
72
|
value: cronRegistry
|
|
82
73
|
});
|
|
83
|
-
Object.defineProperty(this, "
|
|
74
|
+
Object.defineProperty(this, "platformApi", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
configurable: true,
|
|
77
|
+
writable: true,
|
|
78
|
+
value: platformApi
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(this, "cnxFetchFactory", {
|
|
84
81
|
enumerable: true,
|
|
85
82
|
configurable: true,
|
|
86
83
|
writable: true,
|
|
87
|
-
value:
|
|
84
|
+
value: cnxFetchFactory
|
|
88
85
|
});
|
|
89
86
|
Object.defineProperty(this, "cronProvider", {
|
|
90
87
|
enumerable: true,
|
|
@@ -204,10 +201,14 @@ export class DurableInterpreter {
|
|
|
204
201
|
if (options.contextProvider) {
|
|
205
202
|
// no need to set up a key-value provider if options.contextProvider is already
|
|
206
203
|
// initialised.
|
|
207
|
-
return new DurableInterpreter(log, compiler, options.contextProvider,
|
|
204
|
+
return new DurableInterpreter(log, compiler, options.contextProvider, express.Router(), express.Router(), new Map(), PlatformApiImpl.fromEnv(), DirectConnectionFactory.fromEnv(log), CronAPIClient.fromEnv(), tracer, issuesProvider, configReader, queueProvider, otelSDK);
|
|
208
205
|
}
|
|
209
206
|
const kvp = await getKVProvider(runLocal);
|
|
210
|
-
|
|
207
|
+
const platformApi = PlatformApiImpl.fromEnv();
|
|
208
|
+
const organisationId = Deno.env.get(envVarOrgId) || 'development';
|
|
209
|
+
const environmentId = Deno.env.get(envVarEnvId) || 'development';
|
|
210
|
+
const ctxProvider = new ContextProviderImpl(log, kvp, roundTripperFactory.credentials(), platformApi, organisationId, environmentId, issuesProvider);
|
|
211
|
+
return new DurableInterpreter(log, compiler, ctxProvider, express.Router(), express.Router(), new Map(), PlatformApiImpl.fromEnv(), DirectConnectionFactory.fromEnv(log), CronAPIClient.fromEnv(), tracer, issuesProvider, configReader, queueProvider, otelSDK);
|
|
211
212
|
}
|
|
212
213
|
register(workflow, options) {
|
|
213
214
|
const localAbortController = new AbortController();
|
|
@@ -223,14 +224,15 @@ export class DurableInterpreter {
|
|
|
223
224
|
log: this.log,
|
|
224
225
|
tracer: this.tracer,
|
|
225
226
|
contextProvider: this.contextProvider,
|
|
226
|
-
roundTripperFactory: this.roundTripperFactory,
|
|
227
227
|
webhookRouter: this.webhookRouter,
|
|
228
228
|
queueProvider: this.queueProvider,
|
|
229
229
|
cronRouter: this.cronRouter,
|
|
230
230
|
cronRegistry: this.cronRegistry,
|
|
231
231
|
issueProvider: this.issue,
|
|
232
|
-
connectionProvider: this.connectionProvider,
|
|
233
232
|
configReader: this.cfgReader,
|
|
233
|
+
platformApi: this.platformApi,
|
|
234
|
+
cnxFactory: this.cnxFetchFactory,
|
|
235
|
+
organisationId: Deno.env.get(envVarOrgId) || 'development',
|
|
234
236
|
};
|
|
235
237
|
const trigger$ = this.compiler.compileTrigger(compilerContext, workflow.trigger, combinedSignal);
|
|
236
238
|
const task$ = this.compiler.compileTask(compilerContext, workflow.task);
|
|
@@ -3,26 +3,29 @@ import { Router } from 'express';
|
|
|
3
3
|
import { Observable, OperatorFunction } from 'rxjs';
|
|
4
4
|
import { ContextImpl } from '../../context/Context.js';
|
|
5
5
|
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
6
|
-
import { ConfigReader
|
|
6
|
+
import { ConfigReader } from '../../dsl/http/types.js';
|
|
7
7
|
import { Task } from '../../dsl/Task.js';
|
|
8
8
|
import { Trigger } from '../../dsl/Trigger.js';
|
|
9
9
|
import { IssueAPI } from '../../issues/Issues.js';
|
|
10
10
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
11
|
+
import { PlatformApi } from '../../services/platform/mod.js';
|
|
11
12
|
import { ContextOperatorFunction, TaskCompiler, TriggerCompiler } from './compilers/types.js';
|
|
12
13
|
import { QueueAPI } from './Queue.js';
|
|
14
|
+
import { ConnectionFactory } from '../../connection/types.js';
|
|
13
15
|
export type DurableCompilerContext = {
|
|
14
16
|
compiler: ObservableCompiler;
|
|
15
17
|
log: Logger;
|
|
16
18
|
tracer: Tracer;
|
|
17
19
|
contextProvider: ContextProvider;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
cnxFactory: ConnectionFactory;
|
|
21
|
+
platformApi: PlatformApi;
|
|
20
22
|
queueProvider: QueueAPI;
|
|
21
23
|
issueProvider: IssueAPI;
|
|
22
24
|
webhookRouter: Router;
|
|
23
25
|
cronRouter: Router;
|
|
24
26
|
configReader: ConfigReader;
|
|
25
27
|
cronRegistry: Map<string, string>;
|
|
28
|
+
organisationId: string;
|
|
26
29
|
};
|
|
27
30
|
export type CompilerFunc<In = any, Out = any, T extends Task<In, Out> = Task<In, Out>> = (ctx: DurableCompilerContext, task: T) => OperatorFunction<In, Out>;
|
|
28
31
|
export declare class ObservableCompiler {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/ObservableCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/durable/ObservableCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CA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CAAC,aAAa,CAAkD;IACvE,OAAO,CAAC,gBAAgB,CAAgD;;IAkBxE,WAAW,CAAC,EAAE,GAAG,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,KAAK,GAAG,IAAI,EACzC,GAAG,EAAE,sBAAsB,EAC3B,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,GACpB,uBAAuB,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC;IAe1C,cAAc,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAC3D,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,CAAC,EACV,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAerC,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAKjF,eAAe,CAAC,GAAG,EAAE,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;CAIjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/durableworkflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/durableworkflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAI3C,wBAAgB,sBAAsB,CAClC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAmG9C;AAED,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,mBAAmB,EAAE,sBAAsB,CAIhG,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import { DurableWorkflowTrigger, } from '../../../dsl/triggers/DurableTrigger.js';
|
|
3
|
+
import { envVarEnvId } from '../../../internal/constants.js';
|
|
3
4
|
export function compileDurableWorkflow(ctx, trigger, signal) {
|
|
4
5
|
return new Observable((subscriber) => {
|
|
5
6
|
function cleanup() {
|
|
@@ -52,7 +53,15 @@ export function compileDurableWorkflow(ctx, trigger, signal) {
|
|
|
52
53
|
const data = JSON.parse(atob(wf.payload ?? '{}'));
|
|
53
54
|
let activation;
|
|
54
55
|
if (wf.metadata?.activationId) {
|
|
55
|
-
|
|
56
|
+
const { data } = await ctx.platformApi.getActivation({
|
|
57
|
+
path: {
|
|
58
|
+
activation_id: wf.metadata.activationId,
|
|
59
|
+
organisation_id: ctx.organisationId,
|
|
60
|
+
environment_id: Deno.env.get(envVarEnvId) || 'development',
|
|
61
|
+
},
|
|
62
|
+
throwOnError: true
|
|
63
|
+
});
|
|
64
|
+
activation = data;
|
|
56
65
|
}
|
|
57
66
|
const newContext = ctx.contextProvider.create(data, {
|
|
58
67
|
activation: activation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/http.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/http.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AAoFnE,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAG5E,CAAC"}
|
|
@@ -1,28 +1,45 @@
|
|
|
1
1
|
import { mergeMap } from 'rxjs';
|
|
2
2
|
import { tap } from 'rxjs/operators';
|
|
3
3
|
import { HttpContextImpl, HttpTaskImpl } from '../../../dsl/tasks/HttpTask.js';
|
|
4
|
+
import { DynamicFetchFactory } from '../../../connection/DynamicFetchFactory.js';
|
|
5
|
+
import { StaticFetchFactory } from '../../../connection/StaticFetchFactory.js';
|
|
4
6
|
function compileHttp(compilerCtx, task) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const cnxMap = compilerCtx.configReader.getCnxMapping(task.opts.connection);
|
|
8
|
+
let fetchFactory;
|
|
9
|
+
if (!cnxMap) {
|
|
10
|
+
compilerCtx.log.error(`Connection ${task.opts.connection} not found, using default fetch with no credentials`);
|
|
11
|
+
fetchFactory = Promise.resolve(new StaticFetchFactory(globalThis.fetch));
|
|
12
|
+
}
|
|
13
|
+
else if (cnxMap.dynamic) {
|
|
14
|
+
fetchFactory = Promise.resolve(new DynamicFetchFactory(compilerCtx.cnxFactory, compilerCtx.platformApi, compilerCtx.organisationId, cnxMap.templateId));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
fetchFactory = compilerCtx.platformApi.getConnection({
|
|
18
|
+
path: {
|
|
19
|
+
organisation_id: compilerCtx.organisationId,
|
|
20
|
+
connection_id: cnxMap.connId,
|
|
21
|
+
},
|
|
22
|
+
throwOnError: true,
|
|
23
|
+
})
|
|
24
|
+
.then(({ data }) => Promise.all([compilerCtx.cnxFactory.fetcher(data), data.baseUrl ?? '']))
|
|
25
|
+
.then(([fetcher, baseUrl]) => new StaticFetchFactory(fetcher, baseUrl));
|
|
26
|
+
}
|
|
8
27
|
async function http(ctx) {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const httpContext = new HttpContextImpl(ctx, {}, baseUrlFetcher, _fetch, _dynamicFetcher);
|
|
28
|
+
const [fetch, baseUrl] = await fetchFactory.then(ff => Promise.all([ff.fetcher(ctx), ff.baseUrl(ctx)]));
|
|
29
|
+
const httpContext = new HttpContextImpl(ctx, {}, fetch, baseUrl);
|
|
12
30
|
const result = await task.fn(httpContext);
|
|
13
31
|
return ctx.withData(result);
|
|
14
32
|
}
|
|
15
33
|
return (src) => src.pipe(tap({
|
|
16
34
|
complete: () => compilerCtx.log.debug('http.complete'),
|
|
17
|
-
}), mergeMap(
|
|
35
|
+
}), mergeMap((ctx) => {
|
|
18
36
|
return compilerCtx.tracer.startActiveSpan(`http-${task.id}`, async (span) => {
|
|
19
37
|
span.setAttribute('task.id', task.id);
|
|
20
38
|
span.setAttribute('task.type', 'http');
|
|
21
39
|
span.setAttribute('execution.id', ctx.executionId);
|
|
22
40
|
span.setAttribute('connection.name', task.opts.connection);
|
|
23
41
|
try {
|
|
24
|
-
|
|
25
|
-
return result;
|
|
42
|
+
return await http(ctx);
|
|
26
43
|
}
|
|
27
44
|
catch (error) {
|
|
28
45
|
if (error instanceof Error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/schedule.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/schedule.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkJ7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
|
|
@@ -11,13 +11,36 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
11
11
|
const environmentId = Deno.env.get(envVarEnvId) || 'example-environment';
|
|
12
12
|
const environmentName = Deno.env.get(envVarEnvironmentName) || 'example-environment';
|
|
13
13
|
const orgId = Deno.env.get(envVarOrgId) || 'example-org';
|
|
14
|
-
const client = ctx.
|
|
14
|
+
const client = ctx.platformApi;
|
|
15
15
|
ctx.cronRegistry.set(trigger.id, trigger.schedule);
|
|
16
|
-
async function handleSchedule(
|
|
16
|
+
async function handleSchedule(_req, res, span) {
|
|
17
17
|
try {
|
|
18
18
|
if (trigger.activationPredicate === undefined) {
|
|
19
|
-
const activation = await client.
|
|
20
|
-
|
|
19
|
+
const { data: activation } = await client.listActivations({
|
|
20
|
+
path: {
|
|
21
|
+
organisation_id: ctx.organisationId,
|
|
22
|
+
environment_id: environmentId,
|
|
23
|
+
},
|
|
24
|
+
query: {
|
|
25
|
+
static: true,
|
|
26
|
+
},
|
|
27
|
+
throwOnError: false,
|
|
28
|
+
});
|
|
29
|
+
if (!activation) {
|
|
30
|
+
res.status(412).json({
|
|
31
|
+
status: 'error',
|
|
32
|
+
message: 'No activation found',
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (activation.length === 0) {
|
|
37
|
+
res.status(412).json({
|
|
38
|
+
status: 'error',
|
|
39
|
+
message: 'No activation found',
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const executionCtx = ctx.contextProvider.create(activation[0], {});
|
|
21
44
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
22
45
|
try {
|
|
23
46
|
subscriber.next(executionCtx);
|
|
@@ -31,25 +54,25 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
31
54
|
});
|
|
32
55
|
return;
|
|
33
56
|
}
|
|
34
|
-
const activations = await client.listActivations(
|
|
57
|
+
const { data: activations } = await client.listActivations({
|
|
58
|
+
path: {
|
|
59
|
+
organisation_id: ctx.organisationId,
|
|
60
|
+
environment_id: environmentId,
|
|
61
|
+
},
|
|
62
|
+
query: {
|
|
63
|
+
static: false,
|
|
64
|
+
},
|
|
65
|
+
throwOnError: false,
|
|
66
|
+
});
|
|
35
67
|
if (!activations || activations.length === 0) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
subscriber.next(executionCtx);
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
executionCtx.log.error('execution error inside schedule', { error });
|
|
44
|
-
}
|
|
45
|
-
res.status(200).json({
|
|
46
|
-
status: 'triggered',
|
|
47
|
-
executionId: executionCtx.executionId,
|
|
68
|
+
ctx.log.info('no activations found, continuing');
|
|
69
|
+
res.status(204).json({
|
|
70
|
+
status: 'no-activations',
|
|
48
71
|
});
|
|
49
72
|
return;
|
|
50
73
|
}
|
|
51
74
|
activations.forEach((activation) => {
|
|
52
|
-
const executionCtx = ctx.contextProvider.create(
|
|
75
|
+
const executionCtx = ctx.contextProvider.create(activation, {});
|
|
53
76
|
try {
|
|
54
77
|
subscriber.next(executionCtx);
|
|
55
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/webhook.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/durable/compilers/webhook.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAyD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CAuSxE,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { pipeline } from 'node:stream/promises';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { createActIdDynamicWebhookMiddleware, createStaticWebhookMiddleware, createUserIdDynamicWebhookMiddleware, } from '../../../dsl/http/versori/webhookmiddleware.js';
|
|
6
6
|
import { WebhookTrigger } from '../../../dsl/triggers/WebhookTrigger.js';
|
|
7
|
+
import { envVarEnvId } from '../../../internal/constants.js';
|
|
7
8
|
import xmlparser from 'express-xml-bodyparser';
|
|
8
9
|
const xml2jsDefaults = {
|
|
9
10
|
explicitArray: false,
|
|
@@ -108,19 +109,18 @@ export const webhookCompiler = {
|
|
|
108
109
|
ctx.webhookRouter[method](`/${trigger.id}`, createStaticWebhookMiddleware({
|
|
109
110
|
id: trigger.id,
|
|
110
111
|
connName: trigger.options.connection,
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
organisationId: ctx.organisationId,
|
|
113
|
+
environmentId: Deno.env.get(envVarEnvId) ?? '',
|
|
114
|
+
platformApi: ctx.platformApi,
|
|
115
|
+
cnxFactory: ctx.cnxFactory,
|
|
113
116
|
cfgReader: ctx.configReader,
|
|
114
117
|
log: ctx.log,
|
|
115
118
|
}), async (req, res) => {
|
|
116
119
|
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, async (span) => {
|
|
117
120
|
span.setAttribute('task.id', trigger.id);
|
|
118
121
|
span.setAttribute('task.type', 'webhook');
|
|
119
|
-
let executionCtx = ctx.contextProvider.create(req.body, ctxOptionsFn(req, res));
|
|
120
122
|
const staticActivation = res.locals.activation;
|
|
121
|
-
|
|
122
|
-
executionCtx = executionCtx.withActivation(staticActivation);
|
|
123
|
-
}
|
|
123
|
+
const executionCtx = ctx.contextProvider.create(staticActivation, req.body, ctxOptionsFn(req, res));
|
|
124
124
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
125
125
|
try {
|
|
126
126
|
subscriber.next(executionCtx);
|
|
@@ -145,8 +145,10 @@ export const webhookCompiler = {
|
|
|
145
145
|
ctx.webhookRouter[method](`/${trigger.id}/users/:userId`, createUserIdDynamicWebhookMiddleware({
|
|
146
146
|
id: trigger.id,
|
|
147
147
|
connName: trigger.options.connection,
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
organisationId: ctx.organisationId,
|
|
149
|
+
environmentId: Deno.env.get(envVarEnvId) ?? '',
|
|
150
|
+
platformApi: ctx.platformApi,
|
|
151
|
+
cnxFactory: ctx.cnxFactory,
|
|
150
152
|
cfgReader: ctx.configReader,
|
|
151
153
|
log: ctx.log,
|
|
152
154
|
}), async (req, res) => {
|
|
@@ -156,11 +158,10 @@ export const webhookCompiler = {
|
|
|
156
158
|
span.setAttribute('user.id', req.params.userId);
|
|
157
159
|
const userId = req.params.userId;
|
|
158
160
|
const activation = res.locals.activation;
|
|
159
|
-
const activations = [activation];
|
|
160
161
|
// Right now we only support a user having one activation
|
|
161
162
|
// so this will need changing when we support multiple activations per user
|
|
162
163
|
// as will the middleware
|
|
163
|
-
if (!
|
|
164
|
+
if (!activation) {
|
|
164
165
|
res.status(404).json({
|
|
165
166
|
status: 'error',
|
|
166
167
|
message: `No activations found for user: ${userId}`,
|
|
@@ -170,24 +171,21 @@ export const webhookCompiler = {
|
|
|
170
171
|
span.end();
|
|
171
172
|
return;
|
|
172
173
|
}
|
|
173
|
-
const executionCtx = ctx.contextProvider.create(req.body, ctxOptionsFn(req, res));
|
|
174
|
+
const executionCtx = ctx.contextProvider.create(activation, req.body, ctxOptionsFn(req, res));
|
|
174
175
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
175
176
|
const errors = [];
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
});
|
|
177
|
+
try {
|
|
178
|
+
subscriber.next(executionCtx);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
executionCtx.log.error('webhook execution error', {
|
|
182
|
+
error: JSON.stringify(error),
|
|
183
|
+
});
|
|
184
|
+
errors.push({
|
|
185
|
+
activationId: activation.id,
|
|
186
|
+
error,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
191
189
|
if (isAsync) {
|
|
192
190
|
if (errors.length === 0) {
|
|
193
191
|
sendResponse(res, onSuccess(executionCtx));
|
|
@@ -202,9 +200,11 @@ export const webhookCompiler = {
|
|
|
202
200
|
// this endpoint will trigger the workflow only for the activation given by its ID
|
|
203
201
|
ctx.webhookRouter[method](`/${trigger.id}/activations/:activationId`, createActIdDynamicWebhookMiddleware({
|
|
204
202
|
id: trigger.id,
|
|
203
|
+
organisationId: ctx.organisationId,
|
|
204
|
+
environmentId: Deno.env.get(envVarEnvId) ?? '',
|
|
205
205
|
connName: trigger.options.connection,
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
platformApi: ctx.platformApi,
|
|
207
|
+
cnxFactory: ctx.cnxFactory,
|
|
208
208
|
cfgReader: ctx.configReader,
|
|
209
209
|
log: ctx.log,
|
|
210
210
|
}), async (req, res) => {
|
|
@@ -213,7 +213,7 @@ export const webhookCompiler = {
|
|
|
213
213
|
span.setAttribute('task.type', 'webhook');
|
|
214
214
|
span.setAttribute('activation.id', req.params.activationId);
|
|
215
215
|
const activation = res.locals.activation;
|
|
216
|
-
const activationId = activation
|
|
216
|
+
const activationId = activation?.id ?? req.params.activationId;
|
|
217
217
|
if (!activation) {
|
|
218
218
|
// TODO report back actual errors
|
|
219
219
|
res.status(404).json({
|
|
@@ -225,10 +225,7 @@ export const webhookCompiler = {
|
|
|
225
225
|
span.end();
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
const activationCtx = ctx.contextProvider.create(req.body,
|
|
229
|
-
...ctxOptionsFn(req, res),
|
|
230
|
-
activation,
|
|
231
|
-
});
|
|
228
|
+
const activationCtx = ctx.contextProvider.create(activation, req.body, ctxOptionsFn(req, res));
|
|
232
229
|
span.setAttribute('execution.id', activationCtx.executionId);
|
|
233
230
|
try {
|
|
234
231
|
subscriber.next(activationCtx);
|
|
@@ -3,12 +3,13 @@ import { NodeSDK } from '@opentelemetry/sdk-node';
|
|
|
3
3
|
import { Router } from 'express';
|
|
4
4
|
import { Observable, Subscription } from 'rxjs';
|
|
5
5
|
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
6
|
-
import { ConfigReader,
|
|
6
|
+
import { ConfigReader, CronProvider } from '../../dsl/http/types.js';
|
|
7
7
|
import { Workflow } from '../../dsl/Workflow.js';
|
|
8
8
|
import { IssueAPI } from '../../issues/Issues.js';
|
|
9
9
|
import { ContextImpl, ContextOperatorFunction } from '../../mod.js';
|
|
10
10
|
import { Logger } from '../../observability/logging/Logger.js';
|
|
11
11
|
import { ObservableCompiler } from './ObservableCompiler.js';
|
|
12
|
+
import { DirectConnectionFactory } from '../../connection/DirectConnectionFactory.js';
|
|
12
13
|
export type MemoryInterpreterOptions = {
|
|
13
14
|
logger?: Logger;
|
|
14
15
|
compiler?: ObservableCompiler;
|
|
@@ -27,11 +28,10 @@ export declare class MemoryInterpreter {
|
|
|
27
28
|
private readonly log;
|
|
28
29
|
private readonly compiler;
|
|
29
30
|
private readonly contextProvider;
|
|
30
|
-
private readonly roundTripperFactory;
|
|
31
31
|
private readonly webhookRouter;
|
|
32
32
|
private readonly cronRouter;
|
|
33
33
|
private cronRegistry;
|
|
34
|
-
private readonly
|
|
34
|
+
private readonly cnxFactory;
|
|
35
35
|
private readonly cronProvider;
|
|
36
36
|
private readonly tracer;
|
|
37
37
|
private readonly issuesProvider;
|
|
@@ -42,7 +42,7 @@ export declare class MemoryInterpreter {
|
|
|
42
42
|
private cronServer?;
|
|
43
43
|
private shutdownServer?;
|
|
44
44
|
private isShuttingDown;
|
|
45
|
-
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider,
|
|
45
|
+
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, webhookRouter: Router, cronRouter: Router, cronRegistry: Map<string, string>, cnxFactory: DirectConnectionFactory, cronProvider: CronProvider, tracer: Tracer, issuesProvider: IssueAPI, cfgReader: ConfigReader, otelSDK?: NodeSDK | undefined);
|
|
46
46
|
static newInstance(options?: MemoryInterpreterOptions): Promise<MemoryInterpreter>;
|
|
47
47
|
register<O>(workflow: Workflow<O>, options?: MemoryInterpreterOptions): Registration;
|
|
48
48
|
start(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAAA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AAAA,OAA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