airbyte-cdk 6.48.17.dev0__py3-none-any.whl → 6.49.1__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_cdk/cli/source_declarative_manifest/_run.py +69 -10
- airbyte_cdk/connector.py +3 -3
- airbyte_cdk/entrypoint.py +36 -0
- airbyte_cdk/sources/declarative/declarative_component_schema.yaml +277 -69
- airbyte_cdk/sources/declarative/extractors/__init__.py +0 -4
- airbyte_cdk/sources/declarative/manifest_declarative_source.py +3 -1
- airbyte_cdk/sources/declarative/models/declarative_component_schema.py +190 -45
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +155 -60
- airbyte_cdk/sources/declarative/resolvers/components_resolver.py +0 -2
- airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py +14 -49
- airbyte_cdk/sources/declarative/schema/dynamic_schema_loader.py +4 -19
- airbyte_cdk/sources/declarative/spec/__init__.py +2 -2
- airbyte_cdk/sources/declarative/spec/spec.py +71 -2
- airbyte_cdk/sources/declarative/transformations/config_transformations/add_fields.py +10 -23
- airbyte_cdk/sources/declarative/transformations/config_transformations/remap_field.py +2 -3
- airbyte_cdk/sources/declarative/validators/dpath_validator.py +1 -1
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/RECORD +22 -24
- airbyte_cdk/sources/declarative/extractors/combined_extractor.py +0 -44
- airbyte_cdk/sources/declarative/extractors/key_value_extractor.py +0 -46
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.48.17.dev0.dist-info → airbyte_cdk-6.49.1.dist-info}/entry_points.txt +0 -0
@@ -1,3 +1,5 @@
|
|
1
|
+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
|
2
|
+
|
1
3
|
# generated by datamodel-codegen:
|
2
4
|
# filename: declarative_component_schema.yaml
|
3
5
|
|
@@ -1478,7 +1480,6 @@ class ComponentMappingDefinition(BaseModel):
|
|
1478
1480
|
description="The expected data type of the value. If omitted, the type will be inferred from the value provided.",
|
1479
1481
|
title="Value Type",
|
1480
1482
|
)
|
1481
|
-
create_or_update: Optional[bool] = False
|
1482
1483
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1483
1484
|
|
1484
1485
|
|
@@ -1490,13 +1491,12 @@ class StreamConfig(BaseModel):
|
|
1490
1491
|
examples=[["data"], ["data", "streams"], ["data", "{{ parameters.name }}"]],
|
1491
1492
|
title="Configs Pointer",
|
1492
1493
|
)
|
1493
|
-
default_values: Optional[List] = Field(None, description="placeholder", title="Default Values")
|
1494
1494
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1495
1495
|
|
1496
1496
|
|
1497
1497
|
class ConfigComponentsResolver(BaseModel):
|
1498
1498
|
type: Literal["ConfigComponentsResolver"]
|
1499
|
-
stream_config:
|
1499
|
+
stream_config: StreamConfig
|
1500
1500
|
components_mapping: List[ComponentMappingDefinition]
|
1501
1501
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1502
1502
|
|
@@ -1523,6 +1523,77 @@ class RequestBodyGraphQlQuery(BaseModel):
|
|
1523
1523
|
query: Dict[str, Any] = Field(..., description="The GraphQL query to be executed")
|
1524
1524
|
|
1525
1525
|
|
1526
|
+
class ValidateAdheresToSchema(BaseModel):
|
1527
|
+
type: Literal["ValidateAdheresToSchema"]
|
1528
|
+
base_schema: Union[str, Dict[str, Any]] = Field(
|
1529
|
+
...,
|
1530
|
+
description="The base JSON schema against which the user-provided schema will be validated.",
|
1531
|
+
examples=[
|
1532
|
+
"{{ config['report_validation_schema'] }}",
|
1533
|
+
'\'{\n "$schema": "http://json-schema.org/draft-07/schema#",\n "title": "Person",\n "type": "object",\n "properties": {\n "name": {\n "type": "string",\n "description": "The person\'s name"\n },\n "age": {\n "type": "integer",\n "minimum": 0,\n "description": "The person\'s age"\n }\n },\n "required": ["name", "age"]\n}\'\n',
|
1534
|
+
{
|
1535
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
1536
|
+
"title": "Person",
|
1537
|
+
"type": "object",
|
1538
|
+
"properties": {
|
1539
|
+
"name": {"type": "string", "description": "The person's name"},
|
1540
|
+
"age": {
|
1541
|
+
"type": "integer",
|
1542
|
+
"minimum": 0,
|
1543
|
+
"description": "The person's age",
|
1544
|
+
},
|
1545
|
+
},
|
1546
|
+
"required": ["name", "age"],
|
1547
|
+
},
|
1548
|
+
],
|
1549
|
+
title="Base JSON Schema",
|
1550
|
+
)
|
1551
|
+
|
1552
|
+
|
1553
|
+
class ConfigRemapField(BaseModel):
|
1554
|
+
type: Literal["ConfigRemapField"]
|
1555
|
+
map: Union[Dict[str, Any], str] = Field(
|
1556
|
+
...,
|
1557
|
+
description="A mapping of original values to new values. When a field value matches a key in this map, it will be replaced with the corresponding value.",
|
1558
|
+
examples=[
|
1559
|
+
{"pending": "in_progress", "done": "completed", "cancelled": "terminated"},
|
1560
|
+
"{{ config['status_mapping'] }}",
|
1561
|
+
],
|
1562
|
+
title="Value Mapping",
|
1563
|
+
)
|
1564
|
+
field_path: List[str] = Field(
|
1565
|
+
...,
|
1566
|
+
description="The path to the field whose value should be remapped. Specified as a list of path components to navigate through nested objects.",
|
1567
|
+
examples=[
|
1568
|
+
["status"],
|
1569
|
+
["data", "status"],
|
1570
|
+
["data", "{{ config.name }}", "status"],
|
1571
|
+
["data", "*", "status"],
|
1572
|
+
],
|
1573
|
+
title="Field Path",
|
1574
|
+
)
|
1575
|
+
|
1576
|
+
|
1577
|
+
class ConfigRemoveFields(BaseModel):
|
1578
|
+
type: Literal["ConfigRemoveFields"]
|
1579
|
+
field_pointers: List[List[str]] = Field(
|
1580
|
+
...,
|
1581
|
+
description="A list of field pointers to be removed from the config.",
|
1582
|
+
examples=[["tags"], [["content", "html"], ["content", "plain_text"]]],
|
1583
|
+
title="Field Pointers",
|
1584
|
+
)
|
1585
|
+
condition: Optional[str] = Field(
|
1586
|
+
"",
|
1587
|
+
description="Fields will be removed if expression is evaluated to True.",
|
1588
|
+
examples=[
|
1589
|
+
"{{ config['environemnt'] == 'sandbox' }}",
|
1590
|
+
"{{ property is integer }}",
|
1591
|
+
"{{ property|length > 5 }}",
|
1592
|
+
"{{ property == 'some_string_to_match' }}",
|
1593
|
+
],
|
1594
|
+
)
|
1595
|
+
|
1596
|
+
|
1526
1597
|
class AddedFieldDefinition(BaseModel):
|
1527
1598
|
type: Literal["AddedFieldDefinition"]
|
1528
1599
|
path: List[str] = Field(
|
@@ -1844,25 +1915,6 @@ class DefaultPaginator(BaseModel):
|
|
1844
1915
|
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1845
1916
|
|
1846
1917
|
|
1847
|
-
class KeyValueExtractor(BaseModel):
|
1848
|
-
type: Literal["KeyValueExtractor"]
|
1849
|
-
keys_extractor: Union[DpathExtractor, CustomRecordExtractor] = Field(
|
1850
|
-
..., description="placeholder"
|
1851
|
-
)
|
1852
|
-
values_extractor: Union[DpathExtractor, CustomRecordExtractor] = Field(
|
1853
|
-
..., description="placeholder"
|
1854
|
-
)
|
1855
|
-
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1856
|
-
|
1857
|
-
|
1858
|
-
class CombinedExtractor(BaseModel):
|
1859
|
-
type: Literal["CombinedExtractor"]
|
1860
|
-
extractors: List[
|
1861
|
-
Union[DpathExtractor, CombinedExtractor, KeyValueExtractor, CustomRecordExtractor]
|
1862
|
-
] = Field(..., description="placeholder")
|
1863
|
-
parameters: Optional[Dict[str, Any]] = Field(None, alias="$parameters")
|
1864
|
-
|
1865
|
-
|
1866
1918
|
class SessionTokenRequestApiKeyAuthenticator(BaseModel):
|
1867
1919
|
type: Literal["ApiKey"]
|
1868
1920
|
inject_into: RequestOption = Field(
|
@@ -1900,7 +1952,7 @@ class ListPartitionRouter(BaseModel):
|
|
1900
1952
|
|
1901
1953
|
class RecordSelector(BaseModel):
|
1902
1954
|
type: Literal["RecordSelector"]
|
1903
|
-
extractor: Union[DpathExtractor,
|
1955
|
+
extractor: Union[DpathExtractor, CustomRecordExtractor]
|
1904
1956
|
record_filter: Optional[Union[RecordFilter, CustomRecordFilter]] = Field(
|
1905
1957
|
None,
|
1906
1958
|
description="Responsible for filtering records to be emitted by the Source.",
|
@@ -1924,29 +1976,68 @@ class GzipDecoder(BaseModel):
|
|
1924
1976
|
decoder: Union[CsvDecoder, GzipDecoder, JsonDecoder, JsonlDecoder]
|
1925
1977
|
|
1926
1978
|
|
1927
|
-
class
|
1928
|
-
type: Literal["
|
1929
|
-
|
1979
|
+
class RequestBodyGraphQL(BaseModel):
|
1980
|
+
type: Literal["RequestBodyGraphQL"]
|
1981
|
+
value: RequestBodyGraphQlQuery
|
1982
|
+
|
1983
|
+
|
1984
|
+
class DpathValidator(BaseModel):
|
1985
|
+
type: Literal["DpathValidator"]
|
1986
|
+
field_path: List[str] = Field(
|
1930
1987
|
...,
|
1931
|
-
description=
|
1932
|
-
|
1988
|
+
description='List of potentially nested fields describing the full path of the field to validate. Use "*" to validate all values from an array.',
|
1989
|
+
examples=[
|
1990
|
+
["data"],
|
1991
|
+
["data", "records"],
|
1992
|
+
["data", "{{ parameters.name }}"],
|
1993
|
+
["data", "*", "record"],
|
1994
|
+
],
|
1995
|
+
title="Field Path",
|
1933
1996
|
)
|
1934
|
-
|
1935
|
-
|
1936
|
-
description="
|
1937
|
-
|
1938
|
-
title="Documentation URL",
|
1997
|
+
validation_strategy: ValidateAdheresToSchema = Field(
|
1998
|
+
...,
|
1999
|
+
description="The condition that the specified config value will be evaluated against",
|
2000
|
+
title="Validation Strategy",
|
1939
2001
|
)
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
2002
|
+
|
2003
|
+
|
2004
|
+
class PredicateValidator(BaseModel):
|
2005
|
+
type: Literal["PredicateValidator"]
|
2006
|
+
value: Optional[Union[str, float, Dict[str, Any], List[Any], bool]] = Field(
|
2007
|
+
...,
|
2008
|
+
description="The value to be validated. Can be a literal value or interpolated from configuration.",
|
2009
|
+
examples=[
|
2010
|
+
"test-value",
|
2011
|
+
"{{ config['api_version'] }}",
|
2012
|
+
"{{ config['tenant_id'] }}",
|
2013
|
+
123,
|
2014
|
+
],
|
2015
|
+
title="Value",
|
2016
|
+
)
|
2017
|
+
validation_strategy: ValidateAdheresToSchema = Field(
|
2018
|
+
...,
|
2019
|
+
description="The validation strategy to apply to the value.",
|
2020
|
+
title="Validation Strategy",
|
1944
2021
|
)
|
1945
2022
|
|
1946
2023
|
|
1947
|
-
class
|
1948
|
-
type: Literal["
|
1949
|
-
|
2024
|
+
class ConfigAddFields(BaseModel):
|
2025
|
+
type: Literal["ConfigAddFields"]
|
2026
|
+
fields: List[AddedFieldDefinition] = Field(
|
2027
|
+
...,
|
2028
|
+
description="A list of transformations (path and corresponding value) that will be added to the config.",
|
2029
|
+
title="Fields",
|
2030
|
+
)
|
2031
|
+
condition: Optional[str] = Field(
|
2032
|
+
"",
|
2033
|
+
description="Fields will be added if expression is evaluated to True.",
|
2034
|
+
examples=[
|
2035
|
+
"{{ config['environemnt'] == 'sandbox' }}",
|
2036
|
+
"{{ property is integer }}",
|
2037
|
+
"{{ property|length > 5 }}",
|
2038
|
+
"{{ property == 'some_string_to_match' }}",
|
2039
|
+
],
|
2040
|
+
)
|
1950
2041
|
|
1951
2042
|
|
1952
2043
|
class CompositeErrorHandler(BaseModel):
|
@@ -2004,6 +2095,64 @@ class ZipfileDecoder(BaseModel):
|
|
2004
2095
|
)
|
2005
2096
|
|
2006
2097
|
|
2098
|
+
class ConfigMigration(BaseModel):
|
2099
|
+
type: Literal["ConfigMigration"]
|
2100
|
+
description: Optional[str] = Field(
|
2101
|
+
None, description="The description/purpose of the config migration."
|
2102
|
+
)
|
2103
|
+
transformations: List[Union[ConfigRemapField, ConfigAddFields, ConfigRemoveFields]] = Field(
|
2104
|
+
...,
|
2105
|
+
description="The list of transformations that will attempt to be applied on an incoming unmigrated config. The transformations will be applied in the order they are defined.",
|
2106
|
+
title="Transformations",
|
2107
|
+
)
|
2108
|
+
|
2109
|
+
|
2110
|
+
class ConfigNormalizationRules(BaseModel):
|
2111
|
+
class Config:
|
2112
|
+
extra = Extra.forbid
|
2113
|
+
|
2114
|
+
config_migrations: Optional[List[ConfigMigration]] = Field(
|
2115
|
+
[],
|
2116
|
+
description="The discrete migrations that will be applied on the incoming config. Each migration will be applied in the order they are defined.",
|
2117
|
+
title="Config Migrations",
|
2118
|
+
)
|
2119
|
+
transformations: Optional[
|
2120
|
+
List[Union[ConfigRemapField, ConfigAddFields, ConfigRemoveFields]]
|
2121
|
+
] = Field(
|
2122
|
+
[],
|
2123
|
+
description="The list of transformations that will be applied on the incoming config at the start of each sync. The transformations will be applied in the order they are defined.",
|
2124
|
+
title="Transformations",
|
2125
|
+
)
|
2126
|
+
validations: Optional[List[Union[DpathValidator, PredicateValidator]]] = Field(
|
2127
|
+
[],
|
2128
|
+
description="The list of validations that will be performed on the incoming config at the start of each sync.",
|
2129
|
+
title="Validations",
|
2130
|
+
)
|
2131
|
+
|
2132
|
+
|
2133
|
+
class Spec(BaseModel):
|
2134
|
+
type: Literal["Spec"]
|
2135
|
+
connection_specification: Dict[str, Any] = Field(
|
2136
|
+
...,
|
2137
|
+
description="A connection specification describing how a the connector can be configured.",
|
2138
|
+
title="Connection Specification",
|
2139
|
+
)
|
2140
|
+
documentation_url: Optional[str] = Field(
|
2141
|
+
None,
|
2142
|
+
description="URL of the connector's documentation page.",
|
2143
|
+
examples=["https://docs.airbyte.com/integrations/sources/dremio"],
|
2144
|
+
title="Documentation URL",
|
2145
|
+
)
|
2146
|
+
advanced_auth: Optional[AuthFlow] = Field(
|
2147
|
+
None,
|
2148
|
+
description="Advanced specification for configuring the authentication flow.",
|
2149
|
+
title="Advanced Auth",
|
2150
|
+
)
|
2151
|
+
config_normalization_rules: Optional[ConfigNormalizationRules] = Field(
|
2152
|
+
None, title="Config Normalization Rules"
|
2153
|
+
)
|
2154
|
+
|
2155
|
+
|
2007
2156
|
class DeclarativeSource1(BaseModel):
|
2008
2157
|
class Config:
|
2009
2158
|
extra = Extra.forbid
|
@@ -2433,9 +2582,6 @@ class DynamicSchemaLoader(BaseModel):
|
|
2433
2582
|
description="Component used to coordinate how records are extracted across stream slices and request pages.",
|
2434
2583
|
title="Retriever",
|
2435
2584
|
)
|
2436
|
-
schema_filter: Optional[Union[RecordFilter, CustomRecordFilter]] = Field(
|
2437
|
-
None, description="placeholder", title="Schema Filter"
|
2438
|
-
)
|
2439
2585
|
schema_transformations: Optional[
|
2440
2586
|
List[
|
2441
2587
|
Union[
|
@@ -2760,7 +2906,7 @@ class DynamicDeclarativeStream(BaseModel):
|
|
2760
2906
|
name: Optional[str] = Field(
|
2761
2907
|
"", description="The dynamic stream name.", example=["Tables"], title="Name"
|
2762
2908
|
)
|
2763
|
-
stream_template: DeclarativeStream = Field(
|
2909
|
+
stream_template: Union[DeclarativeStream, StateDelegatingStream] = Field(
|
2764
2910
|
..., description="Reference to the stream template.", title="Stream Template"
|
2765
2911
|
)
|
2766
2912
|
components_resolver: Union[HttpComponentsResolver, ConfigComponentsResolver] = Field(
|
@@ -2771,7 +2917,6 @@ class DynamicDeclarativeStream(BaseModel):
|
|
2771
2917
|
|
2772
2918
|
|
2773
2919
|
ComplexFieldType.update_forward_refs()
|
2774
|
-
CombinedExtractor.update_forward_refs()
|
2775
2920
|
GzipDecoder.update_forward_refs()
|
2776
2921
|
CompositeErrorHandler.update_forward_refs()
|
2777
2922
|
DeclarativeSource1.update_forward_refs()
|