Add App API segment & subscription methods (CDP-6266)#229
Open
mike-engel wants to merge 1 commit into
Open
Conversation
Batch 2 of the App API backfill. Adds ten methods to APIClient: - listSegments / createSegment / getSegment / deleteSegment - getSegmentCustomerCount / getSegmentMembership / getSegmentUsedBy - listSubscriptionTopics / listSubscriptionChannels / getSubscriptionCenterToken Reuses the buildQueryString helper from batch 1 for membership pagination. Includes unit tests (100% coverage), live integration coverage (segment create -> read -> delete round-trip + subscription reads), and docs in docs/app.md. Stacked on cdp-6265 (Batch 1) because it depends on the shared buildQueryString helper; rebase onto main once Batch 1 lands. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Batch 2 of the App API backfill. Adds 10 read/query methods to APIClient:
Assisted with AI 🤖
Note
Medium Risk
Adds destructive segment APIs (
deleteSegment) and subscription-center tokens; behavior is thin HTTP wrappers with tests, but callers can mutate workspace segments with a valid app key.Overview
Adds 10 new
APIClientmethods (CDP-6266 batch 2) so the Node SDK can call segment and subscription App API endpoints that were not previously wrapped.Segments:
listSegments,createSegment(with newSegmentInput),getSegment,deleteSegment,getSegmentCustomerCount, paginatedgetSegmentMembership, andgetSegmentUsedBy. Mutating calls use the same validation style as other client methods (MissingParamError, URL encoding).Subscriptions:
listSubscriptionTopics,listSubscriptionChannels, andgetSubscriptionCenterTokenfor hosted preference links.docs/app.mddocuments each method; unit tests assert URLs, payloads, and validation; live integration tests cover list/read paths plus a create→read→delete segment round-trip.Reviewed by Cursor Bugbot for commit 15b4656. Bugbot is set up for automated code reviews on this repo. Configure here.