Interface StreamAPI

interface StreamAPI {
    add(cfg): Promise<StreamInfo>;
    delete(stream): Promise<boolean>;
    deleteMessage(stream, seq, erase?): Promise<boolean>;
    find(subject): Promise<string>;
    get(name): Promise<Stream>;
    getMessage(stream, query): Promise<StoredMsg>;
    info(stream, opts?): Promise<StreamInfo>;
    list(subject?): Lister<StreamInfo>;
    listKvs(): Lister<KvStatus>;
    listObjectStores(): Lister<ObjectStoreStatus>;
    names(subject?): Lister<string>;
    purge(stream, opts?): Promise<PurgeResponse>;
    update(name, cfg): Promise<StreamInfo>;
}

Methods

  • Adds a new stream with the specified stream configuration.

    Parameters

    Returns Promise<StreamInfo>

  • Deletes the specified stream

    Parameters

    • stream: string

    Returns Promise<boolean>

  • Deletes the specified message sequence from the stream

    Parameters

    • stream: string
    • seq: number
    • Optional erase: boolean

      erase the message - by default true

    Returns Promise<boolean>

  • Find the stream that stores the specified subject.

    Parameters

    • subject: string

    Returns Promise<string>

  • Returns a Stream object

    Parameters

    • name: string

    Returns Promise<Stream>

  • Retrieves the message matching the specified query. Messages can be retrieved by sequence number or by last sequence matching a subject.

    Parameters

    Returns Promise<StoredMsg>

  • Returns the information about the specified stream

    Parameters

    Returns Promise<StreamInfo>

  • Lists all streams stored by JetStream

    Parameters

    • Optional subject: string

      only return streams that include the specified subject

    Returns Lister<StreamInfo>

  • Returns a list of KvStatus for all streams that are identified as being a KV (that is having names that have the prefix KV_)

    Returns Lister<KvStatus>

  • Returns a list of ObjectStoreInfo for all streams that are identified as being a ObjectStore (that is having names that have the prefix OBJ_)

    Returns Lister<ObjectStoreStatus>

  • Return a Lister of stream names

    Parameters

    • Optional subject: string

      if specified, the results are filtered to streams that contain the subject (can be wildcarded)

    Returns Lister<string>

  • Purges messages from a stream that match the specified purge options.

    Parameters

    Returns Promise<PurgeResponse>

  • Updates the stream configuration for the specified stream.

    Parameters

    Returns Promise<StreamInfo>