Commit 3cb5a30
fix: address review — list per-key types, batch sep, hasOwnProperty, request_id in msg
8 items.
### Concerns
1. **Two-level `;` separator in batchCreate aggregated errors.** Inner
per-field errors join with `; `, outer per-item errors used `; `
too — the same separator at two levels was ambiguous. Outer
separator is now ` | ` so callers can split reliably:
`items[0]: a; b | items[2]: c; d`. JSDoc updated.
2. **`list()` per-key type validation.** Was permissive (any
string-or-number accepted for any key). Per the OpenAPI spec only
`limit` is numeric; `cursor`/`status`/`q`/`sort`/dates are strings.
Tightened to per-key `expectedType` so `cursor: 42` is rejected
instead of silently coerced to `"42"`. Updated existing test;
added new test for numeric values on string-typed fields.
3. **`mapQurlsField` `Object.prototype.hasOwnProperty.call`.** Replaced
the bare `in` operator (walks prototype chain by spec) with
`hasOwnProperty.call`. `response.json()` produces plain objects
today, but defends against future consumers feeding pre-parsed
bodies from arbitrary sources.
5. **`AbortSignal.timeout` per-attempt budget documented.** Added a
block comment explaining the deliberate per-attempt-not-total
semantics (so a slow-then-failed attempt doesn't poison the next
retry's deadline) plus the worst-case total bound.
6. **`Quota.usage.active_qurls_percent` field-level JSDoc.** Documented
the `null = unlimited plan` semantic on the field itself so IDE
hover catches it without forcing readers back to the PR description.
### Nits
- **`request_id` in shape-guard error message string.** Embedded
`[request_id=...]` in the detail message in addition to
`.requestId` — a stack trace pasted into a support ticket now
carries the correlation handle without a follow-up round-trip.
Existing test extended to assert the new suffix.
### Coverage
- **`qurls: null` with `access_tokens` already present.** Exercises
the `qurls && ...` truthy short-circuit branches in mapQurlsField.
Defends against a future refactor that flips presence-vs-truthy
and surfaces `qurls: null` on a typed QURL.
### No action
- **#4 `requireString` helper extraction.** Reviewer marked optional
("tiny refactor"). Skipping — the duplicated typeof guard appears
in three small spots and pulling it out adds an indirection layer.
- **HTTP-date `Retry-After` support.** Already filed as #61.
- **`extend()` narrower-than-`update()` type relationship.** Reviewer
noted as informational. Already documented in extend()'s JSDoc.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent f3795dd commit 3cb5a30
3 files changed
Lines changed: 133 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
317 | 359 | | |
318 | 360 | | |
319 | 361 | | |
| |||
3324 | 3366 | | |
3325 | 3367 | | |
3326 | 3368 | | |
3327 | | - | |
3328 | | - | |
3329 | | - | |
3330 | | - | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
3331 | 3373 | | |
3332 | 3374 | | |
3333 | 3375 | | |
| |||
3336 | 3378 | | |
3337 | 3379 | | |
3338 | 3380 | | |
3339 | | - | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
3340 | 3409 | | |
3341 | 3410 | | |
3342 | 3411 | | |
| |||
4098 | 4167 | | |
4099 | 4168 | | |
4100 | 4169 | | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
4101 | 4174 | | |
4102 | 4175 | | |
4103 | 4176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
531 | 531 | | |
532 | | - | |
533 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
534 | 537 | | |
535 | 538 | | |
536 | 539 | | |
537 | | - | |
| 540 | + | |
538 | 541 | | |
539 | 542 | | |
540 | 543 | | |
| |||
585 | 588 | | |
586 | 589 | | |
587 | 590 | | |
588 | | - | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
589 | 595 | | |
| 596 | + | |
590 | 597 | | |
591 | 598 | | |
592 | 599 | | |
| |||
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
605 | | - | |
| 612 | + | |
606 | 613 | | |
607 | 614 | | |
608 | 615 | | |
| |||
611 | 618 | | |
612 | 619 | | |
613 | 620 | | |
614 | | - | |
| 621 | + | |
615 | 622 | | |
616 | 623 | | |
617 | 624 | | |
| |||
622 | 629 | | |
623 | 630 | | |
624 | 631 | | |
625 | | - | |
| 632 | + | |
626 | 633 | | |
627 | 634 | | |
628 | 635 | | |
| |||
659 | 666 | | |
660 | 667 | | |
661 | 668 | | |
662 | | - | |
663 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
664 | 674 | | |
665 | 675 | | |
666 | 676 | | |
| |||
722 | 732 | | |
723 | 733 | | |
724 | 734 | | |
725 | | - | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
726 | 742 | | |
727 | 743 | | |
728 | 744 | | |
| |||
801 | 817 | | |
802 | 818 | | |
803 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
804 | 826 | | |
805 | 827 | | |
806 | 828 | | |
807 | 829 | | |
808 | 830 | | |
809 | | - | |
810 | | - | |
| 831 | + | |
811 | 832 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
| 833 | + | |
| 834 | + | |
819 | 835 | | |
820 | | - | |
| 836 | + | |
821 | 837 | | |
822 | 838 | | |
823 | 839 | | |
| |||
1101 | 1117 | | |
1102 | 1118 | | |
1103 | 1119 | | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1104 | 1128 | | |
1105 | 1129 | | |
1106 | 1130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| |||
0 commit comments