feat(integration): improve (#2199)

# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
This commit is contained in:
Stan Girard 2024-02-16 11:32:13 -08:00 committed by GitHub
parent 1099d1664f
commit ef6ee14440
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from enum import Enum
from typing import Optional
from uuid import UUID
@ -14,6 +15,11 @@ from pydantic import BaseModel, Extra
logger = get_logger(__name__)
class IntegrationType(str, Enum):
CUSTOM = "custom"
SYNC = "sync"
class CreateApiBrainDefinition(BaseModel, extra=Extra.forbid):
method: ApiBrainAllowedMethods
url: str
@ -28,6 +34,9 @@ class CreateIntegrationBrain(BaseModel, extra=Extra.forbid):
integration_name: str
integration_logo_url: str
connection_settings: dict
integration_type: IntegrationType
description: str
max_files: int
class BrainIntegrationSettings(BaseModel, extra=Extra.forbid):

View File

@ -1,6 +1,7 @@
from typing import Optional
from uuid import UUID
from modules.brain.dto.inputs import IntegrationType
from pydantic import BaseModel
@ -9,6 +10,9 @@ class IntegrationDescriptionEntity(BaseModel):
integration_name: str
integration_logo_url: Optional[str] = None
connection_settings: Optional[dict] = None
integration_type: IntegrationType
description: str
max_files: int
class IntegrationEntity(BaseModel):

View File

@ -0,0 +1,7 @@
create type "public"."integration_type" as enum ('custom', 'sync');
alter table "public"."integrations" add column "description" text not null default 'Default description'::text;
alter table "public"."integrations" add column "integration_type" integration_type not null default 'custom'::integration_type;
alter table "public"."integrations" add column "max_files" integer not null default 0;