Commit 38cbefd
authored
fix(revenuecat): align tools and block with REST v1 API spec (#4488)
* fix(revenuecat): align tools and block with REST v1 API spec
- Validated all 10 tools and the block against context7 REST v1 docs
- Unwrap {value:{subscriber}} envelope across post-receipts, attributes,
entitlements, and Google subscription endpoints
- Trim entitlement output to documented fields (expires_date,
grace_period_expires_date, product_identifier, purchase_date)
- Add subscriber output fields: last_seen, original_application_version,
other_purchases, subscriber_attributes
- create_purchase: productId optional (Google-only required); add
introductoryPrice, attributes, updated_at_ms; surface customer + subscriber;
X-Platform required; presentedOfferingIdentifier and paymentMode
- update_subscriber_attributes: read response and surface subscriber;
note required updated_at_ms
- defer_google_subscription: enforce XOR(extendByDays, expiryTimeMs) and
1-365 range; expiryTimeMs as one-of alternative
- grant_entitlement: duration optional, added endTimeMs (one-of)
- refund_google_subscription: corrected endpoint to
/transactions/{storeTransactionId}/refund
- delete_customer: read 'deleted' field (was 'was_deleted')
- list_offerings: corrected X-Platform values
- get_customer: count active subscriptions by expiry/refund
- Added shared throwIfRevenueCatError helper for {code, message} envelope
- Moved type coercions from tools.config.tool to tools.config.params to
preserve dynamic refs
* docs
* fix(revenuecat): address PR review feedback
- create_purchase: wrap JSON.parse(attributes) with try/catch and clear error
- update_subscriber_attributes: drop subscriber output (endpoint returns
empty body) and guard JSON.parse on attributes
- grant_entitlement: throw when both duration and endTimeMs are provided,
matching defer_google_subscription behavior
* fix(revenuecat): tighten docs after sub-segment validation
- delete_customer: drop dead was_deleted fallback (docs specify 'deleted')
- grant_entitlement: mark duration + startTimeMs as deprecated, clarify
startTimeMs only affects expiration calc (not grant time)
- list_offerings: replace vague platform description with documented
X-Platform enum (ios, android, amazon, stripe, roku, paddle)
* docs
* fix(revenuecat): clear duration default when endTimeMs is provided
The duration dropdown defaults to 'monthly' so any user filling in the
advanced endTimeMs field would otherwise hit the XOR guard. Clear
duration in the params mapper so endTimeMs takes precedence.
* fix(revenuecat): clear extendByDays default when expiryTimeMs is provided
Mirror the duration/endTimeMs fix from 8204e89: when expiryTimeMs is
populated, clear extendByDays in the params mapper so the empty-string
form value does not trip the XOR guard. Also harden the tool-level XOR
checks in defer_google_subscription and grant_entitlement to treat empty
strings as undefined for direct (non-block) callers.
* fix(revenuecat): guard NaN in time-ms mappers and require integer days
- Block params mapper: only clear duration/extendByDays when the parsed
endTimeMs/expiryTimeMs is finite, so invalid input does not silently
discard the user's valid companion default
- defer_google_subscription: validate extendByDays as integer (was
Number.isFinite), matching the error message
* fix(revenuecat): fall back to Date.now() when request_date is malformed
A malformed request_date would parse to NaN, making every entitlement
and subscription compare false and silently zero active counts. Fall
back to Date.now() when the parsed value is not finite.
* fix(revenuecat): unwrap value envelope in list_offerings response
* improvement(revenuecat): include updated_at_ms in attributes placeholder and wand prompt1 parent d081ab2 commit 38cbefd
14 files changed
Lines changed: 656 additions & 286 deletions
File tree
- apps
- docs/content/docs/en/tools
- sim
- app/(landing)/integrations/data
- blocks/blocks
- tools/revenuecat
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10748 | 10748 | | |
10749 | 10749 | | |
10750 | 10750 | | |
10751 | | - | |
| 10751 | + | |
10752 | 10752 | | |
10753 | 10753 | | |
10754 | 10754 | | |
| |||
14173 | 14173 | | |
14174 | 14174 | | |
14175 | 14175 | | |
14176 | | - | |
| 14176 | + | |
14177 | 14177 | | |
14178 | 14178 | | |
14179 | 14179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
88 | 111 | | |
89 | 112 | | |
90 | 113 | | |
| |||
124 | 147 | | |
125 | 148 | | |
126 | 149 | | |
127 | | - | |
| 150 | + | |
128 | 151 | | |
129 | | - | |
| 152 | + | |
| 153 | + | |
130 | 154 | | |
131 | 155 | | |
132 | 156 | | |
| |||
139 | 163 | | |
140 | 164 | | |
141 | 165 | | |
142 | | - | |
143 | 166 | | |
144 | 167 | | |
145 | 168 | | |
| |||
168 | 191 | | |
169 | 192 | | |
170 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
171 | 249 | | |
172 | 250 | | |
173 | 251 | | |
| |||
192 | 270 | | |
193 | 271 | | |
194 | 272 | | |
| 273 | + | |
195 | 274 | | |
| 275 | + | |
| 276 | + | |
196 | 277 | | |
197 | 278 | | |
198 | 279 | | |
199 | 280 | | |
200 | 281 | | |
201 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
202 | 286 | | |
203 | 287 | | |
204 | 288 | | |
205 | 289 | | |
206 | 290 | | |
207 | | - | |
| 291 | + | |
208 | 292 | | |
209 | 293 | | |
210 | | - | |
| 294 | + | |
211 | 295 | | |
212 | 296 | | |
213 | 297 | | |
| |||
216 | 300 | | |
217 | 301 | | |
218 | 302 | | |
219 | | - | |
| 303 | + | |
220 | 304 | | |
221 | 305 | | |
222 | 306 | | |
223 | 307 | | |
224 | 308 | | |
225 | | - | |
| 309 | + | |
226 | 310 | | |
227 | | - | |
| 311 | + | |
228 | 312 | | |
229 | | - | |
| 313 | + | |
230 | 314 | | |
231 | 315 | | |
232 | 316 | | |
| |||
238 | 322 | | |
239 | 323 | | |
240 | 324 | | |
241 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
242 | 332 | | |
243 | 333 | | |
244 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
245 | 343 | | |
246 | 344 | | |
247 | 345 | | |
| |||
251 | 349 | | |
252 | 350 | | |
253 | 351 | | |
254 | | - | |
255 | 352 | | |
| 353 | + | |
| 354 | + | |
256 | 355 | | |
257 | 356 | | |
258 | 357 | | |
259 | 358 | | |
260 | 359 | | |
| 360 | + | |
261 | 361 | | |
262 | 362 | | |
263 | 363 | | |
| |||
274 | 374 | | |
275 | 375 | | |
276 | 376 | | |
277 | | - | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
278 | 380 | | |
279 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
280 | 387 | | |
281 | | - | |
282 | | - | |
| 388 | + | |
| 389 | + | |
283 | 390 | | |
284 | 391 | | |
285 | | - | |
| 392 | + | |
286 | 393 | | |
287 | 394 | | |
288 | | - | |
| 395 | + | |
289 | 396 | | |
290 | 397 | | |
291 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
292 | 416 | | |
293 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
294 | 421 | | |
295 | 422 | | |
296 | 423 | | |
| |||
302 | 429 | | |
303 | 430 | | |
304 | 431 | | |
305 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
306 | 436 | | |
307 | 437 | | |
308 | 438 | | |
309 | | - | |
310 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
311 | 457 | | |
312 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
313 | 464 | | |
314 | 465 | | |
315 | 466 | | |
316 | 467 | | |
317 | | - | |
| 468 | + | |
| 469 | + | |
318 | 470 | | |
319 | 471 | | |
320 | 472 | | |
321 | | - | |
| 473 | + | |
322 | 474 | | |
323 | 475 | | |
324 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
325 | 481 | | |
326 | 482 | | |
327 | 483 | | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
328 | 488 | | |
329 | 489 | | |
0 commit comments