@adcp/sdk API Reference - v17.0.0-rc.0
    Preparing search index...

    Interface ReportingEventStoreExperimental

    Where a consumer's acknowledged snapshot lives, one per agent. save must refuse (throw ReportingEventConflictError) when the stored revision is no longer expectedRevision, so two workers never both acknowledge. Use a durable store for serverless consumers: each invocation starts with an empty process.

    Reporting subscriptions (AdCP 3.3).

    interface ReportingEventStore {
        durability?: "process-local" | "durable";
        load(agentId: string): Promise<{ snapshot: Json; revision: number } | null>;
        save(
            agentId: string,
            snapshot: Json,
            options: { expectedRevision: number | null },
        ): Promise<number>;
    }

    Implemented by

    Index
    durability?: "process-local" | "durable"

    'durable' when the snapshot survives a restart. Absent reads as 'process-local'.

    • Experimental

      Parameters

      • agentId: string

      Returns Promise<{ snapshot: Json; revision: number } | null>

    • Experimental

      Parameters

      • agentId: string
      • snapshot: Json
      • options: { expectedRevision: number | null }

      Returns Promise<number>