vtexpy 0.0.0b29__py3-none-any.whl → 0.0.0b31__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.
- vtex/_api/base.py +6 -31
- vtex/_api/orders.py +4 -8
- vtex/_api/payments_gateway.py +4 -2
- {vtexpy-0.0.0b29.dist-info → vtexpy-0.0.0b31.dist-info}/METADATA +1 -1
- {vtexpy-0.0.0b29.dist-info → vtexpy-0.0.0b31.dist-info}/RECORD +7 -7
- {vtexpy-0.0.0b29.dist-info → vtexpy-0.0.0b31.dist-info}/LICENSE +0 -0
- {vtexpy-0.0.0b29.dist-info → vtexpy-0.0.0b31.dist-info}/WHEEL +0 -0
vtex/_api/base.py
CHANGED
|
@@ -126,26 +126,10 @@ class BaseAPI:
|
|
|
126
126
|
rate_limit
|
|
127
127
|
and rate_limit_key
|
|
128
128
|
and rate_limiter
|
|
129
|
-
and not rate_limiter.test(
|
|
130
|
-
rate_limit,
|
|
131
|
-
request_config.account_name,
|
|
132
|
-
rate_limit_key,
|
|
133
|
-
)
|
|
129
|
+
and not rate_limiter.test(rate_limit, rate_limit_key)
|
|
134
130
|
):
|
|
135
131
|
sleep(1)
|
|
136
|
-
self.logger.info(
|
|
137
|
-
f"{rate_limiter} limited {request_config.account_name} on "
|
|
138
|
-
f"{rate_limit_key}",
|
|
139
|
-
extra={
|
|
140
|
-
"account_name": request_config.account_name,
|
|
141
|
-
"rate_limit_key": rate_limit_key,
|
|
142
|
-
"remaining": rate_limiter.get_window_stats(
|
|
143
|
-
rate_limit,
|
|
144
|
-
request_config.account_name,
|
|
145
|
-
rate_limit_key,
|
|
146
|
-
).remaining,
|
|
147
|
-
},
|
|
148
|
-
)
|
|
132
|
+
self.logger.info(f"{rate_limiter} limited {rate_limit_key}")
|
|
149
133
|
|
|
150
134
|
try:
|
|
151
135
|
response = client.request(
|
|
@@ -161,22 +145,13 @@ class BaseAPI:
|
|
|
161
145
|
)
|
|
162
146
|
finally:
|
|
163
147
|
if rate_limit and rate_limit_key and rate_limiter:
|
|
164
|
-
rate_limiter.hit(
|
|
148
|
+
rate_limiter.hit(rate_limit, rate_limit_key)
|
|
149
|
+
remaining = rate_limiter.get_window_stats(
|
|
165
150
|
rate_limit,
|
|
166
|
-
request_config.account_name,
|
|
167
151
|
rate_limit_key,
|
|
168
|
-
)
|
|
152
|
+
).remaining
|
|
169
153
|
self.logger.info(
|
|
170
|
-
"
|
|
171
|
-
extra={
|
|
172
|
-
"account_name": request_config.account_name,
|
|
173
|
-
"rate_limit_key": rate_limit_key,
|
|
174
|
-
"remaining": rate_limiter.get_window_stats(
|
|
175
|
-
rate_limit,
|
|
176
|
-
request_config.account_name,
|
|
177
|
-
rate_limit_key,
|
|
178
|
-
).remaining,
|
|
179
|
-
},
|
|
154
|
+
f"Remaining requests for {rate_limit_key}: {remaining}",
|
|
180
155
|
)
|
|
181
156
|
|
|
182
157
|
response.request.headers = Headers(
|
vtex/_api/orders.py
CHANGED
|
@@ -88,8 +88,8 @@ class OrdersAPI(BaseAPI):
|
|
|
88
88
|
environment=self.ENVIRONMENT,
|
|
89
89
|
params=params,
|
|
90
90
|
config=self.client.config.with_overrides(**kwargs),
|
|
91
|
-
rate_limit=parse("
|
|
92
|
-
rate_limit_key="orders",
|
|
91
|
+
rate_limit=parse("3400 per minute"),
|
|
92
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
93
93
|
response_class=VTEXPaginatedItemsResponse[Any, Any],
|
|
94
94
|
)
|
|
95
95
|
|
|
@@ -105,8 +105,8 @@ class OrdersAPI(BaseAPI):
|
|
|
105
105
|
endpoint=f"/api/oms/pvt/orders/{order_id}",
|
|
106
106
|
environment=self.ENVIRONMENT,
|
|
107
107
|
config=self.client.config.with_overrides(**kwargs),
|
|
108
|
-
rate_limit=parse("
|
|
109
|
-
rate_limit_key="orders",
|
|
108
|
+
rate_limit=parse("5900 per minute"),
|
|
109
|
+
rate_limit_key=f"{self.client.config.account_name}:orders",
|
|
110
110
|
response_class=VTEXDataResponse[Any],
|
|
111
111
|
)
|
|
112
112
|
|
|
@@ -126,8 +126,6 @@ class OrdersAPI(BaseAPI):
|
|
|
126
126
|
),
|
|
127
127
|
},
|
|
128
128
|
config=self.client.config.with_overrides(**kwargs),
|
|
129
|
-
rate_limit=parse("4500 per minute"),
|
|
130
|
-
rate_limit_key="orders",
|
|
131
129
|
response_class=VTEXItemsResponse[Any, Any],
|
|
132
130
|
)
|
|
133
131
|
|
|
@@ -152,7 +150,5 @@ class OrdersAPI(BaseAPI):
|
|
|
152
150
|
environment=self.ENVIRONMENT,
|
|
153
151
|
json={"handles": handles},
|
|
154
152
|
config=self.client.config.with_overrides(**kwargs),
|
|
155
|
-
rate_limit=parse("4500 per minute"),
|
|
156
|
-
rate_limit_key="orders",
|
|
157
153
|
response_class=VTEXDataResponse[Any],
|
|
158
154
|
)
|
vtex/_api/payments_gateway.py
CHANGED
|
@@ -37,8 +37,10 @@ class PaymentsGatewayAPI(BaseAPI):
|
|
|
37
37
|
endpoint=f"/api/pvt/transactions/{transaction_id}/interactions",
|
|
38
38
|
environment=self.ENVIRONMENT,
|
|
39
39
|
config=self.client.config.with_overrides(**kwargs),
|
|
40
|
-
rate_limit=parse("
|
|
41
|
-
rate_limit_key=
|
|
40
|
+
rate_limit=parse("3900 per minute"),
|
|
41
|
+
rate_limit_key=(
|
|
42
|
+
f"{self.client.config.account_name}:transaction_interactions"
|
|
43
|
+
),
|
|
42
44
|
response_class=VTEXItemsResponse[Any, Any],
|
|
43
45
|
)
|
|
44
46
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
vtex/__init__.py,sha256=SLnqpZa19ISSQ9LDaCVLDAj-OxFlgVkQyEknydu20VU,636
|
|
2
2
|
vtex/_api/__init__.py,sha256=2OarRhTDq1Oj65v7WkMr3Bi7EAnQMPm2Ypgv9flzE6c,385
|
|
3
|
-
vtex/_api/base.py,sha256=
|
|
3
|
+
vtex/_api/base.py,sha256=wpgls_iWlIOjERSaw4T4kUp3xNQXk7CkvnohI-k4Fxg,8554
|
|
4
4
|
vtex/_api/catalog.py,sha256=UaVWI9Vhhu6wHejO851hVSDmcLUDtfwcnsGasZGEKiw,4661
|
|
5
5
|
vtex/_api/checkout.py,sha256=ViFJq2GZRAA6yyjaFC3rz0oMYKxzBIsi8tzGKCWRxQ0,1693
|
|
6
6
|
vtex/_api/custom.py,sha256=3yIwTj1Ikf30oq0GzdNz0P9APYxjBeoRvdlbh0rT9gs,2930
|
|
7
7
|
vtex/_api/license_manager.py,sha256=GAdRpizeGUFem-up-SYNzehs5uBY0elTElJ9bEQUlFo,2805
|
|
8
8
|
vtex/_api/logistics.py,sha256=bd55wipbnql3OFnDCBsjP0-jp7OY6FP10Yz5acOsG2o,5052
|
|
9
9
|
vtex/_api/master_data.py,sha256=HGoWr908iQYb0kzq_KNvKyWKtaNQ9vTv7CXxvKey0AM,2046
|
|
10
|
-
vtex/_api/orders.py,sha256=
|
|
11
|
-
vtex/_api/payments_gateway.py,sha256=
|
|
10
|
+
vtex/_api/orders.py,sha256=K38oO46kOIHuIiCz8ZSVc69e98JvFv3bDcyv1HG2QcQ,5404
|
|
11
|
+
vtex/_api/payments_gateway.py,sha256=5F7Ty-yllgEPhvyPG3ruOm8DjCut8Z5uid5trF73DtU,4001
|
|
12
12
|
vtex/_api/pricing.py,sha256=gZX9MmUKsj0iPjJKT2-Ko9dzT6rZR_DR4ruqs1c9IdY,535
|
|
13
13
|
vtex/_api/promotions_and_taxes.py,sha256=wtNxTrc36u10AMbOq2NMtOVp1HLzrBWxqJDmBYpdXXY,1893
|
|
14
14
|
vtex/_api/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -25,7 +25,7 @@ vtex/_types.py,sha256=xrqHzmrc0IhE5fc1aGf0StCm3BQbVFyk3LG4Hd7Wd2Q,631
|
|
|
25
25
|
vtex/_utils.py,sha256=ngC2rRdhBO5cjAAByS0_2LMeXKsI6rnfiHGP96U0m88,3215
|
|
26
26
|
vtex/_vtex.py,sha256=IBPVQ__xiQGJEoht4oCnd-pAYKNJDrKoU06yieQL84o,2342
|
|
27
27
|
vtex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
vtexpy-0.0.
|
|
29
|
-
vtexpy-0.0.
|
|
30
|
-
vtexpy-0.0.
|
|
31
|
-
vtexpy-0.0.
|
|
28
|
+
vtexpy-0.0.0b31.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
29
|
+
vtexpy-0.0.0b31.dist-info/METADATA,sha256=cV0ZIndTKngkennpj3LyuKPfDGB0CJmBycbcDo_N6U4,3528
|
|
30
|
+
vtexpy-0.0.0b31.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
31
|
+
vtexpy-0.0.0b31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|