airbyte-agent-slack 0.1.32__tar.gz → 0.1.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.
Files changed (63) hide show
  1. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/CHANGELOG.md +30 -0
  2. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/PKG-INFO +5 -4
  3. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/README.md +4 -3
  4. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/__init__.py +4 -2
  5. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/connector_model_loader.py +5 -0
  6. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/executor/hosted_executor.py +5 -0
  7. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/executor/local_executor.py +87 -12
  8. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/executor/models.py +12 -0
  9. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/adapters/httpx_adapter.py +10 -1
  10. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/base.py +11 -0
  11. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/operations.py +10 -0
  12. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/security.py +5 -0
  13. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/telemetry/tracker.py +4 -4
  14. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/types.py +20 -1
  15. airbyte_agent_slack-0.1.38/airbyte_agent_slack/_vendored/connector_sdk/utils.py +127 -0
  16. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/validation.py +171 -2
  17. airbyte_agent_slack-0.1.38/airbyte_agent_slack/_vendored/connector_sdk/validation_replication.py +970 -0
  18. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/connector.py +36 -1
  19. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/connector_model.py +3 -1
  20. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/models.py +43 -24
  21. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/pyproject.toml +1 -1
  22. airbyte_agent_slack-0.1.32/airbyte_agent_slack/_vendored/connector_sdk/utils.py +0 -60
  23. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/.gitignore +0 -0
  24. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/AUTH.md +0 -0
  25. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/REFERENCE.md +0 -0
  26. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/__init__.py +0 -0
  27. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/__init__.py +0 -0
  28. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/auth_strategies.py +0 -0
  29. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/auth_template.py +0 -0
  30. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/cloud_utils/__init__.py +0 -0
  31. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/cloud_utils/client.py +0 -0
  32. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/constants.py +0 -0
  33. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/exceptions.py +0 -0
  34. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/executor/__init__.py +0 -0
  35. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/extensions.py +0 -0
  36. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/__init__.py +0 -0
  37. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/adapters/__init__.py +0 -0
  38. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/config.py +0 -0
  39. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/exceptions.py +0 -0
  40. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/protocols.py +0 -0
  41. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http/response.py +0 -0
  42. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/http_client.py +0 -0
  43. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/introspection.py +0 -0
  44. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/logging/__init__.py +0 -0
  45. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/logging/logger.py +0 -0
  46. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/logging/types.py +0 -0
  47. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/observability/__init__.py +0 -0
  48. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/observability/config.py +0 -0
  49. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/observability/models.py +0 -0
  50. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/observability/redactor.py +0 -0
  51. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/observability/session.py +0 -0
  52. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/performance/__init__.py +0 -0
  53. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/performance/instrumentation.py +0 -0
  54. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/performance/metrics.py +0 -0
  55. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/__init__.py +0 -0
  56. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/components.py +0 -0
  57. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/connector.py +0 -0
  58. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/schema/extensions.py +0 -0
  59. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/secrets.py +0 -0
  60. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/telemetry/__init__.py +0 -0
  61. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/telemetry/config.py +0 -0
  62. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/_vendored/connector_sdk/telemetry/events.py +0 -0
  63. {airbyte_agent_slack-0.1.32 → airbyte_agent_slack-0.1.38}/airbyte_agent_slack/types.py +0 -0
@@ -1,5 +1,35 @@
1
1
  # Slack changelog
2
2
 
3
+ ## [0.1.38] - 2026-01-30
4
+ - Updated connector definition (YAML version 0.1.12)
5
+ - Source commit: 40765c71
6
+ - SDK version: 0.1.0
7
+
8
+ ## [0.1.37] - 2026-01-30
9
+ - Updated connector definition (YAML version 0.1.11)
10
+ - Source commit: 5f65d643
11
+ - SDK version: 0.1.0
12
+
13
+ ## [0.1.36] - 2026-01-30
14
+ - Updated connector definition (YAML version 0.1.10)
15
+ - Source commit: 5b20f488
16
+ - SDK version: 0.1.0
17
+
18
+ ## [0.1.35] - 2026-01-30
19
+ - Updated connector definition (YAML version 0.1.10)
20
+ - Source commit: a3729d85
21
+ - SDK version: 0.1.0
22
+
23
+ ## [0.1.34] - 2026-01-29
24
+ - Updated connector definition (YAML version 0.1.10)
25
+ - Source commit: 43200eed
26
+ - SDK version: 0.1.0
27
+
28
+ ## [0.1.33] - 2026-01-29
29
+ - Updated connector definition (YAML version 0.1.10)
30
+ - Source commit: c718c683
31
+ - SDK version: 0.1.0
32
+
3
33
  ## [0.1.32] - 2026-01-28
