Relocate the ~6k-file docs tree from the repo root into plugins/document-navigator/docs/ so the plugin is self-contained and portable. docs/superpowers/ (specs and plans) stays at the repo root. Moved via cp+rm rather than git mv because directory rename() fails with EPERM on this WSL /mnt DrvFs mount; git rename-detection pairs the identical-content files at commit time. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
7.4 KiB
7.4 KiB
@suaveplan/api-plugin-campaigns - Campaigns + suppression + delivery-webhooks HTTP plugin for @suaveplan/api. Mounts /campaigns, /suppression, and /webhooks on a Hono OpenAPI registry, backed by SurrealDB implementations of @suaveplan/campaigns CampaignStore and a local CampaignSuppressionStore, plus the @suaveplan/delivery-tracking SurrealDeliveryEventStore. Chunked migration (A: foundation, B: repositories, C: routes).
Campaigns + suppression + delivery-webhooks HTTP plugin for @suaveplan/api.
Mounts the /campaigns, /suppression, and /webhooks route trees on a
Hono OpenAPIHono registry, backed by SurrealDB implementations of the
universal @suaveplan/campaigns CampaignStore, a local
CampaignSuppressionStore, and the already-shipped
@suaveplan/delivery-tracking SurrealDeliveryEventStore.
Documentation tree
- context — The
contextmodule owns the HonoContextVariableMapdeclaration-merge augmentation applied by `@suaveplan/api-plugi…- context — The
contextmodule owns the HonoContextVariableMapdeclaration-merge augmentation applied by `@suaveplan/api-plugi…
- context — The
- error-codes — The error-codes module owns the stable
CAMPAIGNS_API.*namespace used by every failure path inside `@suaveplan/api-pl…- error-codes — The error-codes module owns the stable
CAMPAIGNS_API.*namespace used by every failure path inside `@suaveplan/api-pl…
- error-codes — The error-codes module owns the stable
- otel — The
otel/instrumentsmodule owns the OpenTelemetry instrument bundle emitted by@suaveplan/api-plugin-campaigns. It…- instruments — The
otel/instrumentsmodule owns the OpenTelemetry instrument bundle emitted by@suaveplan/api-plugin-campaigns. It…
- instruments — The
- plugin — The
pluginmodule exportscreateCampaignsPlugin— thePluginDescriptorfactory consumed by@suaveplan/apihosts…- plugin — The
pluginmodule exportscreateCampaignsPlugin— thePluginDescriptorfactory consumed by@suaveplan/apihosts…
- plugin — The
- campaign — This module owns the SurrealDB-backed implementation of the campaign persistence contract for `@suaveplan/api-plugin-ca…
- campaign — This module owns the SurrealDB-backed implementation of the campaign persistence contract for `@suaveplan/api-plugin-ca…
- suppression — This module owns the SurrealDB-backed implementation of the tenant + channel-scoped
CampaignSuppressionStoreinterfac…- suppression-internals — This module owns the validation and mapping primitives shared by the two
CampaignSuppressionStoreimplementations — `… - suppression-memory — In-memory reference implementation of the tenant + channel-scoped
CampaignSuppressionStoreinterface. Intended for un… - suppression — This module owns the SurrealDB-backed implementation of the tenant + channel-scoped
CampaignSuppressionStoreinterfac…
- suppression-internals — This module owns the validation and mapping primitives shared by the two
- action-routes — This module owns the campaign action routes — state-machine transitions (
/send,/pause,/cancel), the `/duplicate… - build-routes —
buildCampaignRoutesis the single aggregator that materialises every/campaigns/*PluginRouteEntryin a canonical… - crud-routes — This module owns the five canonical CRUD entries for the
/campaignsroute tree: list, create, get, update, and delete… - schemas — This module is the OpenAPI-facing contract for the
/campaignsroute tree. Every incoming request body, query string,… - require-tenant —
requireTenantextracts the request principal from the Hono context slotc.get("user")(populated by `@suaveplan/api… - strip-undefined —
stripUndefinedis a route-layer adapter that bridges Zod'soptional()output (T | undefined) with the `exactOptio… - build-routes —
buildSuppressionRoutesaggregates the four/suppression/*plugin route entries in canonical order (list, check, cre… - routes — The suppression-route module owns the four endpoints that manage the
(tenantId, channel, channelValue)-keyed suppress… - schemas — The suppression-route schemas describe the OpenAPI contract for the
/suppressionroute tree. The package's local `Cam… - build-routes —
buildWebhookRoutesaggregates the two/webhooks/*route entries in canonical order — delivery ingest first, then on… - routes — The webhook-route module owns the two webhook endpoints: a delivery event ingestion endpoint that normalises and persis…
- schemas — The webhook-route schemas describe the OpenAPI contract for the
/webhooksroute tree, plus adecodeUnsubscribeToken… - schemas — The
schemas/optionsmodule owns the Zod validator thatcreateCampaignsPluginruns against its caller-supplied optio…- options — The
schemas/optionsmodule owns the Zod validator thatcreateCampaignsPluginruns against its caller-supplied optio…
- options — The
- services — The
services/registry-augmentationmodule owns theServiceRegistrydeclaration-merge augmentation applied by `@suav…- registry-augmentation — The
services/registry-augmentationmodule owns theServiceRegistrydeclaration-merge augmentation applied by `@suav…
- registry-augmentation — The
- types — The
typesmodule exports the public type bundle for@suaveplan/api-plugin-campaigns— the option-input shape consum…- types — The
typesmodule exports the public type bundle for@suaveplan/api-plugin-campaigns— the option-input shape consum…
- types — The
Chunked migration status
This package is being being migrated in three sequential chunks so each ships green on its own:
- Chunk A — foundation (this version) — package shell, error codes,
OTel instruments, Zod options schema, shared types, plugin scaffold with a
no-op
onInitplaceholder. - Chunk B — repositories (follow-up) —
SurrealCampaignRepository,CampaignSuppressionStore+ Surreal implementation, delivery-event store wiring, schema DDL bundle, repository registration on the hostServiceRegistry. - Chunk C — routes (follow-up) —
/campaigns,/suppression, and/webhooksroute trees registered viadefinePluginRoutes, integration tests against a SurrealDB testcontainer.
Quality gates
bunx turbo lint typecheck test --filter=@suaveplan/api-plugin-campaigns
plus bunx turbo test:coverage --filter=@suaveplan/api-plugin-campaigns
at 100/100/100/100 are required for every chunk to land.