This commit adds the necessary files to implement the store service in langflow. The store service allows searching, getting, posting, and downloading components from the store. The store service is integrated with a Directus instance.
The following files were added:
- `src/backend/langflow/services/store/__init__.py`: Initializes the store service.
- `src/backend/langflow/services/store/factory.py`: Implements the store service factory.
- `src/backend/langflow/services/store/schema.py`: Defines the schema for the component response.
- `src/backend/langflow/services/store/service.py`: Implements the store service, including methods for searching, listing components, downloading, and uploading components.
The store service requires the `SettingsService` to be passed during initialization. The base URL and components URL are retrieved from the `MARKETPLACE_URL` setting.
The store service provides the following methods:
- `search`: Searches for components in the store based on various parameters.
- `list_components`: Lists components from the store.
- `download`: Downloads a specific component from the store.
- `upload`: Uploads a new component to the store.
The store service uses the `httpx` library to perform HTTP requests to the store API. The `_get` method is a utility method to perform GET requests with optional API key and parameters.
The `ComponentResponse` schema defines the structure of the component response from the store. It includes various properties such as name, description, id, status, sort, user_created, date_created, user_updated, date_updated, is_component, likes, tags, data, and documentation.
The `get_api_key` method is not implemented and will be completed in a future commit.
feat(typesContext.tsx): add support for generating unique display names for custom components in typesContext.tsx
fix(nodeToolbarComponent/index.tsx): fix issue with saving component data by cloning the data object before saving
feat(utils.ts): add getSetFromObject function to get a set of keys from an object
fix(reactflowUtils.ts): update expandGroupNode function to correctly iterate over flowEdges instead of ReactFlowInstance.getEdges() to redirect edges to correct proxy node
fix(reactflowUtils): add missing return statement in updateIds function
feat(nodeToolbarComponent): update expandGroupNode function to update ids of proxy nodes and edges before expanding group node
feat(tabsContext.tsx): change the order of arguments in addFlow function call to improve readability
feat(exportModal/index.tsx): add alertContext and setNoticeData to display a warning when saving a file with API keys
feat(exportModal/index.tsx): add a caution message to inform users about the consequences of saving with API keys
🔥 chore(field_typing): remove unused base.py file as it is no longer needed
🔀 chore(constants): update import statements and add type aliases for better readability and maintainability
🔧 fix(custom_component.py): fix argument type in return statement of CustomComponent.get_args()
🔧 fix(custom_components.py): make description attribute optional in CustomComponentFrontendNode class
🔀 chore(field_typing): add support for Data type in field_typing/base.py
🔀 chore(field_typing): add constants.py file to define supported types in field_typing
🔀 chore(interface/custom): remove duplicate imports and use field_typing types
🔀 chore(utils): fix syntax error in get_base_classes function
fix(typesContext.tsx): update deleteComponent implementation to use id parameter for localStorage key
fix(sideBarDraggableComponent/index.tsx): update deleteComponent function call to include id parameter for better data management
fix(extraSidebarComponent/index.tsx): set official property of component to false if it is explicitly set to false
fix(sideBarDraggableComponent/index.tsx): add official property to SidebarDraggableComponent props and use it to conditionally render delete option in SelectItem
fix(api/index.ts): add official property to APIClassType to indicate if it is an official API