Release Connectors v0.1.21 with external knowledge integration
Module Package Release / publish-packages (push) Successful in 12s
Module Package Release / publish-packages (push) Successful in 12s
This commit is contained in:
@@ -456,10 +456,189 @@ class ConnectorSimulationRun(Base, TimestampMixin):
|
||||
review_reason: Mapped[str | None] = mapped_column(Text)
|
||||
|
||||
|
||||
class ConnectorKnowledgeProfile(Base, TimestampMixin):
|
||||
__tablename__ = "connector_knowledge_profiles"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"tenant_id",
|
||||
"configuration_id",
|
||||
name="uq_connector_knowledge_profile_configuration",
|
||||
),
|
||||
Index(
|
||||
"ix_connector_knowledge_profiles_tenant_status",
|
||||
"tenant_id",
|
||||
"status",
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=new_uuid)
|
||||
tenant_id: Mapped[str] = mapped_column(String(36), nullable=False, index=True)
|
||||
configuration_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("connector_configurations.id", ondelete="RESTRICT"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
status: Mapped[str] = mapped_column(
|
||||
String(30), default="active", nullable=False, index=True
|
||||
)
|
||||
product: Mapped[str] = mapped_column(
|
||||
String(50), default="unknown", nullable=False, index=True
|
||||
)
|
||||
product_version: Mapped[str | None] = mapped_column(String(100))
|
||||
desired_maturity: Mapped[str] = mapped_column(
|
||||
String(30), default="read", nullable=False
|
||||
)
|
||||
discovered_maturity: Mapped[str] = mapped_column(
|
||||
String(30), default="discover", nullable=False
|
||||
)
|
||||
source_authority_mode: Mapped[str] = mapped_column(
|
||||
String(40), default="external_mirror", nullable=False
|
||||
)
|
||||
default_visibility: Mapped[str] = mapped_column(
|
||||
String(30), default="restricted", nullable=False
|
||||
)
|
||||
default_acl_tokens: Mapped[list[str]] = mapped_column(
|
||||
JSON, default=list, nullable=False
|
||||
)
|
||||
namespace_mappings: Mapped[list[dict[str, Any]]] = mapped_column(
|
||||
JSON, default=list, nullable=False
|
||||
)
|
||||
capabilities: Mapped[list[str]] = mapped_column(JSON, default=list, nullable=False)
|
||||
discovery_revision: Mapped[str | None] = mapped_column(String(255), index=True)
|
||||
discovery_evidence: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON, default=dict, nullable=False
|
||||
)
|
||||
health_status: Mapped[str] = mapped_column(
|
||||
String(30), default="unknown", nullable=False, index=True
|
||||
)
|
||||
health_details: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON, default=dict, nullable=False
|
||||
)
|
||||
discovered_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
|
||||
last_sync_cursor: Mapped[str | None] = mapped_column(String(500))
|
||||
last_high_watermark: Mapped[str | None] = mapped_column(String(500))
|
||||
resource_revision: Mapped[int] = mapped_column(Integer, default=1, nullable=False)
|
||||
updated_by: Mapped[str | None] = mapped_column(String(255), index=True)
|
||||
|
||||
|
||||
class ConnectorKnowledgeObject(Base, TimestampMixin):
|
||||
__tablename__ = "connector_knowledge_objects"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"profile_id",
|
||||
"object_type",
|
||||
"external_id",
|
||||
name="uq_connector_knowledge_object_identity",
|
||||
),
|
||||
Index(
|
||||
"ix_connector_knowledge_objects_tenant_profile_status",
|
||||
"tenant_id",
|
||||
"profile_id",
|
||||
"status",
|
||||
),
|
||||
Index(
|
||||
"ix_connector_knowledge_objects_tenant_updated",
|
||||
"tenant_id",
|
||||
"source_updated_at",
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=new_uuid)
|
||||
tenant_id: Mapped[str] = mapped_column(String(36), nullable=False, index=True)
|
||||
profile_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("connector_knowledge_profiles.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
object_type: Mapped[str] = mapped_column(String(40), nullable=False, index=True)
|
||||
external_id: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
external_page_id: Mapped[str | None] = mapped_column(String(255), index=True)
|
||||
external_revision_id: Mapped[str | None] = mapped_column(String(255), index=True)
|
||||
namespace_id: Mapped[int | None] = mapped_column(Integer, index=True)
|
||||
title: Mapped[str] = mapped_column(String(500), nullable=False)
|
||||
canonical_url: Mapped[str | None] = mapped_column(String(1500))
|
||||
status: Mapped[str] = mapped_column(
|
||||
String(30), default="active", nullable=False, index=True
|
||||
)
|
||||
redirect_target_external_id: Mapped[str | None] = mapped_column(String(255))
|
||||
source_revision: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
content_hash: Mapped[str] = mapped_column(String(64), nullable=False, index=True)
|
||||
visibility: Mapped[str] = mapped_column(
|
||||
String(30), default="restricted", nullable=False
|
||||
)
|
||||
acl_tokens: Mapped[list[str]] = mapped_column(JSON, default=list, nullable=False)
|
||||
mapped_data: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON, default=dict, nullable=False
|
||||
)
|
||||
provenance: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON, default=dict, nullable=False
|
||||
)
|
||||
change_cursor: Mapped[str | None] = mapped_column(String(500), index=True)
|
||||
source_updated_at: Mapped[datetime | None] = mapped_column(
|
||||
DateTime(timezone=True), index=True
|
||||
)
|
||||
observed_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False, index=True
|
||||
)
|
||||
resource_revision: Mapped[int] = mapped_column(Integer, default=1, nullable=False)
|
||||
|
||||
|
||||
class ConnectorKnowledgeSyncRun(Base, TimestampMixin):
|
||||
__tablename__ = "connector_knowledge_sync_runs"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"tenant_id",
|
||||
"profile_id",
|
||||
"mode",
|
||||
"idempotency_key",
|
||||
name="uq_connector_knowledge_sync_run_idempotency",
|
||||
),
|
||||
Index(
|
||||
"ix_connector_knowledge_sync_runs_profile_started",
|
||||
"tenant_id",
|
||||
"profile_id",
|
||||
"started_at",
|
||||
),
|
||||
)
|
||||
|
||||
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=new_uuid)
|
||||
tenant_id: Mapped[str] = mapped_column(String(36), nullable=False, index=True)
|
||||
profile_id: Mapped[str] = mapped_column(
|
||||
ForeignKey("connector_knowledge_profiles.id", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
mode: Mapped[str] = mapped_column(String(40), nullable=False, index=True)
|
||||
idempotency_key: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
request_hash: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
status: Mapped[str] = mapped_column(String(30), nullable=False, index=True)
|
||||
cursor_before: Mapped[str | None] = mapped_column(String(500))
|
||||
cursor_after: Mapped[str | None] = mapped_column(String(500))
|
||||
high_watermark: Mapped[str | None] = mapped_column(String(500))
|
||||
counts: Mapped[dict[str, Any]] = mapped_column(JSON, default=dict, nullable=False)
|
||||
effects: Mapped[list[dict[str, Any]]] = mapped_column(
|
||||
JSON, default=list, nullable=False
|
||||
)
|
||||
diagnostics: Mapped[list[dict[str, Any]]] = mapped_column(
|
||||
JSON, default=list, nullable=False
|
||||
)
|
||||
provenance: Mapped[dict[str, Any]] = mapped_column(
|
||||
JSON, default=dict, nullable=False
|
||||
)
|
||||
created_by: Mapped[str | None] = mapped_column(String(255), index=True)
|
||||
started_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), nullable=False, index=True
|
||||
)
|
||||
finished_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
|
||||
|
||||
|
||||
__all__ = [
|
||||
"ConnectorConfiguration",
|
||||
"ConnectorDefinition",
|
||||
"ConnectorDefinitionRevision",
|
||||
"ConnectorKnowledgeObject",
|
||||
"ConnectorKnowledgeProfile",
|
||||
"ConnectorKnowledgeSyncRun",
|
||||
"ConnectorSanctionsAcquisitionRun",
|
||||
"ConnectorSanctionsSnapshot",
|
||||
"ConnectorSimulationRun",
|
||||
|
||||
Reference in New Issue
Block a user