Commit graph

1,922 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
e64d0fcf03 🔧 fix(store.py): set liked_by_user flag to True for components liked by the user
🔧 fix(schema.py): add liked_by_user field to ListComponentResponse schema
🔧 fix(service.py): add get_liked_by_user_components method to StoreService to retrieve liked components by user
2023-10-31 19:58:10 -03:00
Gabriel Luiz Freitas Almeida
d7e2d43409 🐛 fix(service.py): import and use process_tags_for_post function to correctly process tags for post request
 feat(utils.py): add process_tags_for_post function to handle processing of tags for post request
2023-10-31 10:44:57 -03:00
Gabriel Luiz Freitas Almeida
79bd78613b 🔥 refactor(service.py): remove redundant assignment to params["fields"] in StoreService class 2023-10-30 20:57:21 -03:00
Gabriel Luiz Freitas Almeida
5ebd298463 🔥 refactor(service.py): remove unnecessary code that pops "page" and "limit" parameters from params dictionary
The code was removing "page" and "limit" parameters from the params dictionary, but these parameters were not being used afterwards. Removing this unnecessary code improves code readability and maintainability.
2023-10-30 20:42:33 -03:00
Gabriel Luiz Freitas Almeida
127721e986 🐛 fix(schema.py): handle empty list case in tags_to_list method to prevent potential errors
🐛 fix(service.py): add validation for missing API key when filter_by_user is True to avoid unauthorized access
2023-10-30 19:50:39 -03:00
Gabriel Luiz Freitas Almeida
bf775eaaad 🔍 chore(store.py): add support for filtering by is_component parameter in search_endpoint function
🔍 chore(service.py): add support for filtering by is_component parameter in StoreService class
2023-10-30 11:17:22 -03:00
Gabriel Luiz Freitas Almeida
07e8e318ee 🔥 refactor(store.py): remove unused code for creating component metadata
The code was previously responsible for creating metadata for a component based on the nodes it contains. However, this functionality is no longer needed and has been removed to simplify the code and improve maintainability.
2023-10-27 19:52:56 -03:00
Gabriel Luiz Freitas Almeida
7b946cef70 🔀 refactor(store.py): rename route from "/" to "/check" to improve clarity and specificity 2023-10-27 16:28:53 -03:00
anovazzi1
761bbc5fd0 code format 2023-10-27 16:21:56 -03:00
Gabriel Luiz Freitas Almeida
e621243288 🔧 refactor(store.py): modify create_component function to include total count of each type in the metadata dictionary
The `create_component` function in `store.py` has been modified to include the total count of each type in the metadata dictionary. This change improves the structure of the metadata and provides more comprehensive information about the types and their counts in the nodes.
2023-10-27 14:04:15 -03:00
Gabriel Luiz Freitas Almeida
6f3172bc33 🔧 refactor(store.py): remove duplicate fields list and use default_fields from StoreService class
🔧 refactor(service.py): move default_fields list to StoreService class and use it in query_components method
2023-10-27 13:07:09 -03:00
Gabriel Luiz Freitas Almeida
bfc74367b5 🔧 fix(store.py): modify metadata structure to include count for each name and total count to improve data analysis capabilities 2023-10-27 13:03:27 -03:00
Gabriel Luiz Freitas Almeida
4016c28573 🔧 fix(store.py): add metadata to component before uploading to improve data integrity and analysis capabilities 2023-10-27 11:43:12 -03:00
Gabriel Luiz Freitas Almeida
5716ca21dc 🔧 fix(store.py): import missing module 'langflow.api' to resolve NameError
🔧 fix(store.py): add missing metadata comment to clarify the purpose of the code block
 feat(store.py): add 'has_api_key' field to the response of 'check_if_store_is_enabled' endpoint to indicate if the user has an API key
