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
@@ -0,0 +1,27 @@
1
+ {
2
+ "type": ["object", "null"],
3
+ "additionalProperties": true,
4
+ "properties": {
5
+ "id": {
6
+ "description": "The unique identifier of the deleted product.",
7
+ "type": ["null", "integer"]
8
+ },
9
+ "deleted_at": {
10
+ "description": "The date and time when the product was deleted.",
11
+ "type": ["null", "string"],
12
+ "format": "date-time"
13
+ },
14
+ "deleted_message": {
15
+ "description": "Message related to the deletion of the product.",
16
+ "type": ["null", "string"]
17
+ },
18
+ "deleted_description": {
19
+ "description": "Description of the reason for deletion.",
20
+ "type": ["null", "string"]
21
+ },
22
+ "shop_url": {
23
+ "description": "The URL of the shop where the product was listed.",
24
+ "type": ["null", "string"]
25
+ }
26
+ }
27
+ }
@@ -259,6 +259,10 @@
259
259
  "description": "The ID of the device used to place the order",
260
260
  "type": ["null", "string"]
261
261
  },
262
+ "duties_included": {
263
+ "description": "Whether duties included in the subtotal price of the order.",
264
+ "type": ["null", "boolean"]
265
+ },
262
266
  "discount_applications": {
263
267
  "type": ["null", "array"],
264
268
  "items": {
@@ -340,6 +344,10 @@
340
344
  "description": "The app ID of the merchant of record",
341
345
  "type": ["null", "string"]
342
346
  },
347
+ "merchant_business_entity_id": {
348
+ "description": "The business entity ID of the merchant of record.",
349
+ "type": ["null", "string"]
350
+ },
343
351
  "name": {
344
352
  "description": "The name of the order",
345
353
  "type": ["null", "string"]
@@ -418,6 +426,36 @@
418
426
  "description": "The terms of payment for the order",
419
427
  "type": ["null", "string"]
420
428
  },
429
+ "total_cash_rounding_payment_adjustment_set": {
430
+ "description": "The money set that represents the amount adjusted on the order total due to cash rounding.",
431
+ "type": ["null", "object"],
432
+ "properties": {
433
+ "presentment_money": {
434
+ "description": "The amount in the customer's presentment currency.",
435
+ "type": ["null", "object"],
436
+ "properties": {
437
+ "amount": {
438
+ "type": ["null", "string"]
439
+ },
440
+ "currency_code": {
441
+ "type": ["null", "string"]
442
+ }
443
+ }
444
+ },
445
+ "shop_money": {
446
+ "description": "The amount in the shop's local currency.",
447
+ "type": ["null", "object"],
448
+ "properties": {
449
+ "amount": {
450
+ "type": ["null", "string"]
451
+ },
452
+ "currency_code": {
453
+ "type": ["null", "string"]
454
+ }
455
+ }
456
+ }
457
+ }
458
+ },
421
459
  "phone": {
422
460
  "description": "The phone number of the customer",
423
461
  "type": ["null", "string"]
@@ -34,14 +34,6 @@
34
34
  "description": "The original price of the variant before any discount",
35
35
  "type": ["null", "string"]
36
36
  },
37
- "fulfillment_service": {
38
- "description": "The fulfillment service for the variant",
39
- "type": ["null", "string"]
40
- },
41
- "inventory_management": {
42
- "description": "The method used to manage inventory for the variant",
43
- "type": ["null", "string"]
44
- },
45
37
  "option1": {
46
38
  "description": "The value for option 1 of the variant",
47
39
  "type": ["null", "string"]
@@ -99,6 +91,20 @@
99
91
  "id": {
100
92
  "description": "A globally-unique ID of an image representation of the swatch.",
101
93
  "type": ["null", "string"]
94
+ },
95
+ "image": {
96
+ "description": "An image associated with the product variant.",
97
+ "type": ["null", "object"],
98
+ "properties": {
99
+ "src": {
100
+ "description": "The location of the image as URL associated with the product variant option.",
101
+ "type": ["null", "string"]
102
+ },
103
+ "url": {
104
+ "description": "The image URL associated with the product variant option.",
105
+ "type": ["null", "string"]
106
+ }
107
+ }
102
108
  }
103
109
  }
104
110
  }
@@ -135,6 +141,14 @@
135
141
  "description": "The unique identifier for the image associated with the variant",
136
142
  "type": ["null", "integer"]
137
143
  },
