@daemux/store-automator 0.10.24 → 0.10.25
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.
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "App Store & Google Play automation for Flutter apps",
|
|
8
|
-
"version": "0.10.
|
|
8
|
+
"version": "0.10.25"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "store-automator",
|
|
13
13
|
"source": "./plugins/store-automator",
|
|
14
14
|
"description": "3 agents for app store publishing: reviewer, meta-creator, media-designer",
|
|
15
|
-
"version": "0.10.
|
|
15
|
+
"version": "0.10.25",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"flutter",
|
|
18
18
|
"app-store",
|
package/package.json
CHANGED
|
@@ -116,11 +116,21 @@ def get_price_points_for_territory(
|
|
|
116
116
|
def find_price_point_by_amount(
|
|
117
117
|
price_points: list, amount_str: str,
|
|
118
118
|
) -> dict | None:
|
|
119
|
-
"""Find a price point matching the given customer price
|
|
119
|
+
"""Find a price point matching the given customer price (numeric comparison).
|
|
120
|
+
|
|
121
|
+
Apple's API may return prices with trailing zeros (e.g. "9.990" instead
|
|
122
|
+
of "9.99"), so we compare as floats with a small tolerance rather than
|
|
123
|
+
doing an exact string match.
|
|
124
|
+
"""
|
|
120
125
|
for pp in price_points:
|
|
121
126
|
customer_price = pp.get("attributes", {}).get("customerPrice", "")
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
try:
|
|
128
|
+
api_price = float(customer_price)
|
|
129
|
+
target_price = float(amount_str)
|
|
130
|
+
if abs(api_price - target_price) < 0.01:
|
|
131
|
+
return pp
|
|
132
|
+
except (ValueError, TypeError):
|
|
133
|
+
continue
|
|
124
134
|
return None
|
|
125
135
|
|
|
126
136
|
|
|
@@ -158,7 +158,15 @@ def _sync_pricing(headers: dict, sub_id: str, sub_config: dict) -> None:
|
|
|
158
158
|
price_points = get_price_points_for_territory(headers, sub_id, territory)
|
|
159
159
|
point = find_price_point_by_amount(price_points, amount)
|
|
160
160
|
if not point:
|
|
161
|
-
|
|
161
|
+
sample = [
|
|
162
|
+
pp.get("attributes", {}).get("customerPrice", "?")
|
|
163
|
+
for pp in price_points[:5]
|
|
164
|
+
]
|
|
165
|
+
print(
|
|
166
|
+
f" WARNING: No price point matching {amount} for {territory}"
|
|
167
|
+
f" (API returned {len(price_points)} points, first prices: {sample})",
|
|
168
|
+
file=sys.stderr,
|
|
169
|
+
)
|
|
162
170
|
continue
|
|
163
171
|
result = create_subscription_price(headers, sub_id, point["id"])
|
|
164
172
|
if result:
|