@archastro/sdk
    Preparing search index...
    Index

    Constructors

    Methods

    • Claim events from a subscription Atomically leases the oldest unacknowledged delivery. Returns an empty data array when the queue is empty or its head already has an active lease. Passing max_events opts into batch mode, where leased entries are skipped instead of blocking; wait_seconds bounds a long poll on an empty queue.

      Parameters

      • subscription: string

        Subscription ID (esub_...).

      • input: {
            consumer_id?: string;
            max_events?: number;
            request_id?: string;
            visibility_timeout_seconds?: number;
            wait_seconds?: number;
        }

        Request body.

        • Optionalconsumer_id?: string

          Consumer identity between 1 and 128 bytes, recorded on the lease for attribution.

        • Optionalmax_events?: number

          Opts into batch mode: leases up to this many lease-available deliveries (between 1 and 20) in sequence order, skipping leased entries instead of blocking on the head. Omit to keep strict head-of-line semantics.

        • Optionalrequest_id?: string

          Idempotency key between 1 and 128 bytes. Use a value unique per claim attempt (e.g. a UUID) — the key is scoped to the subscription, so a reused value takes over whatever leases it last stamped. Retrying a claim with the same request_id while its leases are unexpired returns the same deliveries (regardless of max_events) with fresh receipt handles and refreshed leases.

        • Optionalvisibility_timeout_seconds?: number

          Lease duration override between 15 and 3600 seconds.

        • Optionalwait_seconds?: number

          Long-poll bound between 0 and 20 seconds. When the queue is empty, the request waits up to this long for a delivery before returning an empty data array. 0 (or omitting) returns immediately.

      Returns Promise<EventSubscriptionClaim>

      Successful response

    • Create a domain-event subscription Creates a durable subscription that receives exportable domain events matching its exact event names. Matching events fan out into a per-subscription queue bounded by max_pending_events and retention_seconds; consume with claim and acknowledge.

      Parameters

      • input: {
            event_names: string[];
            max_pending_events?: number;
            name: string;
            retention_seconds?: number;
            status?: "active" | "paused";
            visibility_timeout_seconds?: number;
        }

        Request body.

        • event_names: string[]

          Exact event names to receive.

        • Optionalmax_pending_events?: number

          Queue cap. Defaults to 100; maximum 1000.

        • name: string

          Customer-defined subscription name.

        • Optionalretention_seconds?: number

          Delivery retention in seconds. Defaults to 86400 (24 hours); between 7200 and 2592000. Applies to future deliveries only.

        • Optionalstatus?: "active" | "paused"

          Initial status. Defaults to active.

        • Optionalvisibility_timeout_seconds?: number

          Default claim lease in seconds. Defaults to 300.

      Returns Promise<EventSubscription>

      The new volatile subscription.

    • Delete a domain-event subscription Deletes the subscription and every delivery still in its queue.

      Parameters

      • subscription: string

        Subscription ID (esub_...).

      Returns Promise<void>

      No content

    • List domain-event subscriptions Lists the subscriptions visible to the caller, with current queue counters.

      Parameters

      • Optionalparams: { page?: number; perPage?: number }

        Query parameters.

        • Optionalpage?: number

          Page number, starting at 1.

        • OptionalperPage?: number

          Subscriptions per page, from 1 through 100.

      Returns Promise<EventSubscriptionPage>

      Subscriptions visible to this caller.

    • Read a subscription queue Returns a non-reserving, oldest-first view of unacknowledged deliveries, including the queue's loss indicators (queue_epoch, dropped_events_total, dropped_through_position). Use claim to obtain a receipt handle before acknowledging.

      Parameters

      • subscription: string

        Subscription ID (esub_...).

      • Optionalparams: { afterCursor?: string; beforeCursor?: string; limit?: number }

        Query parameters.

        • OptionalafterCursor?: string

          Opaque cursor for the following page.

        • OptionalbeforeCursor?: string

          Opaque cursor for the preceding page.

        • Optionallimit?: number

          Maximum entries to return, from 1 through 100.

      Returns Promise<EventSubscriptionQueue>

      Successful response

    • Update a domain-event subscription Updates matching, status, or queue limits for future fanout. Already queued deliveries remain unless a lower cap trims the oldest entries; retention changes apply to future deliveries only.

      Parameters

      • subscription: string

        Subscription ID (esub_...).

      • input: {
            event_names?: string[];
            max_pending_events?: number;
            name?: string;
            retention_seconds?: number;
            status?: "active" | "paused";
            visibility_timeout_seconds?: number;
        }

        Request body.

        • Optionalevent_names?: string[]
        • Optionalmax_pending_events?: number
        • Optionalname?: string
        • Optionalretention_seconds?: number

          Delivery retention in seconds. Defaults to 86400 (24 hours); between 7200 and 2592000. Applies to future deliveries only.

        • Optionalstatus?: "active" | "paused"
        • Optionalvisibility_timeout_seconds?: number

      Returns Promise<EventSubscription>

      Successful response