144
+ "image_src": {
145
+ "description": "The location of the image as URL.",
146
+ "type": ["null", "string"]
147
+ },
148
+ "image_url": {
149
+ "description": "The location of the image as URL.",
150
+ "type": ["null", "string"]
151
+ },
138
152
  "weight": {
139
153
  "description": "The weight of the variant",
140
154
  "type": ["null", "number"]
@@ -214,6 +228,10 @@
214
228
  "tax_code": {
215
229
  "description": "The tax code for the product variant.",
216
230
  "type": ["null", "string"]
231
+ },
232
+ "tracked": {
233
+ "description": "Whether inventory levels are tracked for the item.",
234
+ "type": ["null", "boolean"]
217
235
  }
218
236
  }
219
237
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "type": ["null", "object"],
3
+ "additionalProperties": true,
4
+ "properties": {
5
+ "id": {
6
+ "description": "ID of the location group.",
7
+ "type": ["null", "string"]
8
+ }
9
+ }
10
+ }
source_shopify/scopes.py CHANGED
@@ -7,17 +7,18 @@ import logging
7
7
  from typing import Any, Iterable, List, Mapping, Optional
8
8
 
9
9
  import requests
10
- from airbyte_cdk.sources.streams.http import HttpClient
11
10
  from requests.exceptions import InvalidURL, JSONDecodeError
12
11
 
12
+ from airbyte_cdk.sources.streams.http import HttpClient
13
+
13
14
  from .http_request import ShopifyErrorHandler
14
15
  from .utils import ShopifyAccessScopesError, ShopifyBadJsonError, ShopifyWrongShopNameError
15
16
 
17
+
16
18
  SCOPES_MAPPING: Mapping[str, set[str]] = {
17
19
  # SCOPE: read_customers
18
20
  "Customers": ("read_customers",),
19
21
  "MetafieldCustomers": ("read_customers",),
20
- "CustomerSavedSearch": ("read_customers",),
21
22
  "CustomerAddress": ("read_customers",),
22
23
  # SCOPE: read_orders
23
24
  "OrderAgreements": ("read_orders",),
@@ -36,14 +37,14 @@ SCOPES_MAPPING: Mapping[str, set[str]] = {
36
37
  "MetafieldDraftOrders": ("read_draft_orders",),
37
38
  # SCOPE: read_products
38
39
  "Products": ("read_products",),
39
- "ProductsGraphQl": ("read_products",),
40
+ "DeletedProducts": ("read_products",),
40
41
  "MetafieldProducts": ("read_products",),
41
42
  "ProductImages": ("read_products",),
42
43
  "MetafieldProductImages": ("read_products",),
43
44
  "MetafieldProductVariants": ("read_products",),
44
45
  "CustomCollections": ("read_products",),
45
46
  "Collects": ("read_products",),
46
- "ProductVariants": ("read_products",),
47
+ "ProductVariants": ("read_products", "read_inventory"),
47
48
  "MetafieldCollections": ("read_products",),
48
49
  "SmartCollections": ("read_products",),
49
50
  "MetafieldSmartCollections": ("read_products",),
@@ -72,17 +73,17 @@ SCOPES_MAPPING: Mapping[str, set[str]] = {
72
73
  "MetafieldArticles": ("read_online_store_pages",),
73
74
  "Blogs": ("read_online_store_pages",),
74
75
  "MetafieldBlogs": ("read_online_store_pages",),
76
+ # SCOPE: read_shipping
77
+ "Countries": ("read_shipping",),
75
78
  }
76
79
 
77
80
  ALWAYS_PERMITTED_STREAMS: List[str] = [
78
81
  "MetafieldShops",
79
82
  "Shop",
80
- "Countries",
81
83
  ]
82
84
 
83
85
 
84
86
  class ShopifyScopes:
85
-
86
87
  # define default logger
87
88
  logger = logging.getLogger("airbyte")
88
89
 
@@ -3,8 +3,8 @@
3
3
  #
4
4
 
5
5
 
6
+ from airbyte_cdk.models import FailureType
6
7
  from airbyte_cdk.utils import AirbyteTracedException
7
- from airbyte_protocol.models import FailureType
8
8
 
9
9
 
10
10
  class ShopifyBulkExceptions:
@@ -52,6 +52,11 @@ class ShopifyBulkExceptions:
52
52
 
53
53
  failure_type: FailureType = FailureType.transient_error
54
54
 
55
+ class BulkJobCheckpointCollisionError(BaseBulkException):
56
+ """Raised when an attempt to create a job using the `checkpointed cursor` value goes into inf.loop."""
57
+
58
+ failure_type: FailureType = FailureType.transient_error
59
+
55
60
  class BulkJobRedirectToOtherShopError(BaseBulkException):
56
61
  """Raised when the response contains another shop name"""
57
62