51 lines
1.9 KiB
Python
51 lines
1.9 KiB
Python
|
|
"""Dynamics365 厂商集成元数据。
|
|||
|
|
|
|||
|
|
定义 ``IntegrationMetadata(key="dynamics365", ...)``,由 ``__init__.py`` 自注册到
|
|||
|
|
``IntegrationRegistry``。元数据为内存态,不持久化到数据库。
|
|||
|
|
"""
|
|||
|
|
|
|||
|
|
from __future__ import annotations
|
|||
|
|
|
|||
|
|
from yuxi.external_systems.integrations.schemas import IntegrationMetadata
|
|||
|
|
|
|||
|
|
DYNAMICS365_METADATA = IntegrationMetadata(
|
|||
|
|
key="dynamics365",
|
|||
|
|
display_name="Microsoft Dynamics 365",
|
|||
|
|
description="基于 OData v4 的企业级 CRM/ERP,覆盖 Dataverse 与 Finance & Operations",
|
|||
|
|
adapter_type="http",
|
|||
|
|
source_types=["dynamics365"],
|
|||
|
|
supported_auth_types=[
|
|||
|
|
"oauth2_authorization_code", # 首期
|
|||
|
|
"oauth2_client_credentials", # 首期
|
|||
|
|
"oauth2_certificate", # P2 延后
|
|||
|
|
"managed_identity", # P2 延后
|
|||
|
|
],
|
|||
|
|
tags=["crm", "erp", "microsoft", "odata"],
|
|||
|
|
icon="dynamics365",
|
|||
|
|
docs_url="https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/overview",
|
|||
|
|
connection_extra_schema={
|
|||
|
|
"type": "object",
|
|||
|
|
"properties": {
|
|||
|
|
"product_line": {
|
|||
|
|
"type": "string",
|
|||
|
|
"enum": ["dataverse", "finance_operations"],
|
|||
|
|
"default": "dataverse",
|
|||
|
|
},
|
|||
|
|
"api_version": {"type": "string", "default": "v9.2"},
|
|||
|
|
"organization": {"type": "string"},
|
|||
|
|
},
|
|||
|
|
"required": ["product_line"],
|
|||
|
|
},
|
|||
|
|
example_config={
|
|||
|
|
"product_line": "dataverse",
|
|||
|
|
"base_url": "https://contoso.api.crm.dynamics.com/api/data/v9.2",
|
|||
|
|
"api_version": "v9.2",
|
|||
|
|
"organization": "contoso",
|
|||
|
|
},
|
|||
|
|
dependency_note=(
|
|||
|
|
"需在 Microsoft Entra ID 注册应用并申请 Dynamics CRM user_impersonation 权限;"
|
|||
|
|
"client_credentials 模式需在 Dataverse 中创建 Application User 并分配安全角色;"
|
|||
|
|
"证书认证需上传 X.509 证书到应用注册;managed_identity 仅在 Azure 资源内可用"
|
|||
|
|
),
|
|||
|
|
)
|