🔧 fix(test_database.py): fix test_read_flows function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flows function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_upload_file function signature to include logged_in_headers parameter
🔧 fix(test_database.py): fix test_download_file function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_create_flow_with_invalid_data function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_get_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_flow_idempotency function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_update_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_delete_nonexistent_flow function signature to include active_user and logged_in_headers parameters
🔧 fix(test_database.py): fix test_read_empty_flows function signature to include active_user and logged_in_headers parameters
🐛 fix(schemas.py): change json.dumps to orjson_dumps for improved performance and compatibility with orjson library
🐛 fix(utils.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(loading.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(utils.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(vector_store.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(types.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
🐛 fix(process.py): change json.loads to orjson.loads for improved performance and compatibility with orjson library
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 fix(base.py): import orjson instead of json to improve performance and compatibility
🔧 fix(frontend_node/llms.py): use orjson_dumps instead of json.dumps to improve performance and compatibility
🔧 fix(frontend_node/utilities.py): use orjson_dumps instead of json.dumps to improve performance and compatibility
🔧 fix(test_cache.py): import orjson and use orjson_dumps instead of json.dumps to improve performance and compatibility
🔧 fix(test_database.py): import correct json encoder and decoder functions to fix import errors
🔧 fix(test_database.py): replace json.dumps and json.loads with orjson_dumps and orjson.loads for better performance and compatibility
🔧 fix(test_loading.py): remove unused import statement
🔧 fix(test_cache_manager.py): fix import path for CacheManager in test_cache_manager.py file
🔧 fix(test_custom_component.py): fix import path for Flow and FlowCreate models in test_custom_component.py file
🔧 fix(test_database.py): fix import path for Flow, FlowCreate, and FlowUpdate models in test_database.py file
🔧 fix(test_websocket.py): fix import path for WebSocketDisconnect in test_websocket.py file
The changes in this commit are purely cosmetic. The code has been reformatted to improve readability and consistency. Unnecessary lines have been removed to make the code more concise.
🧪 test(test_database.py): add test case for creating flows without a flow
The flow field is now optional to allow creation of flows without a flow. This is useful when creating a flow that will be populated later. A test case was added to ensure that flows can be created without a flow.
🐛 fix(llms.py): add name check before checking if "azure" is in name.lower()
🔨 refactor(test_database.py): rename updated_flow_style variable to to_update_flow_style for clarity
The update_settings function now has an optional database_url parameter to allow for more flexibility in updating settings. The llms.py file now checks if the name variable is not None before checking if "azure" is in name.lower(). In test_database.py, the updated_flow_style variable is renamed to to_update_flow_style for clarity.
✨ feat(test_database.py): add tests for creating, reading, updating, and deleting FlowStyle objects
🚨 fix(test_database.py): fix flow_id type in test_read_flow to be UUID instead of string
🚨 fix(test_database.py): fix HTTP method in test_update_flow from PUT to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_update_flow and test_update_nonexistent_flow
🚨 fix(test_database.py): fix HTTP method in test_update_flow_idempotency from PUT to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_update_flow_idempotency
🚨 fix(test_database.py): fix HTTP method in test_delete_flow from DELETE to PATCH
🚨 fix(test_database.py): fix API endpoint URLs in test_delete_flow and test_delete_nonexistent_flow
🚨 fix(test_database.py): fix API endpoint URLs in test_read_flows and test_read_empty_flows
The changes in this commit fix the API endpoint URLs to include the version number and fix various HTTP methods. Additionally, tests were added for creating, reading, updating, and deleting FlowStyle objects. The test_read_flow was fixed to use UUID instead of string for the flow_id.
🚨 test(database.py): add tests for CRUD operations on FlowStyle model
This commit adds tests for the CRUD operations on the FlowStyle model. The tests include creating a flow style, reading all flow styles, reading a single flow style, updating a flow style, and deleting a flow style. These tests ensure that the API endpoints for the FlowStyle model are working as expected.
✨ feat(flow.py): add validator to ensure flow field is a valid JSON object with required fields
The flow field in the FlowBase model has been changed from a string to a dictionary to allow for JSON data. A validator has been added to ensure that the flow field is a valid JSON object with the required fields. The tests have been updated to reflect these changes.
✨ feat(database.py): add default argument to json.dumps to handle datetime objects
🚨 test(database.py): add tests for batch flow creation, file upload, and file download
The fix in database.py handles the case where the data dictionary does not contain the "flows" key. This is important because the code assumes that the "flows" key is present and will raise an exception if it is not. The fix adds a check to see if the "flows" key is present and if not, it creates a new FlowListCreate object with the data as a list of FlowCreate objects.
The feature in database.py adds a default argument to the json.dumps function to handle datetime objects. This is important because the default json encoder does not handle datetime objects and will raise an exception if it encounters one.
The tests in test_database.py cover the batch creation of flows, uploading a file containing flows, and downloading a file containing flows. These tests ensure that the endpoints are working as expected and that the data is being handled correctly.
✅ test(database.py): add tests for CRUD operations on Flow model
The new fixtures added to conftest.py are session and client fixtures. These fixtures are used to create a test database and a test client for testing the database. The tests added to test_database.py test the CRUD operations on the Flow model. The tests include creating a flow, reading all flows, reading a single flow, updating a flow, and deleting a flow. These tests ensure that the database is working as expected and that the API endpoints for the Flow model are functioning correctly.