Commit graph

1,962 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
c89e4bc422 Add Object field type to constants.py 2023-11-14 21:01:19 -03:00
Gabriel Luiz Freitas Almeida
c88d63546f 🔧 fix(field_typing): import Object class in __init__.py to fix missing import error
🔧 fix(constants.py): add Object class to CUSTOM_COMPONENT_SUPPORTED_TYPES to support object type in field typing
2023-11-14 21:00:43 -03:00
Gabriel Luiz Freitas Almeida
cfdc2da77b 🔧 fix(store.py): change get_components, read_component, get_tags, get_list_of_components_liked_by_user, and like_component functions to be asynchronous to improve performance and avoid blocking the event loop
🚀 feat(store.py): update get_components function to use async/await syntax for querying and counting components to improve readability and maintainability
🚀 feat(store.py): update read_component function to use async/await syntax for downloading component from the store to improve performance and avoid blocking the event loop
🚀 feat(store.py): update get_tags function to use async/await syntax for getting tags from the store to improve performance and avoid blocking the event loop
🚀 feat(store.py): update get_list_of_components_liked_by_user function to use async/await syntax for getting user likes from the store to improve performance and avoid blocking the event loop
🚀 feat(store.py): update like_component function to use async/await syntax for liking a component and getting the updated likes count from the store to improve performance and avoid blocking the event loop

🐛 fix(service.py): change _get method to async to make it compatible with async requests
 feat(service.py): change call_webhook method to async to make it compatible with async requests
🐛 fix(service.py): change count_components method to async to make it compatible with async requests
 feat(service.py): change query_components method to async to make it compatible with async requests
🐛 fix(service.py): change get_liked_by_user_components method to async to make it compatible with async requests
 feat(service.py): change get_components_in_users_collection method to async to make it compatible with async requests
🐛 fix(service.py): change download method to async to make it compatible with async requests
 feat(service.py): change upload method to async to make it compatible with async requests
🐛 fix(service.py): change get_tags method to async to make it compatible with async requests
 feat(service.py): change get_user_likes method to async to make it compatible with async requests
🐛 fix(service.py): change get_component_likes_count method to async to make it compatible with async requests
 feat(service.py): change like_component method to async to make it compatible with async requests
🐛 fix(utils.py): change update_components_with_user_data method to async to make it compatible with async requests
2023-11-14 16:26:02 -03:00
Gabriel Luiz Freitas Almeida
a7c86f1d1e 🐛 fix(store.py): fix build_filter_conditions method to correctly build filter conditions for querying components
 feat(store.py): add build_liked_filter method to build filter conditions for querying liked components
 feat(store.py): add build_tags_filter method to build filter conditions for querying components with specific tags
 feat(store.py): add build_filter_conditions method to build filter conditions for querying components with various filters
 feat(store.py): modify query_components method to accept filter_conditions parameter for querying components with filters
🔧 chore(utils.py): reorder imports in get_factories_and_deps function
🔧 chore(utils.py): reorder imports in initialize_session_service function
2023-11-14 15:22:12 -03:00
Gabriel Luiz Freitas Almeida
887badcf72 🔧 chore(service.py): remove unused code and add logging for webhook failures in StoreService class 2023-11-14 14:53:39 -03:00
Gabriel Luiz Freitas Almeida
dfcee85374 🔥 refactor(store.py): remove unused imports and commented out code
🔒 chore(store.py): pass 'liked' parameter to 'update_components_with_user_data' function to improve code readability and maintainability
2023-11-14 14:53:32 -03:00
Gabriel Luiz Freitas Almeida
bd4e88273b 🐛 fix(store.py): change filter_by_user parameter name to liked to improve semantics and clarity
 feat(store.py): add support for filtering components by liked status to get_components function
🐛 fix(store.py): remove in_user_collection attribute from ListComponentResponse schema as it is not used
🐛 fix(service.py): change _get method signature to accept Optional parameters and add type hints
 feat(service.py): add build_tags_filter method to build the tags filter for get_components function
🐛 fix(service.py): remove filter_by_user parameter from count_components function and adjust logic accordingly
 feat(service.py): add liked parameter to get_components function to filter components by liked status