🔧 fix(store.py): add missing metadata using the Component.data in the 'create_component' endpoint to properly handle component metadata
2023-10-27 11:37:54 -03:00
Gabriel Luiz Freitas Almeida
dfabb80567 🐛 fix(schema.py): fix the transformation of tags in ListComponentResponse to return a list of TagResponse objects
🔥 chore(service.py): remove unnecessary code that flattens the tags in ListComponentResponse
2023-10-27 11:05:02 -03:00
Gabriel Luiz Freitas Almeida
f69917f4b0 🔥 refactor(store.py): remove unnecessary "user_created.id" field from list_components function
🔥 refactor(service.py): remove unnecessary "user_created.id" field from StoreService class
2023-10-27 10:32:33 -03:00
Gabriel Luiz Freitas Almeida
d34b551677 🔧 chore(.env.example): update example URLs for LANGFLOW_STORE_URL, LANGFLOW_DOWNLOAD_WEBHOOK_URL, and LANGFLOW_LIKE_WEBHOOK_URL to improve clarity and consistency
🔧 chore(store.py): add endpoint to like a component in the store API to enable users to like components

🔧 chore(base.py): add LIKE_WEBHOOK_URL to the settings to allow configuration of the webhook URL for liking components

🔧 chore(service.py): rename webhook_url variable to download_webhook_url for clarity and add like_webhook_url variable to store the LIKE_WEBHOOK_URL from the settings. Update call_webhook method to use download_webhook_url for downloading components and add like_component method to handle liking a component.
2023-10-27 00:16:57 -03:00
Gabriel Luiz Freitas Almeida
af593684c0 🐛 fix(alembic): handle exception when altering column "user_id" in "flow" table to be nullable
🔥 chore(alembic): remove unnecessary code in downgrade function
2023-10-26 23:21:44 -03:00
anovazzi1
43c80da141 format code 2023-10-26 16:37:50 -03:00
Gabriel Luiz Freitas Almeida
44b90b36d7 🐛 fix(service.py): remove unnecessary fields from params to improve performance and reduce payload size
 feat(service.py): remove page and limit params to retrieve all results instead of a limited number of results
2023-10-26 15:53:24 -03:00
Gabriel Luiz Freitas Almeida
5a54fa74fe 🔧 fix(schema.py): add 'downloads_count' field to ComponentResponse, ListComponentResponse, and DownloadComponentResponse models to track the number of downloads for each component 2023-10-26 15:50:15 -03:00
Gabriel Luiz Freitas Almeida
654a1de6c6 🔧 fix(store.py): flatten the tags in the list_components response to match the schema
🔧 fix(store.py): add user_created.id field to the list_components response to match the schema
🔧 fix(store.py): add count(downloads) field to the list_components response to match the schema
🔧 fix(store.py): add tags_id field to the TagsIdResponse schema to match the response structure
🔧 fix(service.py): add user_created.first_name and user_created.id fields to the list_components query to match the schema
🔧 fix(service.py): add count(downloads) field to the list_components query to match the schema
2023-10-26 15:48:42 -03:00
Gabriel Luiz Freitas Almeida
d0f121e662 🔧 fix(store.py): add "metadata" field to the list of requested fields in the list_components function to include metadata in the response
🔧 fix(schema.py): add "metadata" field to the ComponentResponse, ListComponentResponse, DownloadComponentResponse, and StoreComponentCreate models to support metadata in the store component data
🔧 fix(service.py): add "metadata" field to the list of requested fields in the StoreService class to include metadata in the query parameters
2023-10-26 15:25:54 -03:00
Gabriel Luiz Freitas Almeida
2427bda690 🔄 refactor(schema.py): change liked_by_count type from List[UUID] to int for better consistency and readability 2023-10-26 15:19:11 -03:00
Gabriel Luiz Freitas Almeida
4e62f02226 🐛 fix(service.py): fix typo in params["filter"] assignment
 feat(service.py): add support for filtering by user_created field and limit the results to 100
 feat(service.py): add support for fetching additional fields in the response for better data retrieval
