@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Interface TestControllerStore

    Seller-side store for comply_test_controller.

    Implement the methods for each scenario you support. Unimplemented methods mean that scenario is not advertised in list_scenarios.

    interface TestControllerStore {
        forceCreativeStatus?(
            creativeId: string,
            status: CreativeStatus,
            rejectionReason?: string,
        ): Promise<StateTransitionSuccess>;
        forceAccountStatus?(
            accountId: string,
            status: AccountStatus,
        ): Promise<StateTransitionSuccess>;
        forceMediaBuyStatus?(
            mediaBuyId: string,
            status: MediaBuyStatus,
            rejectionReason?: string,
        ): Promise<StateTransitionSuccess>;
        forceSessionStatus?(
            sessionId: string,
            status: "complete" | "terminated",
            terminationReason?: string,
        ): Promise<StateTransitionSuccess>;
        forceCreateMediaBuyArm?(
            params: {
                arm: "submitted" | "input-required";
                task_id?: string;
                message?: string;
            },
        ): Promise<ForcedDirectiveSuccess>;
        forceTaskCompletion?(
            taskId: string,
            result: Record<string, unknown>,
        ): Promise<StateTransitionSuccess>;
        forceAudienceStatus?(
            audienceId: string,
            status: AudienceStatus,
            reason?: string,
        ): Promise<StateTransitionSuccess>;
        forceCatalogItemStatus?(
            itemId: string,
            status: CatalogItemStatus,
            reason?: string,
        ): Promise<StateTransitionSuccess>;
        simulateDelivery?(
            mediaBuyId: string,
            params: {
                impressions?: number;
                clicks?: number;
                reported_spend?: { amount: number; currency: string };
                conversions?: number;
                [key: string]: unknown;
            },
        ): Promise<SimulationSuccess>;
        simulateBudgetSpend?(
            params: {
                account_id?: string;
                media_buy_id?: string;
                spend_percentage: number;
                [key: string]: unknown;
            },
        ): Promise<SimulationSuccess>;
        seedProduct?(
            productId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        seedPricingOption?(
            productId: string,
            pricingOptionId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        seedCreative?(
            creativeId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        seedPlan?(
            planId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        seedMediaBuy?(
            mediaBuyId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        seedCreativeFormat?(
            formatId: string,
            fixture: Record<string, unknown> | undefined,
        ): Promise<void>;
        queryUpstreamTraffic?(
            params: {
                since_timestamp?: string;
                endpoint_pattern?: string;
                limit?: number;
            },
        ): Promise<UpstreamTrafficSuccessResponse>;
    }
    Index

    Methods

    • Transition a creative to the specified status.

      Parameters

      • creativeId: string
      • status: CreativeStatus
      • OptionalrejectionReason: string

      Returns Promise<StateTransitionSuccess>

    • Transition a media buy to the specified status.

      Parameters

      • mediaBuyId: string
      • status: MediaBuyStatus
      • OptionalrejectionReason: string

      Returns Promise<StateTransitionSuccess>

    • Transition an SI session to a terminal status.

      Parameters

      • sessionId: string
      • status: "complete" | "terminated"
      • OptionalterminationReason: string

      Returns Promise<StateTransitionSuccess>

    • Register a directive shaping the next create_media_buy call from this authenticated sandbox account into the requested arm. The directive is consumed on the next call. arm: 'submitted' requires task_id so the seller's task envelope is deterministic (the buyer can drive tasks/get with the registered id).

      Parameters

      • params: { arm: "submitted" | "input-required"; task_id?: string; message?: string }

      Returns Promise<ForcedDirectiveSuccess>

    • Transition an in-flight task to completed and record the supplied completion payload. The seller MUST deliver result verbatim to the buyer's push_notification_config.url per the AdCP 3.0 completion path.

      Parameters

      • taskId: string
      • result: Record<string, unknown>

      Returns Promise<StateTransitionSuccess>

    • Transition a synced audience to the specified matching status. Backs the impairment.coherence audience inverse-rule traversal — storyboards flip an audience offline to verify that downstream segments / activations reflect the upstream state change. Advertised as force_audience_status via list_scenarios.

      Extension scenario: not yet a member of CONTROLLER_SCENARIOS because the schema cache's ListScenariosSuccess['scenarios'] union doesn't include force_audience_status (open-for-extension per spec). The dispatcher accepts the literal string under TOOL_INPUT_SHAPE.scenario: z.string(). Status values are validated against the spec-shipped AudienceStatusSchema — when the spec adds offline values (e.g. suspended for adcp#2860), codegen widens the schema and this adapter automatically accepts them.

      Wire param convention: the dispatcher accepts reason (this issue's proposed name, neutral across non-rejection transitions like processing → ready) OR rejection_reason (the field name used by force_creative_status / force_media_buy_status). Adapters receive whichever was supplied as the single reason argument.

      TODO(adcp#2860): when the spec PR lands populated effects (matched_count, effective_match_rate) on the ready transition, the return shape may widen from plain StateTransitionSuccess to a variant carrying effects?. Track the spec PR and update once the schema cache picks it up.

      Parameters

      • audienceId: string
      • status: AudienceStatus
      • Optionalreason: string

      Returns Promise<StateTransitionSuccess>

    • Transition a single catalog item to the specified review status. Backs the catalog-side impairment.coherence traversal (item-level approval flipping). Advertised as force_catalog_item_status via list_scenarios.

      Extension scenario; see forceAudienceStatus for the rationale. Status validated against CatalogItemStatusSchema. Same dual reason / rejection_reason acceptance as forceAudienceStatus.

      Param name note: catalog_item_id (not item_id). Storyboard runner bindings in sales-catalog-driven reference catalog items by this name; the wire entity field is item_id, but the controller layer is driven by storyboards, so we follow the binding convention.

      Parameters

      Returns Promise<StateTransitionSuccess>

    • Inject synthetic delivery data for a media buy.

      Parameters

      • mediaBuyId: string
      • params: {
            impressions?: number;
            clicks?: number;
            reported_spend?: { amount: number; currency: string };
            conversions?: number;
            [key: string]: unknown;
        }

      Returns Promise<SimulationSuccess>

    • Simulate budget consumption to a specified percentage.

      Parameters

      • params: {
            account_id?: string;
            media_buy_id?: string;
            spend_percentage: number;
            [key: string]: unknown;
        }

      Returns Promise<SimulationSuccess>

    • Seed a product fixture. Returns when the fixture is persisted.

      Parameters

      • productId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Seed a pricing option fixture (scoped to a product).

      Parameters

      • productId: string
      • pricingOptionId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Seed a creative fixture.

      Parameters

      • creativeId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Seed a plan fixture.

      Parameters

      • planId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Seed a media-buy fixture.

      Parameters

      • mediaBuyId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Seed a creative-format fixture. The seller MUST expose this format ID in list_creative_formats responses for the duration of the compliance session.

      Parameters

      • formatId: string
      • fixture: Record<string, unknown> | undefined

      Returns Promise<void>

    • Return outbound HTTP calls the agent has made since since_timestamp, scoped to the calling principal. Backs the upstream_traffic storyboard validation per spec PR adcontextprotocol/adcp#3816 — runners assert that the adapter actually called upstream with the storyboard-supplied identifiers. The producer-side reference middleware lives at @adcp/sdk/upstream-recorder; adopters typically delegate to recorder.query() + toQueryUpstreamTrafficResponse() rather than implementing this from scratch.

      Adopters opt in by implementing this method (advertised as query_upstream_traffic via list_scenarios). NOT yet a member of CONTROLLER_SCENARIOS because the schema cache predates the spec PR — the dispatcher accepts the literal 'query_upstream_traffic' string under the TOOL_INPUT_SHAPE.scenario: z.string() open-extension pattern. Once a 3.0.5+ release ships the schema, this scenario will be promoted to a first-class constant.

      Parameters

      • params: { since_timestamp?: string; endpoint_pattern?: string; limit?: number }

      Returns Promise<UpstreamTrafficSuccessResponse>