Skip to content

Commit

Permalink
🐛 Source Shopify: Fixed line_items/discount allocations & duties
Browse files Browse the repository at this point in the history
…parts of `orders` schema (#5801)

* edited orders schema
* added changelog
* formated

Co-authored-by: Oleksandr Bazarnov <[email protected]>
  • Loading branch information
bazarnov and bazarnov authored Sep 2, 2021
1 parent 19c8efd commit 9c05308
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 16 deletions.
2 changes: 1 addition & 1 deletion airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DestinationSyncMode(Enum):
class OAuth2Specification(BaseModel):
oauthFlowInitParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the ConnectorSpecification which are needed to obtain the initial refresh/access tokens for the OAuth flow. Each inner array represents the path in the ConnectorSpecification of the referenced field.\nFor example.\nAssume the ConnectorSpecification contains params 'app_secret', 'app_id' which are needed to get the initial refresh token. If they are not nested in the config, then the array would look like this [['app_secret'], ['app_id']] If they are nested inside, say, an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]",
description="Pointers to the fields in the ConnectorSpecification which are needed to obtain the initial refresh/access tokens for the OAuth flow. Each inner array represents the path in the ConnectorSpecification of the referenced field. For example. Assume the ConnectorSpecification contains params 'app_secret', 'app_id' which are needed to get the initial refresh token. If they are not nested in the config, then the array would look like this [['app_secret'], ['app_id']] If they are nested inside, say, an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"sourceDefinitionId": "9da77001-af33-4bcd-be46-6252bf9342b9",
"name": "Shopify",
"dockerRepository": "airbyte/source-shopify",
"dockerImageTag": "0.1.13",
"dockerImageTag": "0.1.14",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/shopify"
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
- sourceDefinitionId: 9da77001-af33-4bcd-be46-6252bf9342b9
name: Shopify
dockerRepository: airbyte/source-shopify
dockerImageTag: 0.1.13
dockerImageTag: 0.1.14
documentationUrl: https://docs.airbyte.io/integrations/sources/shopify
- sourceDefinitionId: e87ffa8e-a3b5-f69c-9076-6011339de1f6
name: Redshift
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,25 @@ class DestinationSyncMode(Enum):
append_dedup = "append_dedup"


class OAuth2Specification(BaseModel):
oauthFlowInitParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the ConnectorSpecification which are needed to obtain the initial refresh/access tokens for the OAuth flow. Each inner array represents the path in the ConnectorSpecification of the referenced field. For example. Assume the ConnectorSpecification contains params 'app_secret', 'app_id' which are needed to get the initial refresh token. If they are not nested in the config, then the array would look like this [['app_secret'], ['app_id']] If they are nested inside, say, an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]",
)


class AuthType(Enum):
oauth2_0 = "oauth2.0"


class AuthSpecification(BaseModel):
auth_type: Optional[AuthType] = None
oauth2Specification: Optional[OAuth2Specification] = Field(
None,
description="If the connector supports OAuth, this field should be non-null.",
)


class ConnectorSpecification(BaseModel):
class Config:
extra = Extra.allow
Expand All @@ -119,6 +138,7 @@ class Config:
supported_destination_sync_modes: Optional[List[DestinationSyncMode]] = Field(
None, description="List of destination sync modes supported by the connector"
)
authSpecification: Optional[AuthSpecification] = None


class AirbyteStream(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-shopify/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ COPY source_shopify ./source_shopify
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.13
LABEL io.airbyte.version=0.1.14
LABEL io.airbyte.name=airbyte/source-shopify
Original file line number Diff line number Diff line change
Expand Up @@ -1009,10 +1009,134 @@
}
},
"duties": {
"type": ["null", "array"]
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"id": {
"type": ["null", "string"]
},
"harmonized_system_code": {
"type": ["null", "string"]
},
"country_code_of_origin": {
"type": ["null", "string"]
},
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"tax_lines": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"title": {
"type": ["null", "string"]
},
"price": {
"type": ["null", "string"]
},
"rate": {
"type": ["null", "number"]
},
"price_set": {
"type": ["null", "object"],
"properties": {
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
}
}
},
"channel_liable": {
"type": ["null", "boolean"]
}
}
}
},
"admin_graphql_api_id": {
"type": ["null", "string"]
}
}
}
},
"discount_allocations": {
"type": ["null", "array"]
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"discount_application_index": {
"type": ["null", "number"]
},
"amount_set": {
"type": ["null", "object"],
"properties": {
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
}
}
}
}
}
}
}
}
Expand Down Expand Up @@ -1248,10 +1372,134 @@
}
},
"duties": {
"type": ["null", "array"]
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"id": {
"type": ["null", "string"]
},
"harmonized_system_code": {
"type": ["null", "string"]
},
"country_code_of_origin": {
"type": ["null", "string"]
},
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"tax_lines": {
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"title": {
"type": ["null", "string"]
},
"price": {
"type": ["null", "string"]
},
"rate": {
"type": ["null", "number"]
},
"price_set": {
"type": ["null", "object"],
"properties": {
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
}
}
},
"channel_liable": {
"type": ["null", "boolean"]
}
}
}
},
"admin_graphql_api_id": {
"type": ["null", "string"]
}
}
}
},
"discount_allocations": {
"type": ["null", "array"]
"type": ["null", "array"],
"items": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"discount_application_index": {
"type": ["null", "number"]
},
"amount_set": {
"type": ["null", "object"],
"properties": {
"shop_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
},
"presentment_money": {
"type": ["null", "object"],
"properties": {
"amount": {
"type": ["null", "string"]
},
"currency_code": {
"type": ["null", "string"]
}
}
}
}
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,13 @@ definitions:
type: object
properties:
oauthFlowInitParameters:
description: "Pointers to the fields in the ConnectorSpecification which are needed to obtain the initial refresh/access tokens for the OAuth flow.
Each inner array represents the path in the ConnectorSpecification of the referenced field.
For example.
Assume the ConnectorSpecification contains params 'app_secret', 'app_id' which are needed to get the initial refresh token.
If they are not nested in the config, then the array would look like this [['app_secret'], ['app_id']]
If they are nested inside, say, an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]"
description:
"Pointers to the fields in the ConnectorSpecification which are needed to obtain the initial refresh/access tokens for the OAuth flow.
Each inner array represents the path in the ConnectorSpecification of the referenced field.
For example.
Assume the ConnectorSpecification contains params 'app_secret', 'app_id' which are needed to get the initial refresh token.
If they are not nested in the config, then the array would look like this [['app_secret'], ['app_id']]
If they are nested inside, say, an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]"
type: array
items:
description: A list of strings which describe the path inside a JSON object for finding the
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/shopify.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ With given error message the sync operation is still goes on, but will require m

| Version | Date | Pull Request | Subject |
| :------ | :-------- | :----- | :------ |
| 0.1.14 | 2021-09-02 | [5801](https://github.com/airbytehq/airbyte/pull/5801) | Fixed `line_items/discount allocations` & `duties` parts of `orders` schema |
| 0.1.13 | 2021-08-17 | [5470](https://github.com/airbytehq/airbyte/pull/5470) | Fixed rate limits throttling |
| 0.1.12 | 2021-08-09 | [5276](https://github.com/airbytehq/airbyte/pull/5276) | Add status property to product schema |
| 0.1.11 | 2021-07-23 | [4943](https://github.com/airbytehq/airbyte/pull/4943) | Fix products schema up to API 2021-07 |
Expand Down

0 comments on commit 9c05308

Please sign in to comment.