Skip to content

Commit

Permalink
Move subscription id and add postinstall script
Browse files Browse the repository at this point in the history
  • Loading branch information
w1am committed Apr 29, 2024
1 parent a0f0431 commit 666aebe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"prettier:fix": "prettier --write \"packages/*/src/**/**/!(*.d).{ts,json}\"",
"clean": "lerna run --stream clean",
"prepublishOnly": "run-s clean build test",
"test": "lerna run --stream test --"
"test": "lerna run --stream test --",
"postinstall": "yarn build"
},
"author": "Event Store Limited",
"license": "Apache-2.0",
Expand Down
21 changes: 7 additions & 14 deletions packages/db-client/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ export interface StreamingRead<E> extends Readable {
}

export interface ReadableSubscription<E> extends Readable {
id?: string;

unsubscribe(): Promise<void>;

addListener(event: "close", listener: () => void): this;
Expand Down Expand Up @@ -498,26 +500,17 @@ export interface CatchupSubscription {
removeListener(event: "fellBehind", listener: () => void): this;
}

export interface SubscriptionDetails {
id?: string;
}

export type PersistentSubscriptionToStream<E extends EventType = EventType> =
PersistentSubscriptionBase<PersistentSubscriptionToStreamResolvedEvent<E>> &
SubscriptionDetails;
PersistentSubscriptionBase<PersistentSubscriptionToStreamResolvedEvent<E>>;

export type PersistentSubscriptionToAll =
PersistentSubscriptionBase<PersistentSubscriptionToAllResolvedEvent> &
SubscriptionDetails;
PersistentSubscriptionBase<PersistentSubscriptionToAllResolvedEvent>;

export type StreamSubscription<E extends EventType = EventType> =
ReadableSubscription<ResolvedEvent<E>> &
CatchupSubscription &
SubscriptionDetails;
ReadableSubscription<ResolvedEvent<E>> & CatchupSubscription;

export type AllStreamSubscription =
ReadableSubscription<AllStreamResolvedEvent> &
CatchupSubscription &
SubscriptionDetails;
ReadableSubscription<AllStreamResolvedEvent> & CatchupSubscription;

export { VNodeState };
export * from "./events";

0 comments on commit 666aebe

Please sign in to comment.