airbyte-agent-zendesk-support 0.18.37__tar.gz → 0.18.38__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/CHANGELOG.md +5 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/PKG-INFO +3 -3
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/README.md +2 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_strategies.py +2 -5
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_template.py +1 -1
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/cloud_utils/client.py +1 -1
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py +1 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/local_executor.py +3 -4
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py +1 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/response.py +2 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/logging/logger.py +9 -9
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/logging/types.py +10 -10
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/config.py +2 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/models.py +6 -6
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/session.py +7 -5
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/metrics.py +3 -3
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/base.py +17 -17
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/components.py +58 -58
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/extensions.py +9 -9
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/operations.py +31 -31
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/security.py +36 -36
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/secrets.py +2 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/events.py +7 -7
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/tracker.py +6 -5
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py +2 -2
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/pyproject.toml +1 -1
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/.gitignore +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/REFERENCE.md +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/cloud_utils/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/constants.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/exceptions.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/hosted_executor.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/models.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/adapters/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/adapters/httpx_adapter.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/config.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/exceptions.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http/protocols.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/http_client.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/introspection.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/logging/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/redactor.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/instrumentation.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/connector.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/__init__.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/config.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/utils.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/_vendored/connector_sdk/validation.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/connector.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/connector_model.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/models.py +0 -0
- {airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/airbyte_agent_zendesk_support/types.py +0 -0
{airbyte_agent_zendesk_support-0.18.37 → airbyte_agent_zendesk_support-0.18.38}/CHANGELOG.md
RENAMED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Zendesk Support changelog
|
|
2
2
|
|
|
3
|
+
## [0.18.38] - 2026-01-14
|
|
4
|
+
- Updated connector definition (YAML version 0.1.4)
|
|
5
|
+
- Source commit: 7ef09816
|
|
6
|
+
- SDK version: 0.1.0
|
|
7
|
+
|
|
3
8
|
## [0.18.37] - 2026-01-14
|
|
4
9
|
- Updated connector definition (YAML version 0.1.4)
|
|
5
10
|
- Source commit: e6285db5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: airbyte-agent-zendesk-support
|
|
3
|
-
Version: 0.18.
|
|
3
|
+
Version: 0.18.38
|
|
4
4
|
Summary: Airbyte Zendesk-Support Connector for AI platforms
|
|
5
5
|
Project-URL: Homepage, https://github.com/airbytehq/airbyte-embedded
|
|
6
6
|
Project-URL: Documentation, https://github.com/airbytehq/airbyte-embedded/tree/main/integrations
|
|
@@ -137,6 +137,6 @@ For the service's official API docs, see the [Zendesk-Support API reference](htt
|
|
|
137
137
|
|
|
138
138
|
## Version information
|
|
139
139
|
|
|
140
|
-
- **Package version:** 0.18.
|
|
140
|
+
- **Package version:** 0.18.38
|
|
141
141
|
- **Connector version:** 0.1.4
|
|
142
|
-
- **Generated with Connector SDK commit SHA:**
|
|
142
|
+
- **Generated with Connector SDK commit SHA:** 7ef098166194d1a23714e586f61ebefe7b4e85dd
|
|
@@ -107,6 +107,6 @@ For the service's official API docs, see the [Zendesk-Support API reference](htt
|
|
|
107
107
|
|
|
108
108
|
## Version information
|
|
109
109
|
|
|
110
|
-
- **Package version:** 0.18.
|
|
110
|
+
- **Package version:** 0.18.38
|
|
111
111
|
- **Connector version:** 0.1.4
|
|
112
|
-
- **Generated with Connector SDK commit SHA:**
|
|
112
|
+
- **Generated with Connector SDK commit SHA:** 7ef098166194d1a23714e586f61ebefe7b4e85dd
|
|
@@ -610,9 +610,7 @@ class OAuth2AuthStrategy(AuthStrategy):
|
|
|
610
610
|
has_refresh_token = bool(secrets.get("refresh_token"))
|
|
611
611
|
|
|
612
612
|
if not has_access_token and not has_refresh_token:
|
|
613
|
-
raise AuthenticationError(
|
|
614
|
-
"Missing OAuth2 credentials. Provide either 'access_token' " "or 'refresh_token' (for refresh-token-only mode)."
|
|
615
|
-
)
|
|
613
|
+
raise AuthenticationError("Missing OAuth2 credentials. Provide either 'access_token' or 'refresh_token' (for refresh-token-only mode).")
|
|
616
614
|
|
|
617
615
|
def can_refresh(self, secrets: OAuth2RefreshSecrets) -> bool:
|
|
618
616
|
"""Check if token refresh is possible.
|
|
@@ -1106,8 +1104,7 @@ class AuthStrategyFactory:
|
|
|
1106
1104
|
strategy = cls._strategies.get(auth_type)
|
|
1107
1105
|
if strategy is None:
|
|
1108
1106
|
raise AuthenticationError(
|
|
1109
|
-
f"Authentication type '{auth_type.value}' is not implemented. "
|
|
1110
|
-
f"Supported types: {', '.join(s.value for s in cls._strategies.keys())}"
|
|
1107
|
+
f"Authentication type '{auth_type.value}' is not implemented. Supported types: {', '.join(s.value for s in cls._strategies.keys())}"
|
|
1111
1108
|
)
|
|
1112
1109
|
return strategy
|
|
1113
1110
|
|
|
@@ -17,7 +17,7 @@ class MissingVariableError(ValueError):
|
|
|
17
17
|
def __init__(self, var_name: str, available_fields: list):
|
|
18
18
|
self.var_name = var_name
|
|
19
19
|
self.available_fields = available_fields
|
|
20
|
-
super().__init__(f"Template variable '${{{var_name}}}' not found in config.
|
|
20
|
+
super().__init__(f"Template variable '${{{var_name}}}' not found in config. Available fields: {available_fields}")
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def apply_template(template: str, values: Dict[str, str]) -> str:
|
|
@@ -149,7 +149,7 @@ class AirbyteCloudClient:
|
|
|
149
149
|
instances = data["instances"]
|
|
150
150
|
|
|
151
151
|
if len(instances) == 0:
|
|
152
|
-
raise ValueError(f"No connector instance found for user '{external_user_id}'
|
|
152
|
+
raise ValueError(f"No connector instance found for user '{external_user_id}' and connector '{connector_definition_id}'")
|
|
153
153
|
|
|
154
154
|
if len(instances) > 1:
|
|
155
155
|
raise ValueError(
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import logging
|
|
5
6
|
import re
|
|
6
7
|
from pathlib import Path
|
|
7
8
|
from typing import Any
|
|
@@ -768,8 +769,6 @@ def _parse_auth_from_openapi(spec: OpenAPIConnector) -> AuthConfig:
|
|
|
768
769
|
options.append(auth_option)
|
|
769
770
|
except Exception as e:
|
|
770
771
|
# Log warning but continue - skip invalid schemes
|
|
771
|
-
import logging
|
|
772
|
-
|
|
773
772
|
logger = logging.getLogger(__name__)
|
|
774
773
|
logger.warning(f"Skipping invalid security scheme '{scheme_name}': {e}")
|
|
775
774
|
continue
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
|
+
import inspect
|
|
6
7
|
import logging
|
|
7
8
|
import os
|
|
8
9
|
import re
|
|
@@ -11,6 +12,7 @@ from collections.abc import AsyncIterator
|
|
|
11
12
|
from typing import Any, Protocol
|
|
12
13
|
from urllib.parse import quote
|
|
13
14
|
|
|
15
|
+
from jinja2 import Environment, StrictUndefined
|
|
14
16
|
from jsonpath_ng import parse as parse_jsonpath
|
|
15
17
|
from opentelemetry import trace
|
|
16
18
|
|
|
@@ -506,8 +508,6 @@ class LocalExecutor:
|
|
|
506
508
|
result = handler.execute_operation(config.entity, action, params)
|
|
507
509
|
|
|
508
510
|
# Check if it's an async generator (download) or awaitable (standard)
|
|
509
|
-
import inspect
|
|
510
|
-
|
|
511
511
|
if inspect.isasyncgen(result):
|
|
512
512
|
# Download operation: return generator directly
|
|
513
513
|
return ExecutionResult(
|
|
@@ -814,7 +814,6 @@ class LocalExecutor:
|
|
|
814
814
|
>>> _substitute_file_field_params("attachments[{attachment_index}].url", {"attachment_index": 0})
|
|
815
815
|
"attachments[0].url"
|
|
816
816
|
"""
|
|
817
|
-
from jinja2 import Environment, StrictUndefined
|
|
818
817
|
|
|
819
818
|
# Use custom delimiters to match OpenAPI path parameter syntax {var}
|
|
820
819
|
# StrictUndefined raises clear error if a template variable is missing
|
|
@@ -1235,7 +1234,7 @@ class LocalExecutor:
|
|
|
1235
1234
|
|
|
1236
1235
|
if missing_fields:
|
|
1237
1236
|
raise MissingParameterError(
|
|
1238
|
-
f"Missing required body fields for {entity}.{action.value}: {missing_fields}.
|
|
1237
|
+
f"Missing required body fields for {entity}.{action.value}: {missing_fields}. Provided parameters: {list(params.keys())}"
|
|
1239
1238
|
)
|
|
1240
1239
|
|
|
1241
1240
|
async def close(self):
|
|
@@ -666,8 +666,7 @@ EXTENSION_REGISTRY = {
|
|
|
666
666
|
"type": "dict[str, str]",
|
|
667
667
|
"required": False,
|
|
668
668
|
"description": (
|
|
669
|
-
"Dictionary mapping field names to JSONPath expressions for extracting metadata "
|
|
670
|
-
"(pagination, request IDs, etc.) from response envelopes"
|
|
669
|
+
"Dictionary mapping field names to JSONPath expressions for extracting metadata (pagination, request IDs, etc.) from response envelopes"
|
|
671
670
|
),
|
|
672
671
|
},
|
|
673
672
|
AIRBYTE_FILE_URL: {
|
|
@@ -80,6 +80,8 @@ class HTTPResponse:
|
|
|
80
80
|
HTTPStatusError: For 4xx or 5xx status codes.
|
|
81
81
|
"""
|
|
82
82
|
if 400 <= self._status_code < 600:
|
|
83
|
+
# NOTE: Import here intentionally to avoid circular import.
|
|
84
|
+
# exceptions.py imports HTTPResponse for type hints.
|
|
83
85
|
from .exceptions import HTTPStatusError
|
|
84
86
|
|
|
85
87
|
raise HTTPStatusError(
|
|
@@ -5,7 +5,7 @@ import json
|
|
|
5
5
|
import time
|
|
6
6
|
import uuid
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from typing import Any, Dict,
|
|
8
|
+
from typing import Any, Dict, Set
|
|
9
9
|
|
|
10
10
|
from .types import LogSession, RequestLog
|
|
11
11
|
|
|
@@ -31,9 +31,9 @@ class RequestLogger:
|
|
|
31
31
|
|
|
32
32
|
def __init__(
|
|
33
33
|
self,
|
|
34
|
-
log_file:
|
|
35
|
-
connector_name:
|
|
36
|
-
max_logs:
|
|
34
|
+
log_file: str | None = None,
|
|
35
|
+
connector_name: str | None = None,
|
|
36
|
+
max_logs: int | None = 10000,
|
|
37
37
|
):
|
|
38
38
|
"""
|
|
39
39
|
Initialize the request logger.
|
|
@@ -99,9 +99,9 @@ class RequestLogger:
|
|
|
99
99
|
method: str,
|
|
100
100
|
url: str,
|
|
101
101
|
path: str,
|
|
102
|
-
headers:
|
|
103
|
-
params:
|
|
104
|
-
body:
|
|
102
|
+
headers: Dict[str, str] | None = None,
|
|
103
|
+
params: Dict[str, Any] | None = None,
|
|
104
|
+
body: Any | None = None,
|
|
105
105
|
) -> str:
|
|
106
106
|
"""
|
|
107
107
|
Log the start of an HTTP request.
|
|
@@ -133,7 +133,7 @@ class RequestLogger:
|
|
|
133
133
|
self,
|
|
134
134
|
request_id: str,
|
|
135
135
|
status_code: int,
|
|
136
|
-
response_body:
|
|
136
|
+
response_body: Any | None = None,
|
|
137
137
|
) -> None:
|
|
138
138
|
"""
|
|
139
139
|
Log a successful HTTP response.
|
|
@@ -176,7 +176,7 @@ class RequestLogger:
|
|
|
176
176
|
self,
|
|
177
177
|
request_id: str,
|
|
178
178
|
error: str,
|
|
179
|
-
status_code:
|
|
179
|
+
status_code: int | None = None,
|
|
180
180
|
) -> None:
|
|
181
181
|
"""
|
|
182
182
|
Log an HTTP request error.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import base64
|
|
4
4
|
from datetime import UTC, datetime
|
|
5
|
-
from typing import Any, Dict, List
|
|
5
|
+
from typing import Any, Dict, List
|
|
6
6
|
|
|
7
7
|
from pydantic import BaseModel, ConfigDict, Field, field_serializer, field_validator
|
|
8
8
|
|
|
@@ -27,12 +27,12 @@ class RequestLog(BaseModel):
|
|
|
27
27
|
url: str
|
|
28
28
|
path: str
|
|
29
29
|
headers: Dict[str, str] = Field(default_factory=dict)
|
|
30
|
-
params:
|
|
31
|
-
body:
|
|
32
|
-
response_status:
|
|
33
|
-
response_body:
|
|
34
|
-
timing_ms:
|
|
35
|
-
error:
|
|
30
|
+
params: Dict[str, Any] | None = None
|
|
31
|
+
body: Any | None = None
|
|
32
|
+
response_status: int | None = None
|
|
33
|
+
response_body: Any | None = None
|
|
34
|
+
timing_ms: float | None = None
|
|
35
|
+
error: str | None = None
|
|
36
36
|
|
|
37
37
|
@field_serializer("timestamp")
|
|
38
38
|
def serialize_datetime(self, value: datetime) -> str:
|
|
@@ -50,9 +50,9 @@ class LogSession(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
session_id: str
|
|
52
52
|
started_at: datetime = Field(default_factory=_utc_now)
|
|
53
|
-
connector_name:
|
|
53
|
+
connector_name: str | None = None
|
|
54
54
|
logs: List[RequestLog] = Field(default_factory=list)
|
|
55
|
-
max_logs:
|
|
55
|
+
max_logs: int | None = Field(
|
|
56
56
|
default=10000,
|
|
57
57
|
description="Maximum number of logs to keep in memory. "
|
|
58
58
|
"When limit is reached, oldest logs should be flushed before removal. "
|
|
@@ -60,7 +60,7 @@ class LogSession(BaseModel):
|
|
|
60
60
|
)
|
|
61
61
|
chunk_logs: List[bytes] = Field(
|
|
62
62
|
default_factory=list,
|
|
63
|
-
description="Captured chunks from streaming responses.
|
|
63
|
+
description="Captured chunks from streaming responses. Each chunk is logged when log_chunk_fetch() is called.",
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
@field_validator("chunk_logs", mode="before")
|
|
@@ -6,7 +6,7 @@ import tempfile
|
|
|
6
6
|
import uuid
|
|
7
7
|
from dataclasses import dataclass, field
|
|
8
8
|
from pathlib import Path
|
|
9
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
10
10
|
|
|
11
11
|
import yaml
|
|
12
12
|
|
|
@@ -53,7 +53,7 @@ def _delete_legacy_files() -> None:
|
|
|
53
53
|
logger.debug(f"Could not delete legacy file {legacy_path}: {e}")
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
def _migrate_legacy_config() ->
|
|
56
|
+
def _migrate_legacy_config() -> SDKConfig | None:
|
|
57
57
|
"""
|
|
58
58
|
Migrate from legacy file-based config to new YAML format.
|
|
59
59
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
from datetime import datetime
|
|
5
|
-
from typing import Any, Dict
|
|
5
|
+
from typing import Any, Dict
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@dataclass
|
|
@@ -12,8 +12,8 @@ class OperationMetadata:
|
|
|
12
12
|
entity: str
|
|
13
13
|
action: str
|
|
14
14
|
timestamp: datetime
|
|
15
|
-
timing_ms:
|
|
16
|
-
status_code:
|
|
17
|
-
error_type:
|
|
18
|
-
error_message:
|
|
19
|
-
params:
|
|
15
|
+
timing_ms: float | None = None
|
|
16
|
+
status_code: int | None = None
|
|
17
|
+
error_type: str | None = None
|
|
18
|
+
error_message: str | None = None
|
|
19
|
+
params: Dict[str, Any] | None = None
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
import uuid
|
|
5
5
|
from datetime import UTC, datetime
|
|
6
|
-
from typing import Any, Dict
|
|
6
|
+
from typing import Any, Dict
|
|
7
7
|
|
|
8
8
|
from .config import SDKConfig, load_config
|
|
9
9
|
|
|
10
10
|
logger = logging.getLogger(__name__)
|
|
11
11
|
|
|
12
12
|
# Cache the config at module level to avoid repeated reads
|
|
13
|
-
_cached_config:
|
|
13
|
+
_cached_config: SDKConfig | None = None
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def _get_config() -> SDKConfig:
|
|
@@ -39,7 +39,7 @@ def get_persistent_user_id() -> str:
|
|
|
39
39
|
return _get_config().user_id
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def get_public_ip() ->
|
|
42
|
+
def get_public_ip() -> str | None:
|
|
43
43
|
"""
|
|
44
44
|
Fetch the public IP address of the user.
|
|
45
45
|
|
|
@@ -47,6 +47,8 @@ def get_public_ip() -> Optional[str]:
|
|
|
47
47
|
Uses httpx for a robust HTTP request to a public IP service.
|
|
48
48
|
"""
|
|
49
49
|
try:
|
|
50
|
+
# NOTE: Import here intentionally - this is a non-critical network call
|
|
51
|
+
# that may fail. Importing at module level would make httpx a hard dependency.
|
|
50
52
|
import httpx
|
|
51
53
|
|
|
52
54
|
# Use a short timeout to avoid blocking
|
|
@@ -77,9 +79,9 @@ class ObservabilitySession:
|
|
|
77
79
|
def __init__(
|
|
78
80
|
self,
|
|
79
81
|
connector_name: str,
|
|
80
|
-
connector_version:
|
|
82
|
+
connector_version: str | None = None,
|
|
81
83
|
execution_context: str = "direct",
|
|
82
|
-
session_id:
|
|
84
|
+
session_id: str | None = None,
|
|
83
85
|
):
|
|
84
86
|
self.session_id = session_id or str(uuid.uuid4())
|
|
85
87
|
self.user_id = get_persistent_user_id()
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import time
|
|
4
4
|
from contextlib import asynccontextmanager
|
|
5
|
-
from typing import Dict
|
|
5
|
+
from typing import Dict
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class PerformanceMonitor:
|
|
@@ -33,7 +33,7 @@ class PerformanceMonitor:
|
|
|
33
33
|
metrics["min"] = min(metrics["min"], duration)
|
|
34
34
|
metrics["max"] = max(metrics["max"], duration)
|
|
35
35
|
|
|
36
|
-
def get_stats(self, metric_name: str) ->
|
|
36
|
+
def get_stats(self, metric_name: str) -> Dict[str, float] | None:
|
|
37
37
|
"""Get statistics for a metric.
|
|
38
38
|
|
|
39
39
|
Args:
|
|
@@ -62,7 +62,7 @@ class PerformanceMonitor:
|
|
|
62
62
|
"""
|
|
63
63
|
return {name: self.get_stats(name) for name in self._metrics.keys()}
|
|
64
64
|
|
|
65
|
-
def reset(self, metric_name:
|
|
65
|
+
def reset(self, metric_name: str | None = None):
|
|
66
66
|
"""Reset metrics.
|
|
67
67
|
|
|
68
68
|
Args:
|
|
@@ -7,7 +7,7 @@ References:
|
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
9
|
from enum import StrEnum
|
|
10
|
-
from typing import Dict
|
|
10
|
+
from typing import Dict
|
|
11
11
|
from uuid import UUID
|
|
12
12
|
|
|
13
13
|
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
@@ -45,9 +45,9 @@ class Contact(BaseModel):
|
|
|
45
45
|
|
|
46
46
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
47
47
|
|
|
48
|
-
name:
|
|
49
|
-
url:
|
|
50
|
-
email:
|
|
48
|
+
name: str | None = None
|
|
49
|
+
url: str | None = None
|
|
50
|
+
email: str | None = None
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
class License(BaseModel):
|
|
@@ -60,7 +60,7 @@ class License(BaseModel):
|
|
|
60
60
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
61
61
|
|
|
62
62
|
name: str
|
|
63
|
-
url:
|
|
63
|
+
url: str | None = None
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
class DocUrlType(StrEnum):
|
|
@@ -85,7 +85,7 @@ class DocUrl(BaseModel):
|
|
|
85
85
|
|
|
86
86
|
url: str
|
|
87
87
|
type: DocUrlType
|
|
88
|
-
title:
|
|
88
|
+
title: str | None = None
|
|
89
89
|
|
|
90
90
|
@field_validator("url")
|
|
91
91
|
def validate_url(cls, v):
|
|
@@ -111,17 +111,17 @@ class Info(BaseModel):
|
|
|
111
111
|
|
|
112
112
|
title: str
|
|
113
113
|
version: str
|
|
114
|
-
description:
|
|
115
|
-
terms_of_service:
|
|
116
|
-
contact:
|
|
117
|
-
license:
|
|
114
|
+
description: str | None = None
|
|
115
|
+
terms_of_service: str | None = Field(None, alias="termsOfService")
|
|
116
|
+
contact: Contact | None = None
|
|
117
|
+
license: License | None = None
|
|
118
118
|
|
|
119
119
|
# Airbyte extension
|
|
120
|
-
x_airbyte_connector_name:
|
|
121
|
-
x_airbyte_connector_id:
|
|
120
|
+
x_airbyte_connector_name: str | None = Field(None, alias="x-airbyte-connector-name")
|
|
121
|
+
x_airbyte_connector_id: UUID | None = Field(None, alias="x-airbyte-connector-id")
|
|
122
122
|
x_airbyte_external_documentation_urls: list[DocUrl] = Field(..., alias="x-airbyte-external-documentation-urls")
|
|
123
|
-
x_airbyte_retry_config:
|
|
124
|
-
x_airbyte_example_questions:
|
|
123
|
+
x_airbyte_retry_config: RetryConfig | None = Field(None, alias="x-airbyte-retry-config")
|
|
124
|
+
x_airbyte_example_questions: ExampleQuestions | None = Field(None, alias="x-airbyte-example-questions")
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
class ServerVariable(BaseModel):
|
|
@@ -133,9 +133,9 @@ class ServerVariable(BaseModel):
|
|
|
133
133
|
|
|
134
134
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
135
135
|
|
|
136
|
-
enum:
|
|
136
|
+
enum: list[str] | None = None
|
|
137
137
|
default: str
|
|
138
|
-
description:
|
|
138
|
+
description: str | None = None
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
class Server(BaseModel):
|
|
@@ -148,7 +148,7 @@ class Server(BaseModel):
|
|
|
148
148
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
149
149
|
|
|
150
150
|
url: str
|
|
151
|
-
description:
|
|
151
|
+
description: str | None = None
|
|
152
152
|
variables: Dict[str, ServerVariable] = Field(default_factory=dict)
|
|
153
153
|
|
|
154
154
|
@field_validator("url")
|