From b1aeaf266ce12a31c7d1554dfeb9a696bc404224 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 4 Dec 2021 03:08:53 +0300 Subject: [PATCH] Make more eventstore adapter methods optional (#2168) --- .../eventstore-base/src/types.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/runtime/adapters/eventstore-adapters/eventstore-base/src/types.ts b/packages/runtime/adapters/eventstore-adapters/eventstore-base/src/types.ts index f12abe3ae..876639ac5 100644 --- a/packages/runtime/adapters/eventstore-adapters/eventstore-base/src/types.ts +++ b/packages/runtime/adapters/eventstore-adapters/eventstore-base/src/types.ts @@ -345,19 +345,22 @@ export interface CommonAdapterFunctions { } export interface AdapterFunctions { - beginIncrementalImport: PoolMethod< + beginIncrementalImport?: PoolMethod< ConfiguredProps, Adapter['beginIncrementalImport'] > - commitIncrementalImport: PoolMethod< + commitIncrementalImport?: PoolMethod< ConfiguredProps, Adapter['commitIncrementalImport'] > dispose: PoolMethod - dropSnapshot: PoolMethod + dropSnapshot?: PoolMethod freeze: PoolMethod - getLatestEvent: PoolMethod - injectEvent: PoolMethod + getLatestEvent?: PoolMethod + injectEvent?: PoolMethod< + ConfiguredProps, + AdapterPoolBoundProps['injectEvent'] + > injectEvents: PoolMethod< ConfiguredProps, AdapterPoolBoundProps['injectEvents'] @@ -370,17 +373,17 @@ export interface AdapterFunctions { ConfiguredProps, AdapterPoolBoundProps['loadEventsByTimestamp'] > - loadSnapshot: PoolMethod - pushIncrementalImport: PoolMethod< + loadSnapshot?: PoolMethod + pushIncrementalImport?: PoolMethod< ConfiguredProps, Adapter['pushIncrementalImport'] > - rollbackIncrementalImport: PoolMethod< + rollbackIncrementalImport?: PoolMethod< ConfiguredProps, Adapter['rollbackIncrementalImport'] > saveEvent: PoolMethod - saveSnapshot: PoolMethod + saveSnapshot?: PoolMethod shapeEvent: ShapeEvent unfreeze: PoolMethod getSecret: PoolMethod