airbyte-agent-zendesk-support 0.18.36__py3-none-any.whl → 0.18.44__py3-none-any.whl
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/__init__.py +111 -18
- airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_strategies.py +2 -5
- airbyte_agent_zendesk_support/_vendored/connector_sdk/auth_template.py +1 -1
- airbyte_agent_zendesk_support/_vendored/connector_sdk/cloud_utils/client.py +26 -26
- airbyte_agent_zendesk_support/_vendored/connector_sdk/connector_model_loader.py +1 -2
- airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/hosted_executor.py +10 -11
- airbyte_agent_zendesk_support/_vendored/connector_sdk/executor/local_executor.py +72 -13
- airbyte_agent_zendesk_support/_vendored/connector_sdk/extensions.py +1 -2
- airbyte_agent_zendesk_support/_vendored/connector_sdk/http/response.py +2 -0
- airbyte_agent_zendesk_support/_vendored/connector_sdk/logging/logger.py +9 -9
- airbyte_agent_zendesk_support/_vendored/connector_sdk/logging/types.py +10 -10
- airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/config.py +2 -2
- airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/models.py +6 -6
- airbyte_agent_zendesk_support/_vendored/connector_sdk/observability/session.py +7 -5
- airbyte_agent_zendesk_support/_vendored/connector_sdk/performance/metrics.py +3 -3
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/base.py +21 -18
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/components.py +58 -58
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/connector.py +22 -33
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/extensions.py +103 -10
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/operations.py +31 -31
- airbyte_agent_zendesk_support/_vendored/connector_sdk/schema/security.py +36 -36
- airbyte_agent_zendesk_support/_vendored/connector_sdk/secrets.py +2 -2
- airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/events.py +7 -7
- airbyte_agent_zendesk_support/_vendored/connector_sdk/telemetry/tracker.py +6 -5
- airbyte_agent_zendesk_support/_vendored/connector_sdk/types.py +2 -2
- airbyte_agent_zendesk_support/connector.py +154 -158
- airbyte_agent_zendesk_support/connector_model.py +3 -3
- airbyte_agent_zendesk_support/models.py +21 -69
- {airbyte_agent_zendesk_support-0.18.36.dist-info → airbyte_agent_zendesk_support-0.18.44.dist-info}/METADATA +12 -9
- {airbyte_agent_zendesk_support-0.18.36.dist-info → airbyte_agent_zendesk_support-0.18.44.dist-info}/RECORD +31 -31
- {airbyte_agent_zendesk_support-0.18.36.dist-info → airbyte_agent_zendesk_support-0.18.44.dist-info}/WHEEL +0 -0
|
@@ -12,9 +12,9 @@ to Operation, Schema, or other models when their respective features
|
|
|
12
12
|
are implemented.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
from typing import Literal
|
|
15
|
+
from typing import Literal
|
|
16
16
|
|
|
17
|
-
from pydantic import BaseModel, ConfigDict
|
|
17
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class PaginationConfig(BaseModel):
|
|
@@ -33,22 +33,22 @@ class PaginationConfig(BaseModel):
|
|
|
33
33
|
limit_param: str = "limit"
|
|
34
34
|
|
|
35
35
|
# Cursor-based pagination
|
|
36
|
-
cursor_param:
|
|
37
|
-
cursor_source:
|
|
38
|
-
cursor_path:
|
|
36
|
+
cursor_param: str | None = None
|
|
37
|
+
cursor_source: Literal["body", "headers"] | None = "body"
|
|
38
|
+
cursor_path: str | None = None
|
|
39
39
|
|
|
40
40
|
# Offset-based pagination
|
|
41
|
-
offset_param:
|
|
41
|
+
offset_param: str | None = None
|
|
42
42
|
|
|
43
43
|
# Page-based pagination
|
|
44
|
-
page_param:
|
|
44
|
+
page_param: str | None = None
|
|
45
45
|
|
|
46
46
|
# Response parsing
|
|
47
47
|
data_path: str = "data"
|
|
48
|
-
has_more_path:
|
|
48
|
+
has_more_path: str | None = None
|
|
49
49
|
|
|
50
50
|
# Limits
|
|
51
|
-
max_page_size:
|
|
51
|
+
max_page_size: int | None = None
|
|
52
52
|
default_page_size: int = 100
|
|
53
53
|
|
|
54
54
|
|
|
@@ -66,7 +66,7 @@ class RateLimitConfig(BaseModel):
|
|
|
66
66
|
|
|
67
67
|
max_requests: int
|
|
68
68
|
time_window_seconds: int
|
|
69
|
-
retry_after_header:
|
|
69
|
+
retry_after_header: str | None = "Retry-After"
|
|
70
70
|
respect_retry_after: bool = True
|
|
71
71
|
|
|
72
72
|
|
|
@@ -107,3 +107,96 @@ class RetryConfig(BaseModel):
|
|
|
107
107
|
# Header-based delay extraction
|
|
108
108
|
retry_after_header: str = "Retry-After"
|
|
109
109
|
retry_after_format: Literal["seconds", "milliseconds", "unix_timestamp"] = "seconds"
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class CacheFieldConfig(BaseModel):
|
|
113
|
+
"""
|
|
114
|
+
Field configuration for cache mapping.
|
|
115
|
+
|
|
116
|
+
Defines a single field in a cache entity, with optional name aliasing
|
|
117
|
+
to map between user-facing field names and cache storage names.
|
|
118
|
+
|
|
119
|
+
Used in x-airbyte-cache extension for api_search operations.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
123
|
+
|
|
124
|
+
name: str
|
|
125
|
+
x_airbyte_name: str | None = Field(default=None, alias="x-airbyte-name")
|
|
126
|
+
type: str | list[str]
|
|
127
|
+
description: str
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def cache_name(self) -> str:
|
|
131
|
+
"""Return cache name, falling back to name if alias not specified."""
|
|
132
|
+
return self.x_airbyte_name or self.name
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class CacheEntityConfig(BaseModel):
|
|
136
|
+
"""
|
|
137
|
+
Entity configuration for cache mapping.
|
|
138
|
+
|
|
139
|
+
Defines a cache-enabled entity with its fields and optional name aliasing
|
|
140
|
+
to map between user-facing entity names and cache storage names.
|
|
141
|
+
|
|
142
|
+
Used in x-airbyte-cache extension for api_search operations.
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
146
|
+
|
|
147
|
+
entity: str
|
|
148
|
+
x_airbyte_name: str | None = Field(default=None, alias="x-airbyte-name")
|
|
149
|
+
fields: list[CacheFieldConfig]
|
|
150
|
+
|
|
151
|
+
@property
|
|
152
|
+
def cache_name(self) -> str:
|
|
153
|
+
"""Return cache entity name, falling back to entity if alias not specified."""
|
|
154
|
+
return self.x_airbyte_name or self.entity
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class CacheConfig(BaseModel):
|
|
158
|
+
"""
|
|
159
|
+
Cache configuration extension (x-airbyte-cache).
|
|
160
|
+
|
|
161
|
+
Defines cache-enabled entities and their field mappings for api_search operations.
|
|
162
|
+
Supports optional name aliasing via x-airbyte-name for both entities and fields,
|
|
163
|
+
enabling bidirectional mapping between user-facing names and cache storage names.
|
|
164
|
+
|
|
165
|
+
This extension is added to the Info model and provides field-level mapping for
|
|
166
|
+
search operations that use cached data.
|
|
167
|
+
|
|
168
|
+
Example YAML usage:
|
|
169
|
+
info:
|
|
170
|
+
title: Stripe API
|
|
171
|
+
x-airbyte-cache:
|
|
172
|
+
entities:
|
|
173
|
+
- entity: customers
|
|
174
|
+
stream: customers
|
|
175
|
+
fields:
|
|
176
|
+
- name: email
|
|
177
|
+
type: ["null", "string"]
|
|
178
|
+
description: "Customer email address"
|
|
179
|
+
- name: customer_name
|
|
180
|
+
x-airbyte-name: name
|
|
181
|
+
type: ["null", "string"]
|
|
182
|
+
description: "Customer full name"
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
186
|
+
|
|
187
|
+
entities: list[CacheEntityConfig]
|
|
188
|
+
|
|
189
|
+
def get_entity_mapping(self, user_entity: str) -> CacheEntityConfig | None:
|
|
190
|
+
"""
|
|
191
|
+
Get entity config by user-facing name.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
user_entity: User-facing entity name to look up
|
|
195
|
+
|
|
196
|
+
Returns:
|
|
197
|
+
CacheEntityConfig if found, None otherwise
|
|
198
|
+
"""
|
|
199
|
+
for entity in self.entities:
|
|
200
|
+
if entity.entity == user_entity:
|
|
201
|
+
return entity
|
|
202
|
+
return None
|
|
@@ -6,7 +6,7 @@ References:
|
|
|
6
6
|
- https://spec.openapis.org/oas/v3.1.0#path-item-object
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import Any, Dict, List
|
|
9
|
+
from typing import Any, Dict, List
|
|
10
10
|
|
|
11
11
|
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
12
12
|
|
|
@@ -34,28 +34,28 @@ class Operation(BaseModel):
|
|
|
34
34
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
35
35
|
|
|
36
36
|
# Standard OpenAPI fields
|
|
37
|
-
tags:
|
|
38
|
-
summary:
|
|
39
|
-
description:
|
|
40
|
-
external_docs:
|
|
41
|
-
operation_id:
|
|
42
|
-
parameters:
|
|
43
|
-
request_body:
|
|
37
|
+
tags: List[str] | None = None
|
|
38
|
+
summary: str | None = None
|
|
39
|
+
description: str | None = None
|
|
40
|
+
external_docs: Dict[str, Any] | None = Field(None, alias="externalDocs")
|
|
41
|
+
operation_id: str | None = Field(None, alias="operationId")
|
|
42
|
+
parameters: List[Parameter] | None = None
|
|
43
|
+
request_body: RequestBody | None = Field(None, alias="requestBody")
|
|
44
44
|
responses: Dict[str, Response] = Field(default_factory=dict)
|
|
45
|
-
callbacks:
|
|
46
|
-
deprecated:
|
|
47
|
-
security:
|
|
48
|
-
servers:
|
|
45
|
+
callbacks: Dict[str, Any] | None = None
|
|
46
|
+
deprecated: bool | None = None
|
|
47
|
+
security: List[SecurityRequirement] | None = None
|
|
48
|
+
servers: List[Any] | None = None # Can override root servers
|
|
49
49
|
|
|
50
50
|
# Airbyte extensions
|
|
51
51
|
x_airbyte_entity: str = Field(..., alias="x-airbyte-entity")
|
|
52
52
|
x_airbyte_action: ActionTypeLiteral = Field(..., alias="x-airbyte-action")
|
|
53
|
-
x_airbyte_path_override:
|
|
53
|
+
x_airbyte_path_override: PathOverrideConfig | None = Field(
|
|
54
54
|
None,
|
|
55
55
|
alias="x-airbyte-path-override",
|
|
56
|
-
description=("Override path for HTTP requests when OpenAPI path
|
|
56
|
+
description=("Override path for HTTP requests when OpenAPI path differs from actual endpoint"),
|
|
57
57
|
)
|
|
58
|
-
x_airbyte_record_extractor:
|
|
58
|
+
x_airbyte_record_extractor: str | None = Field(
|
|
59
59
|
None,
|
|
60
60
|
alias="x-airbyte-record-extractor",
|
|
61
61
|
description=(
|
|
@@ -65,7 +65,7 @@ class Operation(BaseModel):
|
|
|
65
65
|
"get/create/update/delete actions."
|
|
66
66
|
),
|
|
67
67
|
)
|
|
68
|
-
x_airbyte_meta_extractor:
|
|
68
|
+
x_airbyte_meta_extractor: Dict[str, str] | None = Field(
|
|
69
69
|
None,
|
|
70
70
|
alias="x-airbyte-meta-extractor",
|
|
71
71
|
description=(
|
|
@@ -76,8 +76,8 @@ class Operation(BaseModel):
|
|
|
76
76
|
"Example: {'pagination': '$.pagination', 'request_id': '$.requestId'}"
|
|
77
77
|
),
|
|
78
78
|
)
|
|
79
|
-
x_airbyte_file_url:
|
|
80
|
-
x_airbyte_untested:
|
|
79
|
+
x_airbyte_file_url: str | None = Field(None, alias="x-airbyte-file-url")
|
|
80
|
+
x_airbyte_untested: bool | None = Field(
|
|
81
81
|
None,
|
|
82
82
|
alias="x-airbyte-untested",
|
|
83
83
|
description=(
|
|
@@ -127,20 +127,20 @@ class PathItem(BaseModel):
|
|
|
127
127
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
128
128
|
|
|
129
129
|
# Common fields for all operations
|
|
130
|
-
summary:
|
|
131
|
-
description:
|
|
132
|
-
servers:
|
|
133
|
-
parameters:
|
|
130
|
+
summary: str | None = None
|
|
131
|
+
description: str | None = None
|
|
132
|
+
servers: List[Any] | None = None
|
|
133
|
+
parameters: List[Parameter] | None = None
|
|
134
134
|
|
|
135
135
|
# HTTP methods (all optional)
|
|
136
|
-
get:
|
|
137
|
-
put:
|
|
138
|
-
post:
|
|
139
|
-
delete:
|
|
140
|
-
options:
|
|
141
|
-
head:
|
|
142
|
-
patch:
|
|
143
|
-
trace:
|
|
136
|
+
get: Operation | None = None
|
|
137
|
+
put: Operation | None = None
|
|
138
|
+
post: Operation | None = None
|
|
139
|
+
delete: Operation | None = None
|
|
140
|
+
options: Operation | None = None
|
|
141
|
+
head: Operation | None = None
|
|
142
|
+
patch: Operation | None = None
|
|
143
|
+
trace: Operation | None = None
|
|
144
144
|
|
|
145
145
|
# Reference support
|
|
146
|
-
ref:
|
|
146
|
+
ref: str | None = Field(None, alias="$ref")
|
|
@@ -6,7 +6,7 @@ References:
|
|
|
6
6
|
- https://spec.openapis.org/oas/v3.1.0#oauth-flows-object
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import Any, Dict, List, Literal
|
|
9
|
+
from typing import Any, Dict, List, Literal
|
|
10
10
|
|
|
11
11
|
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
|
|
12
12
|
|
|
@@ -20,9 +20,9 @@ class OAuth2Flow(BaseModel):
|
|
|
20
20
|
|
|
21
21
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
22
22
|
|
|
23
|
-
authorization_url:
|
|
24
|
-
token_url:
|
|
25
|
-
refresh_url:
|
|
23
|
+
authorization_url: str | None = Field(None, alias="authorizationUrl")
|
|
24
|
+
token_url: str | None = Field(None, alias="tokenUrl")
|
|
25
|
+
refresh_url: str | None = Field(None, alias="refreshUrl")
|
|
26
26
|
scopes: Dict[str, str] = Field(default_factory=dict)
|
|
27
27
|
|
|
28
28
|
|
|
@@ -35,10 +35,10 @@ class OAuth2Flows(BaseModel):
|
|
|
35
35
|
|
|
36
36
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
37
37
|
|
|
38
|
-
implicit:
|
|
39
|
-
password:
|
|
40
|
-
client_credentials:
|
|
41
|
-
authorization_code:
|
|
38
|
+
implicit: OAuth2Flow | None = None
|
|
39
|
+
password: OAuth2Flow | None = None
|
|
40
|
+
client_credentials: OAuth2Flow | None = Field(None, alias="clientCredentials")
|
|
41
|
+
authorization_code: OAuth2Flow | None = Field(None, alias="authorizationCode")
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
class AuthConfigFieldSpec(BaseModel):
|
|
@@ -51,12 +51,12 @@ class AuthConfigFieldSpec(BaseModel):
|
|
|
51
51
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
52
52
|
|
|
53
53
|
type: Literal["string", "integer", "boolean", "number"] = "string"
|
|
54
|
-
title:
|
|
55
|
-
description:
|
|
56
|
-
format:
|
|
57
|
-
pattern:
|
|
54
|
+
title: str | None = None
|
|
55
|
+
description: str | None = None
|
|
56
|
+
format: str | None = None # e.g., "email", "uri"
|
|
57
|
+
pattern: str | None = None # Regex validation
|
|
58
58
|
airbyte_secret: bool = Field(False, alias="airbyte_secret")
|
|
59
|
-
default:
|
|
59
|
+
default: Any | None = None
|
|
60
60
|
|
|
61
61
|
|
|
62
62
|
class AuthConfigOption(BaseModel):
|
|
@@ -68,8 +68,8 @@ class AuthConfigOption(BaseModel):
|
|
|
68
68
|
|
|
69
69
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
70
70
|
|
|
71
|
-
title:
|
|
72
|
-
description:
|
|
71
|
+
title: str | None = None
|
|
72
|
+
description: str | None = None
|
|
73
73
|
type: Literal["object"] = "object"
|
|
74
74
|
required: List[str] = Field(default_factory=list)
|
|
75
75
|
properties: Dict[str, AuthConfigFieldSpec] = Field(default_factory=dict)
|
|
@@ -77,7 +77,7 @@ class AuthConfigOption(BaseModel):
|
|
|
77
77
|
default_factory=dict,
|
|
78
78
|
description="Mapping from auth parameters (e.g., 'username', 'password', 'token') to template strings using ${field} syntax",
|
|
79
79
|
)
|
|
80
|
-
replication_auth_key_mapping:
|
|
80
|
+
replication_auth_key_mapping: Dict[str, str] | None = Field(
|
|
81
81
|
None,
|
|
82
82
|
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
83
83
|
)
|
|
@@ -96,21 +96,21 @@ class AirbyteAuthConfig(BaseModel):
|
|
|
96
96
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
97
97
|
|
|
98
98
|
# Single option fields
|
|
99
|
-
title:
|
|
100
|
-
description:
|
|
101
|
-
type:
|
|
102
|
-
required:
|
|
103
|
-
properties:
|
|
104
|
-
auth_mapping:
|
|
99
|
+
title: str | None = None
|
|
100
|
+
description: str | None = None
|
|
101
|
+
type: Literal["object"] | None = None
|
|
102
|
+
required: List[str] | None = None
|
|
103
|
+
properties: Dict[str, AuthConfigFieldSpec] | None = None
|
|
104
|
+
auth_mapping: Dict[str, str] | None = None
|
|
105
105
|
|
|
106
106
|
# Replication connector auth mapping
|
|
107
|
-
replication_auth_key_mapping:
|
|
107
|
+
replication_auth_key_mapping: Dict[str, str] | None = Field(
|
|
108
108
|
None,
|
|
109
109
|
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
# Multiple options (oneOf)
|
|
113
|
-
one_of:
|
|
113
|
+
one_of: List[AuthConfigOption] | None = Field(None, alias="oneOf")
|
|
114
114
|
|
|
115
115
|
@model_validator(mode="after")
|
|
116
116
|
def validate_config_structure(self) -> "AirbyteAuthConfig":
|
|
@@ -161,27 +161,27 @@ class SecurityScheme(BaseModel):
|
|
|
161
161
|
|
|
162
162
|
# Standard OpenAPI fields
|
|
163
163
|
type: Literal["apiKey", "http", "oauth2", "openIdConnect"]
|
|
164
|
-
description:
|
|
164
|
+
description: str | None = None
|
|
165
165
|
|
|
166
166
|
# apiKey specific
|
|
167
|
-
name:
|
|
168
|
-
in_:
|
|
167
|
+
name: str | None = None
|
|
168
|
+
in_: Literal["query", "header", "cookie"] | None = Field(None, alias="in")
|
|
169
169
|
|
|
170
170
|
# http specific
|
|
171
|
-
scheme:
|
|
172
|
-
bearer_format:
|
|
171
|
+
scheme: str | None = None # e.g., "basic", "bearer", "digest"
|
|
172
|
+
bearer_format: str | None = Field(None, alias="bearerFormat")
|
|
173
173
|
|
|
174
174
|
# oauth2 specific
|
|
175
|
-
flows:
|
|
175
|
+
flows: OAuth2Flows | None = None
|
|
176
176
|
|
|
177
177
|
# openIdConnect specific
|
|
178
|
-
open_id_connect_url:
|
|
178
|
+
open_id_connect_url: str | None = Field(None, alias="openIdConnectUrl")
|
|
179
179
|
|
|
180
180
|
# Airbyte extensions
|
|
181
|
-
x_token_path:
|
|
182
|
-
x_token_refresh:
|
|
183
|
-
x_airbyte_auth_config:
|
|
184
|
-
x_airbyte_token_extract:
|
|
181
|
+
x_token_path: str | None = Field(None, alias="x-airbyte-token-path")
|
|
182
|
+
x_token_refresh: Dict[str, Any] | None = Field(None, alias="x-airbyte-token-refresh")
|
|
183
|
+
x_airbyte_auth_config: AirbyteAuthConfig | None = Field(None, alias="x-airbyte-auth-config")
|
|
184
|
+
x_airbyte_token_extract: List[str] | None = Field(
|
|
185
185
|
None,
|
|
186
186
|
alias="x-airbyte-token-extract",
|
|
187
187
|
description="List of fields to extract from OAuth2 token responses and use as server variables",
|
|
@@ -189,7 +189,7 @@ class SecurityScheme(BaseModel):
|
|
|
189
189
|
|
|
190
190
|
@field_validator("x_airbyte_token_extract", mode="after")
|
|
191
191
|
@classmethod
|
|
192
|
-
def validate_token_extract(cls, v:
|
|
192
|
+
def validate_token_extract(cls, v: List[str] | None) -> List[str] | None:
|
|
193
193
|
"""Validate x-airbyte-token-extract has no duplicates."""
|
|
194
194
|
if v is not None:
|
|
195
195
|
if len(v) != len(set(v)):
|
|
@@ -14,7 +14,7 @@ Example:
|
|
|
14
14
|
|
|
15
15
|
import os
|
|
16
16
|
import re
|
|
17
|
-
from typing import Any, Dict
|
|
17
|
+
from typing import Any, Dict
|
|
18
18
|
|
|
19
19
|
from pydantic import SecretStr
|
|
20
20
|
|
|
@@ -72,7 +72,7 @@ class SecretResolutionError(Exception):
|
|
|
72
72
|
def resolve_env_var_references(
|
|
73
73
|
secret_mappings: Dict[str, Any],
|
|
74
74
|
strict: bool = True,
|
|
75
|
-
env_vars:
|
|
75
|
+
env_vars: Dict[str, str] | None = None,
|
|
76
76
|
) -> Dict[str, str]:
|
|
77
77
|
"""Resolve environment variable references in secret values.
|
|
78
78
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from dataclasses import asdict, dataclass, field
|
|
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
|
|
@@ -30,8 +30,8 @@ class ConnectorInitEvent(BaseEvent):
|
|
|
30
30
|
python_version: str
|
|
31
31
|
os_name: str
|
|
32
32
|
os_version: str
|
|
33
|
-
public_ip:
|
|
34
|
-
connector_version:
|
|
33
|
+
public_ip: str | None = None
|
|
34
|
+
connector_version: str | None = None
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
@dataclass
|
|
@@ -42,9 +42,9 @@ class OperationEvent(BaseEvent):
|
|
|
42
42
|
entity: str
|
|
43
43
|
action: str
|
|
44
44
|
timing_ms: float
|
|
45
|
-
public_ip:
|
|
46
|
-
status_code:
|
|
47
|
-
error_type:
|
|
45
|
+
public_ip: str | None = None
|
|
46
|
+
status_code: int | None = None
|
|
47
|
+
error_type: str | None = None
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
@dataclass
|
|
@@ -56,4 +56,4 @@ class SessionEndEvent(BaseEvent):
|
|
|
56
56
|
operation_count: int
|
|
57
57
|
success_count: int
|
|
58
58
|
failure_count: int
|
|
59
|
-
public_ip:
|
|
59
|
+
public_ip: str | None = None
|
|
@@ -4,7 +4,6 @@ import logging
|
|
|
4
4
|
import platform
|
|
5
5
|
import sys
|
|
6
6
|
from datetime import datetime
|
|
7
|
-
from typing import Optional
|
|
8
7
|
|
|
9
8
|
from ..observability import ObservabilitySession
|
|
10
9
|
|
|
@@ -20,7 +19,7 @@ class SegmentTracker:
|
|
|
20
19
|
def __init__(
|
|
21
20
|
self,
|
|
22
21
|
session: ObservabilitySession,
|
|
23
|
-
mode:
|
|
22
|
+
mode: TelemetryMode | None = None,
|
|
24
23
|
):
|
|
25
24
|
self.session = session
|
|
26
25
|
self.mode = mode or TelemetryConfig.get_mode()
|
|
@@ -31,6 +30,8 @@ class SegmentTracker:
|
|
|
31
30
|
|
|
32
31
|
if self.enabled:
|
|
33
32
|
try:
|
|
33
|
+
# NOTE: Import here intentionally - segment is an optional dependency.
|
|
34
|
+
# This allows the SDK to work without telemetry if segment is not installed.
|
|
34
35
|
import segment.analytics as analytics
|
|
35
36
|
|
|
36
37
|
analytics.write_key = SEGMENT_WRITE_KEY
|
|
@@ -47,7 +48,7 @@ class SegmentTracker:
|
|
|
47
48
|
|
|
48
49
|
def track_connector_init(
|
|
49
50
|
self,
|
|
50
|
-
connector_version:
|
|
51
|
+
connector_version: str | None = None,
|
|
51
52
|
) -> None:
|
|
52
53
|
"""Track connector initialization."""
|
|
53
54
|
if not self.enabled or not self._analytics:
|
|
@@ -82,9 +83,9 @@ class SegmentTracker:
|
|
|
82
83
|
self,
|
|
83
84
|
entity: str,
|
|
84
85
|
action: str,
|
|
85
|
-
status_code:
|
|
86
|
+
status_code: int | None,
|
|
86
87
|
timing_ms: float,
|
|
87
|
-
error_type:
|
|
88
|
+
error_type: str | None = None,
|
|
88
89
|
) -> None:
|
|
89
90
|
"""Track API operation."""
|
|
90
91
|
# Always track success/failure counts (useful even when tracking is disabled)
|
|
@@ -140,7 +140,7 @@ class AuthConfig(BaseModel):
|
|
|
140
140
|
ValueError: If this is a multi-auth config or invalid
|
|
141
141
|
"""
|
|
142
142
|
if self.is_multi_auth():
|
|
143
|
-
raise ValueError("Cannot call get_single_option() on multi-auth config.
|
|
143
|
+
raise ValueError("Cannot call get_single_option() on multi-auth config. Use options list instead.")
|
|
144
144
|
|
|
145
145
|
if self.type is None:
|
|
146
146
|
raise ValueError("Invalid AuthConfig: neither single-auth nor multi-auth")
|
|
@@ -161,7 +161,7 @@ class EndpointDefinition(BaseModel):
|
|
|
161
161
|
path: str # e.g., /v1/customers/{id} (OpenAPI path)
|
|
162
162
|
path_override: PathOverrideConfig | None = Field(
|
|
163
163
|
None,
|
|
164
|
-
description=("Path override config from x-airbyte-path-override.
|
|
164
|
+
description=("Path override config from x-airbyte-path-override. When set, overrides the path for actual HTTP requests."),
|
|
165
165
|
)
|
|
166
166
|
action: Action | None = None # Semantic action (get, list, create, update, delete)
|
|
167
167
|
description: str | None = None
|