shopware-api-client 1.0.101__tar.gz → 1.0.103__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.

Potentially problematic release.


This version of shopware-api-client might be problematic. Click here for more details.

Files changed (114) hide show
  1. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/PKG-INFO +1 -1
  2. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/pyproject.toml +1 -1
  3. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/base.py +11 -10
  4. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/client.py +2 -2
  5. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/LICENSE +0 -0
  6. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/README.md +0 -0
  7. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/__init__.py +0 -0
  8. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/config.py +0 -0
  9. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/__init__.py +0 -0
  10. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/__init__.py +0 -0
  11. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/commercial/__init__.py +0 -0
  12. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/commercial/b2b_components_role.py +0 -0
  13. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/commercial/b2b_employee.py +0 -0
  14. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/commercial/dynamic_access.py +0 -0
  15. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/__init__.py +0 -0
  16. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/acl_role.py +0 -0
  17. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/api_info.py +0 -0
  18. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/app.py +0 -0
  19. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/app_script_condition.py +0 -0
  20. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/category.py +0 -0
  21. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/cms_block.py +0 -0
  22. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/cms_page.py +0 -0
  23. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/cms_section.py +0 -0
  24. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/cms_slot.py +0 -0
  25. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/country.py +0 -0
  26. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/country_state.py +0 -0
  27. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/currency.py +0 -0
  28. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/currency_country_rounding.py +0 -0
  29. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/custom_entity.py +0 -0
  30. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/custom_field.py +0 -0
  31. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer.py +0 -0
  32. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer_address.py +0 -0
  33. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer_group.py +0 -0
  34. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer_recovery.py +0 -0
  35. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer_wishlist.py +0 -0
  36. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/customer_wishlist_product.py +0 -0
  37. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/delivery_time.py +0 -0
  38. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/document.py +0 -0
  39. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/document_base_config.py +0 -0
  40. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/document_base_config_sales_channel.py +0 -0
  41. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/document_type.py +0 -0
  42. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/integration.py +0 -0
  43. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/landing_page.py +0 -0
  44. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/language.py +0 -0
  45. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/locale.py +0 -0
  46. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/main_category.py +0 -0
  47. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media.py +0 -0
  48. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media_default_folder.py +0 -0
  49. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media_folder.py +0 -0
  50. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media_folder_configuration.py +0 -0
  51. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media_thumbnail.py +0 -0
  52. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/media_thumbnail_size.py +0 -0
  53. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order.py +0 -0
  54. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_address.py +0 -0
  55. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_customer.py +0 -0
  56. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_delivery.py +0 -0
  57. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_delivery_position.py +0 -0
  58. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_line_item.py +0 -0
  59. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_line_item_download.py +0 -0
  60. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_transaction.py +0 -0
  61. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_transaction_capture.py +0 -0
  62. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_transaction_capture_refund.py +0 -0
  63. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/order_transaction_capture_refund_position.py +0 -0
  64. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/payment_method.py +0 -0
  65. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product.py +0 -0
  66. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_configurator_setting.py +0 -0
  67. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_cross_selling.py +0 -0
  68. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_cross_selling_assigned_products.py +0 -0
  69. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_download.py +0 -0
  70. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_export.py +0 -0
  71. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_feature_set.py +0 -0
  72. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_manufacturer.py +0 -0
  73. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_media.py +0 -0
  74. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_price.py +0 -0
  75. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_review.py +0 -0
  76. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_search_keyword.py +0 -0
  77. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_stream.py +0 -0
  78. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_visibility.py +0 -0
  79. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/product_warehouse.py +0 -0
  80. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/promotion.py +0 -0
  81. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/promotion_discount.py +0 -0
  82. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/promotion_discount_prices.py +0 -0
  83. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/property_group.py +0 -0
  84. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/property_group_option.py +0 -0
  85. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/rule.py +0 -0
  86. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/rule_condition.py +0 -0
  87. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/sales_channel.py +0 -0
  88. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/sales_channel_domain.py +0 -0
  89. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/salutation.py +0 -0
  90. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/seo_url.py +0 -0
  91. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/shipping_method.py +0 -0
  92. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/state_machine.py +0 -0
  93. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/state_machine_history.py +0 -0
  94. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/state_machine_state.py +0 -0
  95. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/state_machine_transition.py +0 -0
  96. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/system_config.py +0 -0
  97. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/tag.py +0 -0
  98. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/tax.py +0 -0
  99. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/tax_rule.py +0 -0
  100. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/tax_rule_type.py +0 -0
  101. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/unit.py +0 -0
  102. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/user.py +0 -0
  103. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/warehouse.py +0 -0
  104. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/warehouse_group.py +0 -0
  105. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/admin/core/warehouse_group_warehouse.py +0 -0
  106. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/base_fields.py +0 -0
  107. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/relations.py +0 -0
  108. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/store/__init__.py +0 -0
  109. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/store/core/__init__.py +0 -0
  110. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/store/core/address.py +0 -0
  111. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/endpoints/store/core/cart.py +0 -0
  112. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/exceptions.py +0 -0
  113. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/logging.py +0 -0
  114. {shopware_api_client-1.0.101 → shopware_api_client-1.0.103}/src/shopware_api_client/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: shopware-api-client
