airbyte-source-shopify 2.4.14.dev202407181247__py3-none-any.whl → 3.1.0__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.
Files changed (29) hide show
  1. {airbyte_source_shopify-2.4.14.dev202407181247.dist-info → airbyte_source_shopify-3.1.0.dist-info}/METADATA +4 -4
  2. {airbyte_source_shopify-2.4.14.dev202407181247.dist-info → airbyte_source_shopify-3.1.0.dist-info}/RECORD +25 -27
  3. {airbyte_source_shopify-2.4.14.dev202407181247.dist-info → airbyte_source_shopify-3.1.0.dist-info}/WHEEL +1 -1
  4. source_shopify/auth.py +0 -1
  5. source_shopify/config_migrations.py +4 -1
  6. source_shopify/http_request.py +4 -2
  7. source_shopify/schemas/countries.json +7 -19
  8. source_shopify/schemas/customer_journey_summary.json +228 -148
  9. source_shopify/schemas/deleted_products.json +27 -0
  10. source_shopify/schemas/orders.json +38 -0
  11. source_shopify/schemas/product_variants.json +26 -8
  12. source_shopify/schemas/profile_location_groups.json +10 -0
  13. source_shopify/scopes.py +7 -6
  14. source_shopify/shopify_graphql/bulk/exceptions.py +6 -1
  15. source_shopify/shopify_graphql/bulk/job.py +173 -65
  16. source_shopify/shopify_graphql/bulk/query.py +440 -88
  17. source_shopify/shopify_graphql/bulk/record.py +260 -29
  18. source_shopify/shopify_graphql/bulk/retry.py +12 -12
  19. source_shopify/shopify_graphql/bulk/tools.py +17 -2
  20. source_shopify/source.py +6 -10
  21. source_shopify/spec.json +11 -5
  22. source_shopify/streams/base_streams.py +181 -54
  23. source_shopify/streams/streams.py +211 -58
  24. source_shopify/utils.py +47 -12
  25. source_shopify/schemas/customer_saved_search.json +0 -32
  26. source_shopify/schemas/products_graph_ql.json +0 -123
  27. source_shopify/shopify_graphql/graphql.py +0 -64
  28. source_shopify/shopify_graphql/schema.py +0 -29442
  29. {airbyte_source_shopify-2.4.14.dev202407181247.dist-info → airbyte_source_shopify-3.1.0.dist-info}/entry_points.txt +0 -0
@@ -1,64 +0,0 @@
1
- #
2
- # Copyright (c) 2023 Airbyte, Inc., all rights reserved.
3
- #
4
-
5
-
6
- from typing import Optional
7
-
8
- import sgqlc.operation
9
-
10
- from . import schema
11
-
12
- _schema = schema
13
- _schema_root = _schema.shopify_schema
14
-
15
-
16
- # the graphql api requires the query filter to be snake case even though the column returned is camel case
17
- def _camel_to_snake(camel_case: str):
18
- snake_case = []
19
- for char in camel_case:
20
- if char.isupper():
21
- snake_case.append("_" + char.lower())
22
- else:
23
- snake_case.append(char)
24
- return "".join(snake_case).lstrip("_")
25
-
26
-
27
- def get_query_products(first: int, filter_field: str, filter_value: str, next_page_token: Optional[str]):
28
- op = sgqlc.operation.Operation(_schema_root.query_type)
29
- snake_case_filter_field = _camel_to_snake(filter_field)
30
- products_args = {
31
- "first": first,
32
- "query": f"{snake_case_filter_field}:>'{filter_value}'" if filter_value else None,
33
- "after": next_page_token,
34
- }
35
- products = op.products(**products_args)
36
- products.nodes.id()
37
- products.nodes.title()
38
- products.nodes.updated_at()
39
- products.nodes.created_at()
40
- products.nodes.published_at()
41
- products.nodes.status()
42
- products.nodes.vendor()
43
- products.nodes.product_type()
44
- products.nodes.tags()
45
- products.nodes.options()
46
- products.nodes.options().id()
47
- products.nodes.options().name()
48
- products.nodes.options().position()
49
- products.nodes.options().values()
50
- products.nodes.handle()
51
- products.nodes.description()
52
- products.nodes.tracks_inventory()
53
- products.nodes.total_inventory()
54
- products.nodes.total_variants()
55
- products.nodes.online_store_url()
56
- products.nodes.online_store_preview_url()
57
- products.nodes.description_html()
58
- products.nodes.is_gift_card()
59
- products.nodes.legacy_resource_id()
60
- products.nodes.media_count()
61
- products.page_info()
62
- products.page_info.has_next_page()
63
- products.page_info.end_cursor()
64
- return str(op)