Skip to content

Commit

Permalink
direct batch get tests and type simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Nov 6, 2024
1 parent 69eb332 commit 4fb61dc
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 140 deletions.
20 changes: 18 additions & 2 deletions jetstream/src/jsapi_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,25 @@ export type NextMsgRequest = {
*/
next_by_subj: string;
};

export type DirectMsgRequest =
| SeqMsgRequest
| LastForMsgRequest
| NextMsgRequest;
| NextMsgRequest
| StartTimeMsgRequest;

// FIXME: new options on the server

export interface DirectBatchFilter {
multi_last: string[];
}

export type DirectBatchOptions = {
multi_last: string[];
batch?: number;

seq?: number;
max_bytes?: number;
multi_last: string[];
up_to_seq?: number;
up_to_time?: Date | string;
};
Expand Down Expand Up @@ -803,6 +812,13 @@ export interface SeqMsgRequest {
seq: number;
}

export interface StartTimeMsgRequest {
/**
* Start time for the message
*/
start_time: Date | string;
}

// FIXME: remove number as it is deprecated
export type MsgRequest = SeqMsgRequest | LastForMsgRequest | number;

Expand Down
2 changes: 1 addition & 1 deletion jetstream/src/jsclient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import type {
ApiResponse,
JetStreamAccountStats,
} from "./jsapi_types.ts";
import { DirectStreamAPIImpl } from "./jsm.ts";
import { DirectStreamAPIImpl } from "./jsm_direct.ts";
import { JetStreamError } from "./jserrors.ts";

export function toJetStreamClient(
Expand Down
File renamed without changes.
Loading

0 comments on commit 4fb61dc

Please sign in to comment.