🐛 fix(service.py): change get_components_in_users_collection method parameter type from List[UUID] to List[str]
🐛 fix(service.py): change download method parameter type from str to UUID
🐛 fix(utils.py): change update_components_with_user_data function parameter type from List["ListComponentResponse"] to List[ListComponentResponse]
2023-11-14 14:47:02 -03:00
Gabriel Luiz Freitas Almeida
e4d8687a09 ruff format 2023-11-13 18:32:34 -03:00
Gabriel Luiz Freitas Almeida
0cd1fcdcbd 🔧 fix(store.py): add type hints to improve code readability and maintainability
🚀 feat(store.py): add support for pagination in get_components endpoint to limit the number of results returned
🔧 fix(store.py): fix count_components endpoint to handle cases where the number of results is less than the limit
2023-11-13 18:04:48 -03:00
Gabriel Luiz Freitas Almeida
564eef87c9 Refactor main.py to include middleware for
flattening query string lists.
2023-11-13 18:04:29 -03:00
Gabriel Luiz Freitas Almeida
ef0d4e6f87 Refactor schema.py to import List and Optional
from typing.
2023-11-13 18:04:02 -03:00
Gabriel Luiz Freitas Almeida
29409aec51 Refactored tag filtering in StoreService 2023-11-13 18:03:13 -03:00
Gabriel Luiz Freitas Almeida
bc9f3f20d8 Fix user_data context setting in StoreService 2023-11-13 14:58:24 -03:00
Gabriel Luiz Freitas Almeida
6067c324fb Handle HTTPStatusError in get_components function 2023-11-13 14:54:05 -03:00
Gabriel Luiz Freitas Almeida
afe9c9d1f4 Fix user_data_context function to handle missing
api_key
2023-11-13 14:53:40 -03:00
Gabriel Luiz Freitas Almeida
805ec1570d Add typing to get_components function and refactor
count_components to accept filter_conditions
2023-11-13 12:31:10 -03:00
Gabriel Luiz Freitas Almeida
b972e1a2de 🔀 refactor(utils.py): import List from typing module to improve code readability and maintainability
🔀 refactor(utils.py): update type hint for components parameter to use List instead of "ListComponentResponse" to improve code clarity and consistency
2023-11-13 12:31:09 -03:00
anovazzi1
6e065ddb28 update chain process to remove code if if there is any 2023-11-13 11:45:24 -03:00
Gabriel Luiz Freitas Almeida
0f894da75e 🐛 fix(store.py): handle HTTPStatusError when querying components and raise appropriate exceptions
 feat(store.py): add support for user_data_context to fetch and set user data to the context variable
🐛 fix(store.py): handle HTTPStatusError when fetching user data and raise ValueError for invalid API key
🐛 fix(service.py): handle HTTPStatusError when fetching user data and raise ValueError for invalid API key
🐛 fix(service.py): return count as int in count_components method
2023-11-13 11:31:07 -03:00
Gabriel Luiz Freitas Almeida
f6bc5c82a9 🔧 chore(store.py): add temporary code to handle exception and set comp_count to 0 until bug is fixed 2023-11-08 16:09:20 -03:00
Gabriel Luiz Freitas Almeida
f323bc4d8a 🐛 fix(store.py): handle exception when counting components to prevent potential errors and set comp_count to 0 in case of exception 2023-11-08 16:08:50 -03:00
Gabriel Luiz Freitas Almeida
955ba95eb3 🐛 fix(store.py): fix variable name to improve code readability and semantics
The variable `result` is updated with the value of `updated_result` after calling the `update_components_with_user_data` function. This change improves code readability and makes the intention clearer.
2023-11-08 16:05:33 -03:00
Gabriel Luiz Freitas Almeida
086681312e 🔄 refactor(store.py): change the type of the 'search' query parameter from List[str] to str for consistency and clarity 2023-11-08 15:34:58 -03:00
Gabriel Luiz Freitas Almeida
09ddf22d74 Add API endpoint to check if store has API key 2023-11-07 21:09:50 -03:00
Gabriel Luiz Freitas Almeida
f9b57f90a7 🔧 fix(store.py): rename list_components function to get_components to improve semantics and clarity
🔧 fix(service.py): add search, status, tags, and sort parameters to query_components function to enable filtering and sorting of components
 feat(service.py): add build_search_filter_conditions method to build filter conditions for search query in query_components function
