(row)
| 25 | |
| 26 | @staticmethod |
| 27 | def build(row): |
| 28 | from app.services.tool import list_plugins, get_bundle |
| 29 | |
| 30 | try: |
| 31 | plugins = list_plugins(bundle_id=row["bundle_id"]) |
| 32 | except Exception as e: |
| 33 | plugins = [] |
| 34 | |
| 35 | bundle = get_bundle(row["bundle_id"]) |
| 36 | |
| 37 | return BundleInstance( |
| 38 | bundle_instance_id=row["bundle_instance_id"], |
| 39 | encrypted_credentials=load_json_attr(row, "encrypted_credentials", {}), |
| 40 | display_credentials=load_json_attr(row, "display_credentials", {}), |
| 41 | bundle_id=row["bundle_id"], |
| 42 | name=row["name"], |
| 43 | metadata=load_json_attr(row, "metadata", {}), |
| 44 | plugins=plugins, |
| 45 | description=bundle.description, |
| 46 | icon_url=bundle.icon_url, |
| 47 | created_timestamp=row["created_timestamp"], |
| 48 | updated_timestamp=row["updated_timestamp"], |
| 49 | ) |
| 50 | |
| 51 | def to_response_dict(self, **kwargs) -> Dict: |
| 52 | from app.services.tool import i18n_text |
nothing calls this directly
no test coverage detected