2023-10-26 15:13:22 -03:00
Gabriel Luiz Freitas Almeida
5a8ba5f0db 🐛 fix(service.py): remove unnecessary try-except block and return statement to improve code readability and maintainability 2023-10-26 14:45:49 -03:00
Gabriel Luiz Freitas Almeida
6615bf3b03 🔧 fix(store.py): import UsersLikesResponse in store.py to resolve import error
 feat(store.py): add new endpoint to get list of components liked by a user
🔧 fix(schema.py): add UsersLikesResponse schema to define the response structure for the new endpoint
🔧 fix(service.py): add get_user_likes method to retrieve the list of components liked by a user from the store API
2023-10-26 11:46:42 -03:00
Gabriel Luiz Freitas Almeida
acc6cd6e4e 🐛 fix(service.py): handle JSONDecodeError when response does not contain data field to prevent server error
 feat(service.py): return ComponentResponse with component_dict when response does not contain data field to provide consistent response format
2023-10-26 11:31:35 -03:00
Gabriel Luiz Freitas Almeida
d11b199ca4 🔧 fix(store.py): update attribute name from "user_created.name" to "user_created.first_name" to reflect correct data structure
🔧 fix(store.py): remove unnecessary code and comments
2023-10-26 10:15:35 -03:00
Gabriel Luiz Freitas Almeida
d664131e6c 🔧 fix(__main__.py): add 'store' parameter to update_settings function to enable/disable store feature
 feat(__main__.py): add 'store' option to the run command to enable/disable store feature
🔧 fix(store.py): add check_if_store_is_enabled endpoint to check if store feature is enabled
 feat(store.py): add get_tags endpoint to retrieve tags from the store
🔧 fix(base.py): add STORE setting to enable/disable store feature
🔧 fix(schema.py): rename 'likes_count' field to 'liked_by_count' in ComponentResponse and ListComponentResponse
🔧 fix(service.py): change default sorting in query_components function to sort by 'count(liked_by)'
 test(test_store.py): update sort parameter in test_search_components to 'count(liked_by)'
2023-10-25 23:12:23 -03:00
Gabriel Luiz Freitas Almeida
785e8a6436 🔧 fix(store.py): add count_components endpoint to retrieve the count of components in the store
🔧 fix(service.py): modify count_components method to make api_key optional and add filter_by_user parameter to filter components by user
2023-10-25 22:23:13 -03:00
Gabriel Luiz Freitas Almeida
3934096e06 🔥 refactor(store.py): remove count_components endpoint
The count_components endpoint was removed as it was no longer being used and served no purpose in the API.
2023-10-25 22:03:22 -03:00
Gabriel Luiz Freitas Almeida
31fb76c992 🐛 fix(store.py): change function name from query_components to count_components to improve semantics and accurately count components
 feat(service.py): add count_components method to StoreService class to count components based on filter criteria
2023-10-25 21:50:06 -03:00
Gabriel Luiz Freitas Almeida
c9b77ec9db 🔧 fix(store.py): change list_components function name to query_components for better semantics and consistency
 feat(store.py): add `count_components` endpoint to get the count of components based on filter criteria
🔧 fix(service.py): modify `query_components` function to return a list of dictionaries when `count` parameter is True
2023-10-25 21:47:39 -03:00
Gabriel Luiz Freitas Almeida
b006f11a3d 🐛 fix(service.py): simplify the filter condition for retrieving public components 2023-10-25 18:07:49 -03:00
Gabriel Luiz Freitas Almeida
bb05c6cd46 🐛 fix(service.py): increase default limit value from 10 to 15 to retrieve more components per page
🐛 fix(service.py): fix duplicate assignment in filter parameter to correctly filter public and Public components
2023-10-25 18:05:42 -03:00
Gabriel Luiz Freitas Almeida
7d4e3e2614 🐛 fix(service.py): update filter logic to include components with status "Public" in addition to "public" 2023-10-25 18:04:22 -03:00
Gabriel Luiz Freitas Almeida
3a21f6092a 🔧 chore(service.py): add support for filtering components by user_created field
🔧 chore(service.py): add support for filtering components by user_created field when filter_by_user flag is set to True, otherwise filter by status field
2023-10-25 11:51:40 -03:00
Gabriel Luiz Freitas Almeida
e15d38e8d2 🐛 fix(store.py): decrypt store API key before using it to improve security
 feat(store.py): add support for optional store API key to handle cases where user does not have a store API key set