2023-11-07 15:42:54 -03:00
Gabriel Luiz Freitas Almeida
cd71943b43 Refactor API response model and add filter
conditions to list_components and count_components
methods
2023-11-06 22:39:31 -03:00
Gabriel Luiz Freitas Almeida
7ca750bbde 🔧 fix(store.py): add support for filtering components based on is_component parameter in count_components function
🔧 fix(service.py): add support for filtering components based on is_component parameter in StoreService.count_components method
2023-11-02 09:37:41 -03:00
Gabriel Luiz Freitas Almeida
0c90c12c94 🔍 refactor(store.py): add support for filtering components based on is_component flag in list_components function
🔍 refactor(service.py): add support for filtering components based on is_component flag in get_components function
2023-11-02 09:34:02 -03:00
Gabriel Luiz Freitas Almeida
1f5ad28243 🔧 chore(schema.py): add 'last_tested_version' field to ComponentResponse and ListComponentResponse models for better tracking of component versions
🔧 chore(service.py): include 'last_tested_version' field in the list of fields to retrieve from the store API for better tracking of component versions
2023-11-01 11:44:59 -03:00
Gabriel Luiz Freitas Almeida
4e0273a9df 🐛 fix(service.py): add error handling for HTTP response in StoreService to improve reliability and prevent silent failures 2023-11-01 10:17:44 -03:00
anovazzi1
4310229c2f fix(market-card.tsx): fix logic for updating likes_count and liked_by_user state variables
The logic for updating the `likes_count` and `liked_by_user` state variables in the `handleLike` function was incorrect. This commit fixes the logic to correctly update the state variables based on the previous values. Additionally, it adds error handling for the `postLikeComponent` API call and sets the `likes_count` and `liked_by_user` state variables to their previous values in case of an error.
2023-11-01 10:14:48 -03:00
Gabriel Luiz Freitas Almeida
787a725207 🐛 fix(store.py): remove unnecessary blank line to improve code readability
🐛 fix(service.py): fix incorrect variable name in get_component_likes_count method
🐛 fix(service.py): convert likes count to integer to handle unexpected string values
🐛 fix(service.py): convert component_id to string before sending it in the request payload
2023-11-01 10:03:20 -03:00
Gabriel Luiz Freitas Almeida
85647091f7 🐛 fix(store.py): change return value from dictionary to UsersLikesResponse object to improve readability and maintainability
🐛 fix(service.py): handle case when component is not found and raise ValueError to provide more informative error message
2023-11-01 09:52:58 -03:00
Gabriel Luiz Freitas Almeida
68198bfd41 🐛 fix(store.py): retrieve likes count after liking a component to update the response with the latest count
 feat(schema.py): update UsersLikesResponse model to include likes_count and liked_by_user fields
 feat(service.py): add get_component_likes_count method to retrieve the number of likes for a component
2023-11-01 09:52:57 -03:00
anovazzi1
2c3199ad0b format code 2023-11-01 09:49:10 -03:00
Gabriel Luiz Freitas Almeida
75079731c9 🐛 fix(store.py): fix indentation issue in list_components function to improve code readability
🐛 fix(service.py): remove unused user_data parameter in get_liked_by_user_components function
🐛 fix(utils.py): rename in_users_collection attribute to in_user_collection for consistency
2023-11-01 09:45:42 -03:00
Gabriel Luiz Freitas Almeida
0339072079 🐛 fix(store.py): add missing import for user_data_context and update_components_with_user_data functions
 feat(store.py): add support for user_data_context context manager to fetch and set user data for requests made inside the context
 feat(store.py): add support for in_user_collection attribute in ListComponentResponse schema to indicate if a component is in the user's collection
🐛 fix(store.py): fix get_liked_by_user_components function to use user_data_var context variable instead of making the request multiple times
🐛 fix(store.py): fix get_components_in_users_collection function to use user_data_var context variable instead of making the request multiple times
 feat(store.py): add update_components_with_user_data function to update components with user data (liked_by_user and in_users_collection attributes)
2023-11-01 09:31:50 -03:00
Gabriel Luiz Freitas Almeida
7fc4d54055 🐛 fix(store.py): change type of store_api_Key parameter from str to Optional[str] to handle case when user does not provide an API key 2023-11-01 09:04:46 -03:00
Gabriel Luiz Freitas Almeida
04b047a823 🐛 fix(store.py): fix indentation issue and remove unnecessary comments
🐛 fix(schema.py): remove default value for liked_by_user attribute in ListComponentResponse

The indentation issue in `store.py` was causing the code to execute the wrong logic. The unnecessary comments were removed to improve code readability.

In `schema.py`, the default value for the `liked_by_user` attribute in the `ListComponentResponse` class was removed to ensure that it is only set when needed.
2023-11-01 08:58:21 -03:00
Gabriel Luiz Freitas Almeida
0c728ea58e 🐛 fix(store.py): return result without modification if store_api_Key is not provided to prevent potential errors 2023-10-31 19:59:02 -03:00
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