3
- Version: 1.0.101
3
+ Version: 1.0.103
4
4
  Summary: An api client for the Shopware API
5
5
  License: MIT
6
6
  Keywords: shopware,api,client
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "shopware-api-client"
3
3
  description = " An api client for the Shopware API"
4
- version = "1.0.101"
4
+ version = "1.0.103"
5
5
  license = "MIT"
6
6
  authors = ["GWS Gesellschaft für Warenwirtschafts-Systeme mbH <ebusiness@gws.ms>"]
7
7
  readme = "README.md"
@@ -44,6 +44,8 @@ from .exceptions import (
44
44
  )
45
45
  from .logging import logger
46
46
 
47
+ APPLICATION_JSON = "application/json"
48
+
47
49
  EndpointClass = TypeVar("EndpointClass", bound="EndpointBase[Any]")
48
50
  ModelClass = TypeVar("ModelClass", bound="ApiModelBase[Any]")
49
51
 
@@ -63,7 +65,8 @@ class ClientBase:
63
65
  self.raw = raw
64
66
 
65
67
  async def __aenter__(self) -> "Self":
66
- self.http_client
68
+ client = self.http_client
69
+ assert isinstance(client, httpx.AsyncClient), "http_client must be an instance of httpx.AsyncClient"
67
70
  return self
68
71
 
69
72
  async def __aexit__(self, *args: Any) -> None:
@@ -86,15 +89,13 @@ class ClientBase:
86
89
 
87
90
  @cached_property
88
91
  def http_client(self) -> httpx.AsyncClient:
89
- return self._get_client()
92
+ return self._get_http_client()
90
93
 
91
- def _get_client(self) -> httpx.AsyncClient:
92
- # FIXME: rename _get_client -> _get_http_client to avoid confusion with ApiModelBase._get_client
93
- # (fix middleware usage of private method usage first)
94
+ def _get_http_client(self) -> httpx.AsyncClient:
94
95
  raise NotImplementedError()
95
96
 
96
97
  def _get_headers(self) -> dict[str, str]:
97
- headers = {"Content-Type": "application/json", "Accept": "application/json"}
98
+ headers = {"Content-Type": APPLICATION_JSON, "Accept": APPLICATION_JSON}
98
99
 
99
100
  if self.language_id is not None:
100
101
  headers["sw-language-id"] = str(self.language_id)
@@ -154,7 +155,7 @@ class ClientBase:
154
155
  raise ValueError("`errors` attribute in json not a list/tuple!")
155
156
 
156
157
  error: SWAPIError | SWAPIErrorList = SWAPIError.from_errors(errors)
157
- except (json.JSONDecodeError, ValueError):
158
+ except ValueError:
158
159
  error: SWAPIError | SWAPIErrorList = SWAPIError.from_response(response) # type: ignore
159
160
 
160
161
  if isinstance(error, SWAPIErrorList) and len(error.errors) == 1:
@@ -175,10 +176,11 @@ class ClientBase:
175
176
 
176
177
  await self.retry_sleep(retry_wait_base, retry_count)
177
178
  retry_count += 1
178
- else:
179
+ elif response.status_code == 200 and response.headers.get("Content-Type", "").startswith(APPLICATION_JSON):
179
180
  # guard against "200 okay" responses with malformed json
180
181
  try:
181
182
  setattr(response, "json_cached", response.json())
183
+ return response
182
184
  except json.JSONDecodeError:
183
185
  # retries exhausted?
184
186
  if retry_count >= retries:
@@ -193,8 +195,7 @@ class ClientBase:
193
195
  # schedule retry
194
196
  await self.retry_sleep(retry_wait_base, retry_count)
195
197
  retry_count += 1
196
- continue
197
-
198
+ else:
198
199
  return response
199
200
 
200
201
  async def get(self, relative_url: str, **kwargs: Any) -> httpx.Response:
@@ -19,7 +19,7 @@ class AdminClient(ClientBase, AdminEndpoints):
19
19
  self._client: httpx.AsyncClient | None = None
20
20
  self.init_endpoints(self)
21
21
 
22
- def _get_client(self) -> httpx.AsyncClient:
22
+ def _get_http_client(self) -> httpx.AsyncClient:
23
23
  if self._client is None:
24
24
  self._client = httpx.AsyncClient(
25
25
  event_hooks={"request": [self.log_request], "response": [self.log_response]}
@@ -180,7 +180,7 @@ class StoreClient(ClientBase, StoreEndpoints):
180
180
  self._client: httpx.AsyncClient | None = None
181
181
  self.init_endpoints(self)
182
182
 
183
- def _get_client(self) -> httpx.AsyncClient:
183
+ def _get_http_client(self) -> httpx.AsyncClient:
184
184
  if self._client is None:
185
185
  self._client = httpx.AsyncClient(
186
186
  event_hooks={"request": [self.log_request], "response": [self.log_response]},