airbyte-agent-hubspot 0.15.28__py3-none-any.whl → 0.15.43__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_hubspot/__init__.py +101 -26
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_strategies.py +2 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_template.py +1 -1
- airbyte_agent_hubspot/_vendored/connector_sdk/cloud_utils/client.py +26 -26
- airbyte_agent_hubspot/_vendored/connector_sdk/connector_model_loader.py +11 -4
- airbyte_agent_hubspot/_vendored/connector_sdk/constants.py +1 -1
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/hosted_executor.py +10 -11
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/local_executor.py +126 -17
- airbyte_agent_hubspot/_vendored/connector_sdk/extensions.py +43 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/http/response.py +2 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/introspection.py +262 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/logger.py +9 -9
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/types.py +10 -10
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/config.py +179 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/models.py +6 -6
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/session.py +41 -32
- airbyte_agent_hubspot/_vendored/connector_sdk/performance/metrics.py +3 -3
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/base.py +20 -18
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/components.py +59 -58
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/connector.py +22 -33
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/extensions.py +103 -10
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/operations.py +32 -32
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/security.py +44 -34
- airbyte_agent_hubspot/_vendored/connector_sdk/secrets.py +2 -2
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/events.py +9 -8
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/tracker.py +9 -5
- airbyte_agent_hubspot/_vendored/connector_sdk/types.py +7 -3
- airbyte_agent_hubspot/connector.py +182 -87
- airbyte_agent_hubspot/connector_model.py +17 -12
- airbyte_agent_hubspot/models.py +28 -28
- airbyte_agent_hubspot/types.py +45 -45
- {airbyte_agent_hubspot-0.15.28.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/METADATA +16 -17
- {airbyte_agent_hubspot-0.15.28.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/RECORD +34 -32
- {airbyte_agent_hubspot-0.15.28.dist-info → airbyte_agent_hubspot-0.15.43.dist-info}/WHEEL +0 -0
|
@@ -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,6 +77,10 @@ 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: Dict[str, str] | None = Field(
|
|
81
|
+
None,
|
|
82
|
+
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
83
|
+
)
|
|
80
84
|
|
|
81
85
|
|
|
82
86
|
class AirbyteAuthConfig(BaseModel):
|
|
@@ -92,15 +96,21 @@ class AirbyteAuthConfig(BaseModel):
|
|
|
92
96
|
model_config = ConfigDict(populate_by_name=True, extra="forbid")
|
|
93
97
|
|
|
94
98
|
# Single option fields
|
|
95
|
-
title:
|
|
96
|
-
description:
|
|
97
|
-
type:
|
|
98
|
-
required:
|
|
99
|
-
properties:
|
|
100
|
-
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
|
+
|
|
106
|
+
# Replication connector auth mapping
|
|
107
|
+
replication_auth_key_mapping: Dict[str, str] | None = Field(
|
|
108
|
+
None,
|
|
109
|
+
description="Mapping from source config paths (e.g., 'credentials.api_key') to auth config keys for direct connectors",
|
|
110
|
+
)
|
|
101
111
|
|
|
102
112
|
# Multiple options (oneOf)
|
|
103
|
-
one_of:
|
|
113
|
+
one_of: List[AuthConfigOption] | None = Field(None, alias="oneOf")
|
|
104
114
|
|
|
105
115
|
@model_validator(mode="after")
|
|
106
116
|
def validate_config_structure(self) -> "AirbyteAuthConfig":
|
|
@@ -151,27 +161,27 @@ class SecurityScheme(BaseModel):
|
|
|
151
161
|
|
|
152
162
|
# Standard OpenAPI fields
|
|
153
163
|
type: Literal["apiKey", "http", "oauth2", "openIdConnect"]
|
|
154
|
-
description:
|
|
164
|
+
description: str | None = None
|
|
155
165
|
|
|
156
166
|
# apiKey specific
|
|
157
|
-
name:
|
|
158
|
-
in_:
|
|
167
|
+
name: str | None = None
|
|
168
|
+
in_: Literal["query", "header", "cookie"] | None = Field(None, alias="in")
|
|
159
169
|
|
|
160
170
|
# http specific
|
|
161
|
-
scheme:
|
|
162
|
-
bearer_format:
|
|
171
|
+
scheme: str | None = None # e.g., "basic", "bearer", "digest"
|
|
172
|
+
bearer_format: str | None = Field(None, alias="bearerFormat")
|
|
163
173
|
|
|
164
174
|
# oauth2 specific
|
|
165
|
-
flows:
|
|
175
|
+
flows: OAuth2Flows | None = None
|
|
166
176
|
|
|
167
177
|
# openIdConnect specific
|
|
168
|
-
open_id_connect_url:
|
|
178
|
+
open_id_connect_url: str | None = Field(None, alias="openIdConnectUrl")
|
|
169
179
|
|
|
170
180
|
# Airbyte extensions
|
|
171
|
-
x_token_path:
|
|
172
|
-
x_token_refresh:
|
|
173
|
-
x_airbyte_auth_config:
|
|
174
|
-
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(
|
|
175
185
|
None,
|
|
176
186
|
alias="x-airbyte-token-extract",
|
|
177
187
|
description="List of fields to extract from OAuth2 token responses and use as server variables",
|
|
@@ -179,7 +189,7 @@ class SecurityScheme(BaseModel):
|
|
|
179
189
|
|
|
180
190
|
@field_validator("x_airbyte_token_extract", mode="after")
|
|
181
191
|
@classmethod
|
|
182
|
-
def validate_token_extract(cls, v:
|
|
192
|
+
def validate_token_extract(cls, v: List[str] | None) -> List[str] | None:
|
|
183
193
|
"""Validate x-airbyte-token-extract has no duplicates."""
|
|
184
194
|
if v is not None:
|
|
185
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
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"""Telemetry event models."""
|
|
2
2
|
|
|
3
|
-
from dataclasses import asdict, dataclass
|
|
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
|
|
@@ -13,6 +13,7 @@ class BaseEvent:
|
|
|
13
13
|
session_id: str
|
|
14
14
|
user_id: str
|
|
15
15
|
execution_context: str
|
|
16
|
+
is_internal_user: bool = field(default=False, kw_only=True)
|
|
16
17
|
|
|
17
18
|
def to_dict(self) -> Dict[str, Any]:
|
|
18
19
|
"""Convert event to dictionary with ISO formatted timestamp."""
|
|
@@ -29,8 +30,8 @@ class ConnectorInitEvent(BaseEvent):
|
|
|
29
30
|
python_version: str
|
|
30
31
|
os_name: str
|
|
31
32
|
os_version: str
|
|
32
|
-
public_ip:
|
|
33
|
-
connector_version:
|
|
33
|
+
public_ip: str | None = None
|
|
34
|
+
connector_version: str | None = None
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
@dataclass
|
|
@@ -41,9 +42,9 @@ class OperationEvent(BaseEvent):
|
|
|
41
42
|
entity: str
|
|
42
43
|
action: str
|
|
43
44
|
timing_ms: float
|
|
44
|
-
public_ip:
|
|
45
|
-
status_code:
|
|
46
|
-
error_type:
|
|
45
|
+
public_ip: str | None = None
|
|
46
|
+
status_code: int | None = None
|
|
47
|
+
error_type: str | None = None
|
|
47
48
|
|
|
48
49
|
|
|
49
50
|
@dataclass
|
|
@@ -55,4 +56,4 @@ class SessionEndEvent(BaseEvent):
|
|
|
55
56
|
operation_count: int
|
|
56
57
|
success_count: int
|
|
57
58
|
failure_count: int
|
|
58
|
-
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:
|
|
@@ -59,6 +60,7 @@ class SegmentTracker:
|
|
|
59
60
|
session_id=self.session.session_id,
|
|
60
61
|
user_id=self.session.user_id,
|
|
61
62
|
execution_context=self.session.execution_context,
|
|
63
|
+
is_internal_user=self.session.is_internal_user,
|
|
62
64
|
public_ip=self.session.public_ip,
|
|
63
65
|
connector_name=self.session.connector_name,
|
|
64
66
|
connector_version=connector_version,
|
|
@@ -81,9 +83,9 @@ class SegmentTracker:
|
|
|
81
83
|
self,
|
|
82
84
|
entity: str,
|
|
83
85
|
action: str,
|
|
84
|
-
status_code:
|
|
86
|
+
status_code: int | None,
|
|
85
87
|
timing_ms: float,
|
|
86
|
-
error_type:
|
|
88
|
+
error_type: str | None = None,
|
|
87
89
|
) -> None:
|
|
88
90
|
"""Track API operation."""
|
|
89
91
|
# Always track success/failure counts (useful even when tracking is disabled)
|
|
@@ -101,6 +103,7 @@ class SegmentTracker:
|
|
|
101
103
|
session_id=self.session.session_id,
|
|
102
104
|
user_id=self.session.user_id,
|
|
103
105
|
execution_context=self.session.execution_context,
|
|
106
|
+
is_internal_user=self.session.is_internal_user,
|
|
104
107
|
public_ip=self.session.public_ip,
|
|
105
108
|
connector_name=self.session.connector_name,
|
|
106
109
|
entity=entity,
|
|
@@ -130,6 +133,7 @@ class SegmentTracker:
|
|
|
130
133
|
session_id=self.session.session_id,
|
|
131
134
|
user_id=self.session.user_id,
|
|
132
135
|
execution_context=self.session.execution_context,
|
|
136
|
+
is_internal_user=self.session.is_internal_user,
|
|
133
137
|
public_ip=self.session.public_ip,
|
|
134
138
|
connector_name=self.session.connector_name,
|
|
135
139
|
duration_seconds=self.session.duration_seconds(),
|
|
@@ -22,7 +22,7 @@ class Action(str, Enum):
|
|
|
22
22
|
UPDATE = "update"
|
|
23
23
|
DELETE = "delete"
|
|
24
24
|
LIST = "list"
|
|
25
|
-
|
|
25
|
+
API_SEARCH = "api_search"
|
|
26
26
|
DOWNLOAD = "download"
|
|
27
27
|
AUTHORIZE = "authorize"
|
|
28
28
|
|
|
@@ -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
|
|
@@ -221,6 +221,10 @@ class EntityDefinition(BaseModel):
|
|
|
221
221
|
model_config = {"populate_by_name": True}
|
|
222
222
|
|
|
223
223
|
name: str
|
|
224
|
+
stream_name: str | None = Field(
|
|
225
|
+
default=None,
|
|
226
|
+
description="Airbyte stream name for cache lookup (from x-airbyte-stream-name schema extension)",
|
|
227
|
+
)
|
|
224
228
|
actions: list[Action]
|
|
225
229
|
endpoints: dict[Action, EndpointDefinition]
|
|
226
230
|
entity_schema: dict[str, Any] | None = Field(default=None, alias="schema")
|