🔧 chore(store.py): remove unnecessary dependency injection for settings_service in create_component, list_components, read_component, and search_endpoint functions
2023-10-25 11:51:02 -03:00
Gabriel Luiz Freitas Almeida
732fd4767f 🐛 fix(service.py): remove unused parameter 'filter_by_user' from download method to improve code readability and maintainability 2023-10-25 11:06:15 -03:00
Gabriel Luiz Freitas Almeida
d1c4af8c7d 🐛 fix(store.py): add filter_by_user parameter to list_components and read_component functions to filter components by user
 feat(store.py): add support for filtering components by user in the list_components and read_component functions
🐛 fix(service.py): add filter_by_user parameter to list_components function in StoreService class to filter components by user
2023-10-24 22:50:42 -03:00
Gabriel Luiz Freitas Almeida
ed8acfb8af 🔥 refactor(flows.py): remove unused session dependency in read_flows function 2023-10-24 18:52:44 -03:00
Gabriel Luiz Freitas Almeida
dde22bd35f 🔧 fix(store.py): add filter_by_user query parameter to read_component endpoint to allow filtering components by user
🔧 fix(service.py): modify download method in StoreService to include filter_by_user parameter in API request to filter components by user
2023-10-24 18:51:30 -03:00
Gabriel Luiz Freitas Almeida
6d6b2ed826 🔧 fix(base.py): add DOWNLOAD_WEBHOOK_URL setting to support webhook integration for component downloads
🔧 fix(service.py): call webhook after downloading a component to trigger webhook integration
2023-10-24 16:10:33 -03:00
Gabriel Luiz Freitas Almeida
78544c9469 🔧 chore(service.py): refactor teardown_superuser function to improve code readability and maintainability 2023-10-24 09:32:32 -03:00
Gabriel Luiz Freitas Almeida
b33878088e 🐛 fix(service.py): handle case when response is None to prevent UnboundLocalError
🐛 fix(service.py): handle case when response is None to prevent UnboundLocalError and raise ValueError with error message from response if available
2023-10-23 23:46:07 -03:00
Gabriel Luiz Freitas Almeida
8b9267b2e8 🐛 fix(store.py): import missing schema classes in store.py to fix NameError
 feat(store.py): change response models for list_components and read_component endpoints to use new schema classes for improved consistency and clarity
🐛 fix(schema.py): add missing ListComponentResponse and DownloadComponentResponse classes to schema.py to fix NameError
 feat(service.py): change return types of list_components and download methods in StoreService to use new schema classes for improved consistency and clarity
2023-10-23 23:37:08 -03:00
Gabriel Luiz Freitas Almeida
2b9ac7c3ac 🔧 chore(store.py): add status code 201 to the response of create_component endpoint for better HTTP semantics 2023-10-23 23:07:11 -03:00
Gabriel Luiz Freitas Almeida
e6ae03105f 🐛 fix(store.py): pass component object instead of dict to store_service.upload() to fix data type mismatch
🐛 fix(service.py): convert parent UUID to string before sending to store in upload() method to fix data type mismatch
2023-10-23 22:56:15 -03:00
Gabriel Luiz Freitas Almeida
ab86ddc38a 🐛 fix(service.py): fix index out of range error when getting component in download method 2023-10-23 22:09:01 -03:00