4
34
  - Updated connector definition (YAML version 0.1.10)
5
35
  - Source commit: 97007bbd
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: airbyte-agent-slack
3
- Version: 0.1.32
3
+ Version: 0.1.38
4
4
  Summary: Airbyte Slack Connector for AI platforms
5
5
  Project-URL: Homepage, https://github.com/airbytehq/airbyte-agent-connectors
6
6
  Project-URL: Documentation, https://docs.airbyte.com/ai-agents/
@@ -158,6 +158,7 @@ See the official [Slack API reference](https://api.slack.com/methods).
158
158
 
159
159
  ## Version information
160
160
 
161
- - **Package version:** 0.1.32
162
- - **Connector version:** 0.1.10
163
- - **Generated with Connector SDK commit SHA:** 97007bbdad3a6ac982ee2c0cdd667acdb5c12d3c
161
+ - **Package version:** 0.1.38
162
+ - **Connector version:** 0.1.12
163
+ - **Generated with Connector SDK commit SHA:** 40765c717093dffed8c5e9ed8d5b3a6fbbe9b181
164
+ - **Changelog:** [View changelog](https://github.com/airbytehq/airbyte-agent-connectors/blob/main/connectors/slack/CHANGELOG.md)
@@ -125,6 +125,7 @@ See the official [Slack API reference](https://api.slack.com/methods).
125
125
 
126
126
  ## Version information
127
127
 
128
- - **Package version:** 0.1.32
129
- - **Connector version:** 0.1.10
130
- - **Generated with Connector SDK commit SHA:** 97007bbdad3a6ac982ee2c0cdd667acdb5c12d3c
128
+ - **Package version:** 0.1.38
129
+ - **Connector version:** 0.1.12
130
+ - **Generated with Connector SDK commit SHA:** 40765c717093dffed8c5e9ed8d5b3a6fbbe9b181
131
+ - **Changelog:** [View changelog](https://github.com/airbytehq/airbyte-agent-connectors/blob/main/connectors/slack/CHANGELOG.md)
@@ -17,9 +17,9 @@ from .models import (
17
17
  ChannelPurpose,
18
18
  ChannelsListResponse,
19
19
  ChannelResponse,
20
- File,
21
20
  Reaction,
22
21
  Attachment,
22
+ File,
23
23
  Message,
24
24
  Thread,
25
25
  EditedInfo,
@@ -45,6 +45,7 @@ from .models import (
45
45
  ChannelsListResultMeta,
46
46
  ChannelMessagesListResultMeta,
47
47
  ThreadsListResultMeta,
48
+ SlackCheckResult,
48
49
  SlackExecuteResult,
49
50
  SlackExecuteResultWithMeta,
50
51
  UsersListResult,
@@ -95,9 +96,9 @@ __all__ = [
95
96
  "ChannelPurpose",
96
97
  "ChannelsListResponse",
97
98
  "ChannelResponse",
98
- "File",
99
99
  "Reaction",
100
100
  "Attachment",
101
+ "File",
101
102
  "Message",
102
103
  "Thread",
103
104
  "EditedInfo",
@@ -123,6 +124,7 @@ __all__ = [
123
124
  "ChannelsListResultMeta",
124
125
  "ChannelMessagesListResultMeta",
125
126
  "ThreadsListResultMeta",
127
+ "SlackCheckResult",
126
128
  "SlackExecuteResult",
127
129
  "SlackExecuteResultWithMeta",
128
130
  "UsersListResult",
@@ -496,6 +496,9 @@ def convert_openapi_to_connector_model(spec: OpenAPIConnector) -> ConnectorModel
496
496
  # Extract untested flag
497
497
  untested = getattr(operation, "x_airbyte_untested", None) or False
498
498
 
499
+ # Extract preferred_for_check flag
500
+ preferred_for_check = getattr(operation, "x_airbyte_preferred_for_check", None) or False
501
+
499
502
  # Create endpoint definition
500
503
  endpoint = EndpointDefinition(
501
504
  method=method_name.upper(),
@@ -520,6 +523,7 @@ def convert_openapi_to_connector_model(spec: OpenAPIConnector) -> ConnectorModel
520
523
  graphql_body=graphql_body,
521
524
  file_field=file_field,
522
525
  untested=untested,
526
+ preferred_for_check=preferred_for_check,
523
527
  )
524
528
 
525
529
  # Add to entities map
@@ -1010,6 +1014,7 @@ def _parse_security_scheme_to_option(scheme_name: str, scheme: Any) -> AuthOptio
1010
1014
  type=single_auth.type,
1011
1015
  config=single_auth.config,
1012
1016
  user_config_spec=single_auth.user_config_spec,
1017
+ untested=getattr(scheme, "x_airbyte_untested", False),
1013
1018
  )
1014
1019
 
1015
1020
 
@@ -164,6 +164,11 @@ class HostedExecutor:
164
164
  span.record_exception(e)
165
165
  raise
166
166
 
167
+ async def check(self) -> ExecutionResult:
168
+ """Perform a health check via the cloud API."""
169
+ config = ExecutionConfig(entity="*", action="check", params={})
170
+ return await self.execute(config)
171
+
167
172
  def _parse_execution_result(self, response: dict) -> ExecutionResult:
168
173
  """Parse API response into ExecutionResult.
169
174
 
@@ -36,6 +36,7 @@ from ..types import (
36
36
  EndpointDefinition,
37
37
  EntityDefinition,
38
38
  )
39
+ from ..utils import find_matching_auth_options
39
40
 
40
41
  from .models import (
41
42
  ActionNotSupportedError,
@@ -70,6 +71,14 @@ class _OperationContext:
70
71
  self.validate_required_body_fields = executor._validate_required_body_fields
71
72
  self.extract_records = executor._extract_records
72
73
 
74
+ @property
75
+ def standard_handler(self) -> _StandardOperationHandler | None:
76
+ """Return the standard operation handler, or None if not registered."""
77
+ for h in self.executor._operation_handlers:
78
+ if isinstance(h, _StandardOperationHandler):
79
+ return h
80
+ return None
81
+
73
82
 
74
83
  class _OperationHandler(Protocol):
75
84
  """Protocol for operation handlers."""
@@ -348,8 +357,8 @@ class LocalExecutor:
348
357
  ) -> tuple[AuthOption, dict[str, SecretStr]]:
349
358
  """Infer authentication scheme from provided credentials.
350
359
 
351
- Matches user credentials against each auth option's required fields
352
- to determine which scheme to use.
360
+ Uses shared utility find_matching_auth_options to match credentials
361
+ against each auth option's required fields.
353
362
 
354
363
  Args:
355
364
  user_credentials: User-provided credentials
@@ -367,16 +376,8 @@ class LocalExecutor:
367
376
  # Get the credential keys provided by the user
368
377
  provided_keys = set(user_credentials.keys())
369
378
 
370
- # Find all options where all required fields are present
371
- matching_options: list[AuthOption] = []
372
- for option in options:
373
- if option.user_config_spec and option.user_config_spec.required:
374
- required_fields = set(option.user_config_spec.required)
375
- if required_fields.issubset(provided_keys):
376
- matching_options.append(option)
377
- elif not option.user_config_spec or not option.user_config_spec.required:
378
- # Option has no required fields - it matches any credentials
379
- matching_options.append(option)
379
+ # Use shared utility to find matching options
380
+ matching_options = find_matching_auth_options(provided_keys, options)
380
381
 
381
382
  # Handle matching results
382
383
  if len(matching_options) == 0:
@@ -544,6 +545,80 @@ class LocalExecutor:
544
545
  # These are "expected" execution errors - return them in ExecutionResult
545
546
  return ExecutionResult(success=False, data={}, error=str(e))
546
547
 
548
+ async def check(self) -> ExecutionResult:
549
+ """Perform a health check by running a lightweight list operation.
550
+
551
+ Finds the operation marked with preferred_for_check=True, or falls back
552
+ to the first list operation. Executes it with limit=1 to verify
553
+ connectivity and credentials.
554
+
555
+ Returns:
556
+ ExecutionResult with data containing status, error, and checked operation details.
557
+ """
558
+ check_entity = None
559
+ check_endpoint = None
560
+
561
+ # Look for preferred check operation
562
+ for (ent_name, op_action), endpoint in self._operation_index.items():
563
+ if getattr(endpoint, "preferred_for_check", False):
564
+ check_entity = ent_name
565
+ check_endpoint = endpoint
566
+ break
567
+
568
+ # Fallback to first list operation
569
+ if check_endpoint is None:
570
+ for (ent_name, op_action), endpoint in self._operation_index.items():
571
+ if op_action == Action.LIST:
572
+ check_entity = ent_name
573
+ check_endpoint = endpoint
574
+ break
575
+
576
+ if check_endpoint is None or check_entity is None:
577
+ return ExecutionResult(
578
+ success=True,
579
+ data={
580
+ "status": "skipped",
581
+ "error": "No list operation available for health check",
582
+ },
583
+ )
584
+
585
+ # Find the standard handler to execute the list operation
586
+ standard_handler = next(
587
+ (h for h in self._operation_handlers if isinstance(h, _StandardOperationHandler)),
588
+ None,
589
+ )
590
+
591
+ if standard_handler is None:
592
+ return ExecutionResult(
593
+ success=True,
594
+ data={
595
+ "status": "skipped",
596
+ "error": "No standard handler available",
597
+ },
598
+ )
599
+
600
+ try:
601
+ await standard_handler.execute_operation(check_entity, Action.LIST, {"limit": 1})
602
+ return ExecutionResult(
603
+ success=True,
604
+ data={
605
+ "status": "healthy",
606
+ "checked_entity": check_entity,
607
+ "checked_action": "list",
608
+ },
609
+ )
610
+ except Exception as e:
611
+ return ExecutionResult(
612
+ success=False,
613
+ data={
614
+ "status": "unhealthy",
615
+ "error": str(e),
616
+ "checked_entity": check_entity,
617
+ "checked_action": "list",
618
+ },
619
+ error=str(e),
620
+ )
621
+
547
622
  async def _execute_operation(
548
623
  self,
549
624
  entity: str,
@@ -154,6 +154,18 @@ class ExecutorProtocol(Protocol):
154
154
  """
155
155
  ...
156
156
 
157
+ async def check(self) -> ExecutionResult:
158
+ """Perform a health check to verify connectivity and credentials.
159
+
160
+ Returns:
161
+ ExecutionResult with data containing:
162
+ - status: "healthy" or "unhealthy"
163
+ - error: Error message if unhealthy
164
+ - checked_entity: Entity used for the check
165
+ - checked_action: Action used for the check
166
+ """
167
+ ...
168
+
157
169
 
158
170
  # ============================================================================
159
171
  # Executor Exceptions
@@ -186,7 +186,16 @@ class HTTPXClient:
186
186
  # Try to get error message from response
187
187
  try:
188
188
  error_data = httpx_response.json()
189
- error_message = error_data.get("message") or error_data.get("error") or str(error_data)
189
+ errors_list = error_data.get("errors")
190
+ if isinstance(errors_list, list):
191
+
192
+ def _extract_error(e: object) -> str:
193
+ if isinstance(e, dict):
194
+ return str(e.get("userPresentableMessage") or e.get("message") or e.get("error") or e)
195
+ return str(e)
196
+
197
+ errors_list = ", ".join(_extract_error(e) for e in errors_list)
198
+ error_message = errors_list or error_data.get("message") or error_data.get("error") or str(error_data)
190
199
  except Exception:
191
200
  error_message = httpx_response.text or f"HTTP {status_code} error"
192
201
 
@@ -126,6 +126,17 @@ class Info(BaseModel):
126
126
  x_airbyte_example_questions: ExampleQuestions | None = Field(None, alias="x-airbyte-example-questions")
127
127
  x_airbyte_cache: CacheConfig | None = Field(None, alias="x-airbyte-cache")
128
128
  x_airbyte_replication_config: ReplicationConfig | None = Field(None, alias="x-airbyte-replication-config")
129
+ x_airbyte_skip_suggested_streams: list[str] = Field(
130
+ default_factory=list,
131
+ alias="x-airbyte-skip-suggested-streams",
132
+ description="List of Airbyte suggested streams to skip when validating cache entity coverage",
133
+ )
134
+ x_airbyte_skip_auth_methods: list[str] = Field(
135
+ default_factory=list,
136
+ alias="x-airbyte-skip-auth-methods",
137
+ description="List of Airbyte auth methods to skip when validating auth compatibility. "
138
+ "Use the SelectiveAuthenticator option key (e.g., 'Private App Credentials', 'oauth2.0')",
139
+ )
129
140
 
130
141
 
131
142
  class ServerVariable(BaseModel):
@@ -86,6 +86,16 @@ class Operation(BaseModel):
86
86
  "Validation will generate a warning instead of an error when cassettes are missing."
87
87
  ),
88
88
  )
89
+ x_airbyte_preferred_for_check: bool | None = Field(
90
+ None,
91
+ alias="x-airbyte-preferred-for-check",
92
+ description=(
93
+ "Mark this list operation as the preferred operation for health checks. "
94
+ "When the CHECK action is executed, this operation will be used instead of "
95
+ "falling back to the first available list operation. Choose a lightweight, "
96
+ "always-available endpoint (e.g., users, accounts)."
97
+ ),
98
+ )
89
99
 
90
100
  # Future extensions (commented out, defined for future use)
91
101
  # from .extensions import PaginationConfig
@@ -199,6 +199,11 @@ class SecurityScheme(BaseModel):
199
199
  alias="x-airbyte-token-extract",
200
200
  description="List of fields to extract from OAuth2 token responses and use as server variables",
201
201
  )
202
+ x_airbyte_untested: bool = Field(
203
+ False,
204
+ alias="x-airbyte-untested",
205
+ description="Mark this auth scheme as untested to skip cassette coverage validation",
206
+ )
202
207
 
203
208
  @field_validator("x_airbyte_token_extract", mode="after")
204
209
  @classmethod
@@ -3,7 +3,7 @@
3
3
  import logging
4
4
  import platform
5
5
  import sys
6
- from datetime import datetime
6
+ from datetime import UTC, datetime
7
7
 
8
8
  from ..observability import ObservabilitySession
9
9
 
@@ -56,7 +56,7 @@ class SegmentTracker:
56
56
 
57
57
  try:
58
58
  event = ConnectorInitEvent(
59
- timestamp=datetime.utcnow(),
59
+ timestamp=datetime.now(UTC),
60
60
  session_id=self.session.session_id,
61
61
  user_id=self.session.user_id,
62
62
  execution_context=self.session.execution_context,
@@ -99,7 +99,7 @@ class SegmentTracker:
99
99
 
100
100
  try:
101
101
  event = OperationEvent(
102
- timestamp=datetime.utcnow(),
102
+ timestamp=datetime.now(UTC),
103
103
  session_id=self.session.session_id,
104
104
  user_id=self.session.user_id,
105
105
  execution_context=self.session.execution_context,
@@ -129,7 +129,7 @@ class SegmentTracker:
129
129
 
130
130
  try:
131
131
  event = SessionEndEvent(
132
- timestamp=datetime.utcnow(),
132
+ timestamp=datetime.now(UTC),
133
133
  session_id=self.session.session_id,
134
134
  user_id=self.session.user_id,
135
135
  execution_context=self.session.execution_context,
@@ -15,7 +15,16 @@ from .schema.security import AirbyteAuthConfig
15
15
 
16
16
 
17
17
  class Action(str, Enum):
18
- """Supported actions for Entity operations."""
18
+ """Supported actions for Entity operations.
19
+
20
+ Standard CRUD actions:
21
+ GET, CREATE, UPDATE, DELETE, LIST
22
+
23
+ Special actions:
24
+ API_SEARCH - Search via API endpoint
25
+ DOWNLOAD - Download file content
26
+ AUTHORIZE - OAuth authorization flow
27
+ """
19
28
 
20
29
  GET = "get"
21
30
  CREATE = "create"
@@ -81,6 +90,10 @@ class AuthOption(BaseModel):
81
90
  None,
82
91
  description="User-facing credential specification from x-airbyte-auth-config",
83
92
  )
93
+ untested: bool = Field(
94
+ False,
95
+ description="Mark this auth scheme as untested to skip cassette coverage validation",
96
+ )
84
97
 
85
98
 
86
99
  class AuthConfig(BaseModel):
@@ -223,6 +236,12 @@ class EndpointDefinition(BaseModel):
223
236
  description="Mark operation as untested to skip cassette validation (from x-airbyte-untested extension)",
224
237
  )
225
238
 
239
+ # Health check support (Airbyte extension)
240
+ preferred_for_check: bool = Field(
241
+ False,
242
+ description="Mark this list operation as preferred for health checks (from x-airbyte-preferred-for-check extension)",
243
+ )
244
+
226
245
 
227
246
  class EntityDefinition(BaseModel):
228
247
  """Definition of an API entity."""
@@ -0,0 +1,127 @@
1
+ """Utility functions for working with connectors."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from collections.abc import AsyncIterator
6
+ from pathlib import Path
7
+ from typing import TYPE_CHECKING
8
+
9
+ if TYPE_CHECKING:
10
+ from .types import AuthOption
11
+
12
+
13
+ async def save_download(
14
+ download_iterator: AsyncIterator[bytes],
15
+ path: str | Path,
16
+ *,
17
+ overwrite: bool = False,
18
+ ) -> Path:
19
+ """Save a download iterator to a file.
20
+
21
+ Args:
22
+ download_iterator: AsyncIterator[bytes] from a download operation
23
+ path: File path where content should be saved
24
+ overwrite: Whether to overwrite existing file (default: False)
25
+
26
+ Returns:
27
+ Absolute Path to the saved file
28
+
29
+ Raises:
30
+ FileExistsError: If file exists and overwrite=False
31
+ OSError: If file cannot be written
32
+
33
+ Example:
34
+ >>> from .utils import save_download
35
+ >>>
36
+ >>> # Download and save a file
37
+ >>> result = await connector.download_article_attachment(id="123")
38
+ >>> file_path = await save_download(result, "./downloads/attachment.pdf")
39
+ >>> print(f"Downloaded to {file_path}")
40
+ Downloaded to /absolute/path/to/downloads/attachment.pdf
41
+ >>>
42
+ >>> # Overwrite existing file
43
+ >>> file_path = await save_download(result, "./downloads/attachment.pdf", overwrite=True)
44
+ """
45
+ # Convert to Path object
46
+ file_path = Path(path).expanduser().resolve()
47
+
48
+ # Check if file exists
49
+ if file_path.exists() and not overwrite:
50
+ raise FileExistsError(f"File already exists: {file_path}. Use overwrite=True to replace it.")
51
+
52
+ # Create parent directories if needed
53
+ file_path.parent.mkdir(parents=True, exist_ok=True)
54
+
55
+ # Stream content to file
56
+ try:
57
+ with open(file_path, "wb") as f:
58
+ async for chunk in download_iterator:
59
+ f.write(chunk)
60
+ except Exception as e:
61
+ # Clean up partial file on error
62
+ if file_path.exists():
63
+ file_path.unlink()
64
+ raise OSError(f"Failed to write file {file_path}: {e}") from e
65
+
66
+ return file_path
67
+
68
+
69
+ def find_matching_auth_options(
70
+ provided_keys: set[str],
71
+ auth_options: list[AuthOption],
72
+ ) -> list[AuthOption]:
73
+ """Find auth options that match the provided credential keys.
74
+
75
+ This is the single source of truth for auth scheme inference logic,
76
+ used by both the executor (at runtime) and validation (for cassettes).
77
+
78
+ Matching logic:
79
+ - An option matches if all its required fields are present in provided_keys
80
+ - Options with no required fields match any credentials
81
+
82
+ Args:
83
+ provided_keys: Set of credential/auth_config keys
84
+ auth_options: List of AuthOption from the connector model
85
+
86
+ Returns:
87
+ List of AuthOption that match the provided keys
88
+ """
89
+ matching_options: list[AuthOption] = []
90
+
91
+ for option in auth_options:
92
+ if option.user_config_spec and option.user_config_spec.required:
93
+ required_fields = set(option.user_config_spec.required)
94
+ if required_fields.issubset(provided_keys):
95
+ matching_options.append(option)
96
+ elif not option.user_config_spec or not option.user_config_spec.required:
97
+ # Option has no required fields - it matches any credentials
98
+ matching_options.append(option)
99
+
100
+ return matching_options
101
+
102
+
103
+ def infer_auth_scheme_name(
104
+ provided_keys: set[str],
105
+ auth_options: list[AuthOption],
106
+ ) -> str | None:
107
+ """Infer the auth scheme name from provided credential keys.
108
+
109
+ Uses find_matching_auth_options to find matches, then returns
110
+ the scheme name only if exactly one option matches.
111
+
112
+ Args:
113
+ provided_keys: Set of credential/auth_config keys
114
+ auth_options: List of AuthOption from the connector model
115
+
116
+ Returns:
117
+ The scheme_name if exactly one match, None otherwise
118
+ """
119
+ if not provided_keys or not auth_options:
120
+ return None
121
+
122
+ matching = find_matching_auth_options(provided_keys, auth_options)
123
+
124
+ if len(matching) == 1:
125
+ return matching[0].scheme_name
126
+
127
+ return None