feat(number,tollfree): Dashboard TN read surface and toll-free template lookup - #44
Open
kshahbw wants to merge 2 commits into
Open
feat(number,tollfree): Dashboard TN read surface and toll-free template lookup#44kshahbw wants to merge 2 commits into
kshahbw wants to merge 2 commits into
Conversation
…te lookup
Add read commands over the Dashboard (legacy platform) per-TN surface and
the toll-free routing template search:
- band number details <tn>: full Dashboard view via /tns/{tn}/tndetails —
geography, features, messaging settings, TN attributes, and the
per-number OriginationRoutePlan (priority/weight per endpoint) where
configured
- band number nnroutes <tn>: available NetNumber routes
- band number count: totals endpoints (account, sub-account, location,
disconnected) instead of paging the full inventory
- band number list: geography filters (--npa-nxx, --state, --ratecenter,
--lata), sub-account/location scoping, and --disconnected; the bare
command keeps using /tns so credentials without the inservice role are
unaffected
- band tollfree template <tn...>: routing template names via
tollFreeTemplateAssignments/search; gated per account, 403 maps to an
actionable message (exit 2)
All commands are read-only. Live-probed against production: template
gating (403 -> exit 2), tndetails/nnroutes not-found (404 -> exit 3), and
flag-conflict validation (exit 6); happy paths need an entitled account
and are tracked in the design spec.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
joshraub-bw
previously approved these changes
Aug 24, 2026
…idation Review findings from an independent pass: - The inserviceNumbers/discnumbers endpoints define 'page' as the 1-based ID of the first element (1, 1001, 2001, ...), not a page number — paging 1,2,3 re-fetched overlapping records past the first page. The sippeer tns endpoint DOES use page numbers; listQuery now carries the dialect. - Terminate pagination via the response's TotalCount instead of only the short-batch heuristic, which misread a full final page as 'more to come' and issued a needless, failable extra request on exact multiples of the page size. - Reject vanity/non-digit input in tollfree template client-side (ClassifyNumber checks only length and area code, so 800ABC-DEFG previously reached the API).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Read-only commands over two surfaces the CLI didn't cover:
band number(Dashboard per-TN reads)number details <tn>— full Dashboard view via/tns/{tn}/tndetails: geography (LATA/state/rate center), vendor, sub-account/location, features (E911/LIDB/DLDA), messaging settings incl. assigned NN route, TN attributes, and the per-number OriginationRoutePlan (priority + weight per endpoint) where configurednumber nnroutes <tn>— available NetNumber routesnumber count— totals endpoints (--disconnected,--subaccount,--location) instead of paging the whole inventorynumber list— new filters:--npa-nxx,--state,--ratecenter,--lata,--subaccount,--location,--disconnected. The bare command still uses/tnsso credentials without the inservice role see no change.band tollfree(new group)tollfree template <tn...>— toll-free routing template names viatollFreeTemplateAssignments/search(up to 5000 TFNs/call). Account-gated byTollFreeTemplateAssignmentSearch; 403 maps to an actionable "ask your account manager" message (exit 2), same pattern as the portin TF-automation gate.Why
Common operational questions for toll-free-heavy accounts — which routing template a TFN is assigned to, and how a number routes across weighted endpoints — had no CLI answer. All of the above are reads on publicly documented APIs;
templateNameis returned verbatim (no internal carrier mapping is shipped). The per-TN read gap was worth closing for every account —number listpreviously returned bare strings and nothing could answer "what's configured on this number?"Validation
go test ./...green (incl. doc-contract);make buildclean. Local golangci-lint panics on a Go 1.26/1.27 toolchain mismatch unrelated to this change — relying on CI lint.tndetails/availableNnRoutesforeign-TN 404 → exit 3; flag conflicts → exit 6 before any HTTP. Happy paths need a credential with the Numbers/inservice role and an entitled account — flagged for follow-up validation; response-shape handling is unit-tested against the spec examples, and unexpected shapes pass through raw rather than vanishing.Notes for review
--ratecentercasing differs per endpoint in the published specs (account:ratecenter, site:rateCenter); the CLI follows each endpoint's documented casing.extractFullNumberslearned the bare-string<TelephoneNumber>shape used by inserviceNumbers/discnumbers alongside the existing/tnsobject shape.This PR was substantially AI-generated (Claude Code), reviewed and directed by @kshahbw.
🤖 Generated with Claude Code