feat(api): activate the ads public API scope - #1132
Open
realcodesiman wants to merge 1 commit into
Open
Conversation
Wire the previously-inert `ads` workspace-token scope to real endpoints: conversion-rule CRUD, CTWA/CTM/CTID funnel and CAPI-delivery reads, conversion export, ad-account reads, and the full messaging-ad campaign lifecycle. Every handler calls the same business-service method its private/UI counterpart uses. Co-Authored-By: Claude Sonnet 5 <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.
Summary
adsworkspace-token scope shipped in the enum/registry/i18n from day one but had no endpoints wired to it — a token scoped to["ads"]reached nothing.packages/businessservice method its private/UI counterpart already calls, per.agents/rules/data-access.md.Changes
apps/builder/src/features/ads/api/public.ts+schema/public.ts— conversion rules, funnel, CAPI delivery, export, ad-account readsapps/builder/src/features/ads-campaign/api/public.ts+schema/public.ts— messaging-ad campaign lifecycleapps/builder/src/routers/public.ts— mountsadson the public routerpackages/business/src/ads-conversion/service.ts— addsfindOrFail(single-rule read with the standard not-found contract, reused by the newGET /v1/ads/conversion-rules/{id}handler)docs/developer/workspace-api-tokens.md— endpoint-to-scope table and the two invariants specific to this scope (noassertWorkspaceSuperAdminon the token path;createdByalways null for token-created campaigns)ads-public-scope.test.ts(router wiring),ads-public-api.test.ts,ads-campaign-public-api.test.ts(handler behavior, including the missing-session-user regression guard), plusads-conversion-rule.service.test.tscoverage forfindOrFailTest plan
pnpm lintpnpm --filter builder check-typespnpm --filter @chatbotx.io/business check-typespnpm --filter builder test(full suite, 3355 passed)pnpm --filter @chatbotx.io/business test(full suite, 2145 passed)