Commit graph

10 commits

Author SHA1 Message Date
Sipke Schoorstra 5f11026ee7
Add JS functions for encoding/decoding byte arrays from and to strings (#5902)
* Add handlers and improve JavaScript engine configuration

Added several new handlers for configuring the JavaScript engine with common types, functions, variable accessors, and input/output accessors. Refactored the JintJavaScriptEvaluator for better clarity and modularity by breaking down configuration steps into separate methods. Also replaced `IsInsideCompositeActivity` with `IsContainedWithinCompositeActivity` for better semantic consistency.

* Refactor to use primary constructor syntax for TypeDefinitionProviders

Updated CommonTypeDefinitionProvider, VariableTypeDefinitionProvider, and ActivityOutputFunctionsDefinitionProvider to use primary constructors for dependency injection. This change reduces redundancy and simplifies the code structure for better readability and maintainability.

* Add byte conversion functions to JavaScript engine

Introduced functions for converting bytes to/from strings and Base64. Updated CommonFunctionsDefinitionProvider and ConfigureEngineWithCommonFunctions to incorporate these new functions. This enhances the JavaScript engine's ability to handle byte array manipulations.

* Add tests for JavaScript byte and string conversions.

Introduce integration tests to verify byte array to string, string to byte array, byte array to Base64, and Base64 to byte array conversions using JavaScript functions. Ensure accurate transformation of data within different encoding scenarios.

* Add meaningful summaries to Jint engine configuration handlers

Updated comment summaries in four handler classes to provide clear and concise descriptions of their purpose. This helps improve code readability and understanding for future developers.

* Rename and merge variable and input/output handlers

Merged the variable accessor logic into the input/output handler and renamed the class to reflect its broader functionality. This consolidation ensures the accessors are registered in the right order.

* Add string base64 conversion functions

Introduced `stringToBase64` and `stringFromBase64` functions to handle base64 encoding and decoding of strings. Updated corresponding provider, handler, and added tests to ensure functionality.
2024-08-14 17:43:35 +02:00
Sipke Schoorstra 6ff6cc6826 Refactor expression descriptors and remove unnecessary async calls
This commit refactors how expression descriptors are created and retrieved across Elsa project. The asynchronous methods have been simplified to synchronous ones removing unnecessary `ValueTask` returns. Additionally, `IExpressionDescriptorRegistryPopulator` has been removed resulting in less complexity and better performance.
2023-12-10 21:43:24 +01:00
Sipke Schoorstra e4d6ad22c4
Decouple Expression Types (#4622)
* Refactor Expressions model

* Enable expression type filtering

* Implement dynamic enablement of satelite dependencies
2023-11-14 20:44:42 +01:00
Sipke Schoorstra fad27d0fb0
Refactor composite activity input and scoped memory (#3815)
* Incremental work

* Enable control over when to include full compositie root

* Cleanup

* Update WorkflowDefinitionActivity

* Implement input as variables

* Delete unused class

* Remove less common types

* Rename ExpandoObject to JSON

* Implement variable scoping

* Remove parent/child relationship from MemoryRegister

* Add support for sending input to "trigger event" endpoint

* Add support for configuring input storage driver

* Remove unused namespace imports

* Auto-register activity types when running a workflow

* Fix missing variables from containers
2023-03-20 19:55:11 +01:00
Sipke Schoorstra 1a713b4619
Rename "services" to "contracts" and "implementations" to "services" (#3758) 2023-03-03 22:47:23 +01:00
Sipke Schoorstra 28e9922060
JavaScript intellisense (#3639)
* Incremental work

* Incremental work

* Incremental work

* Initial support for intellisense

* Implement variable type definition provider
2023-01-19 14:09:58 +01:00
Sipke Schoorstra 026430fd2d
Composite Activity fixes and improvements (#3512)
* Implement consistent input/output/variable memory block identifiers

* Telnyx fixes and improvements

* Fix bookmark burning

* Refactor AnswerCall

* Incremental work on source + line registration

* Handle missing bookmarks

* Fix bookmark persisted callback mechanism

* Implement distributed locking for default workflow runtime

* Fix recording bookmark

* Increase source file and line coverage
2022-12-07 20:47:36 +01:00
Sipke Schoorstra c70247e133 Fix memory referencing and some other stuff 2022-12-02 22:57:26 +01:00
Sipke Schoorstra 4ac74864cd Incremental work on transposition 2022-06-14 15:56:41 +02:00
Sipke Schoorstra fccf4737e2
V3 modular configuration (#3070)
* Restructuring (WIP)

* Fix warnings

* Move DSL to modules

* Update namespaces

* Make design factory base reusable

* Update service registrations

* Remove unused namespaces and rename ElsaDbContext

* Incremental work on migrations

* Generate WorkflowsDbContext SQLite migrations

* Rename ServiceCollectionExtensions

* Update DbContextOptionsBuilderExtensions.cs

* Restructure

* Configuration refactorings (WIP)

* Incremental work on configurator API

* Incremental work on configuration API

* Incremental work on configuration API

* Fix workflow runtime options

* Move standard stream providers

* Implement configurator dependencies

* Cleanup configurator API

* Update configurator dependencies

* Cleanup

* Update Label API endpoints

* Fix eager configuration issue
2022-05-26 12:47:31 +02:00
Renamed from src/scripting/Elsa.Scripting.JavaScript/Providers/JavaScriptExpressionSyntaxProvider.cs (Browse further)