@delta-base/core 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ import * as hono_utils_http_status from 'hono/utils/http-status';
3
3
  import * as hono_types from 'hono/types';
4
4
  import { z, OpenAPIHono } from '@hono/zod-openapi';
5
5
  import { DurableObject } from 'cloudflare:workers';
6
+ import * as _delta_base_toolkit from '@delta-base/toolkit';
7
+ import { Event, AppendToStreamOptions, ReadStreamOptions, ReadEvent } from '@delta-base/toolkit';
6
8
 
7
9
  declare namespace ManagementAPI {
8
10
  const EventStoreSchema: z.ZodObject<{
@@ -272,25 +274,25 @@ declare namespace EventStoreAPI {
272
274
  createdAt: z.ZodString;
273
275
  }, "strip", z.ZodTypeAny, {
274
276
  type: string;
275
- streamId: string;
276
- data: Record<string, unknown>;
277
277
  createdAt: string;
278
+ data: Record<string, unknown>;
278
279
  globalPosition: number;
279
280
  streamPosition: number;
281
+ streamId: string;
282
+ eventId: string;
280
283
  schemaVersion: string;
281
284
  transactionId: string;
282
- eventId: string;
283
285
  metadata?: Record<string, unknown> | undefined;
284
286
  }, {
285
287
  type: string;
286
- streamId: string;
287
- data: Record<string, unknown>;
288
288
  createdAt: string;
289
+ data: Record<string, unknown>;
289
290
  globalPosition: number;
290
291
  streamPosition: number;
292
+ streamId: string;
293
+ eventId: string;
291
294
  schemaVersion: string;
292
295
  transactionId: string;
293
- eventId: string;
294
296
  metadata?: Record<string, unknown> | undefined;
295
297
  }>;
296
298
  export const AppendEventsRequestSchema: z.ZodObject<{
@@ -353,14 +355,14 @@ declare namespace EventStoreAPI {
353
355
  expectedVersion: z.ZodNumber;
354
356
  }, "strip", z.ZodTypeAny, {
355
357
  error: "Version conflict";
358
+ details: string;
356
359
  currentVersion: number;
357
360
  expectedVersion: number;
358
- details: string;
359
361
  }, {
360
362
  error: "Version conflict";
363
+ details: string;
361
364
  currentVersion: number;
362
365
  expectedVersion: number;
363
- details: string;
364
366
  }>;
365
367
  export const ValidationErrorSchema: z.ZodObject<{
366
368
  error: z.ZodLiteral<"Invalid request body">;
@@ -399,14 +401,14 @@ declare namespace EventStoreAPI {
399
401
  expectedVersion: z.ZodNumber;
400
402
  }, "strip", z.ZodTypeAny, {
401
403
  error: "Version conflict";
404
+ details: string;
402
405
  currentVersion: number;
403
406
  expectedVersion: number;
404
- details: string;
405
407
  }, {
406
408
  error: "Version conflict";
409
+ details: string;
407
410
  currentVersion: number;
408
411
  expectedVersion: number;
409
- details: string;
410
412
  }>, z.ZodObject<{
411
413
  error: z.ZodLiteral<"Invalid request body">;
412
414
  details: z.ZodArray<z.ZodObject<{
@@ -458,53 +460,53 @@ declare namespace EventStoreAPI {
458
460
  createdAt: z.ZodString;
459
461
  }, "strip", z.ZodTypeAny, {
460
462
  type: string;
461
- streamId: string;
462
- data: Record<string, unknown>;
463
463
  createdAt: string;
464
+ data: Record<string, unknown>;
464
465
  globalPosition: number;
465
466
  streamPosition: number;
467
+ streamId: string;
468
+ eventId: string;
466
469
  schemaVersion: string;
467
470
  transactionId: string;
468
- eventId: string;
469
471
  metadata?: Record<string, unknown> | undefined;
470
472
  }, {
471
473
  type: string;
472
- streamId: string;
473
- data: Record<string, unknown>;
474
474
  createdAt: string;
475
+ data: Record<string, unknown>;
475
476
  globalPosition: number;
476
477
  streamPosition: number;
478
+ streamId: string;
479
+ eventId: string;
477
480
  schemaVersion: string;
478
481
  transactionId: string;
479
- eventId: string;
480
482
  metadata?: Record<string, unknown> | undefined;
481
483
  }>, "many">;
482
484
  currentStreamVersion: z.ZodNumber;
483
485
  }, "strip", z.ZodTypeAny, {
484
486
  events: {
485
487
  type: string;
486
- streamId: string;
487
- data: Record<string, unknown>;
488
488
  createdAt: string;
489
+ data: Record<string, unknown>;
489
490
  globalPosition: number;
490
491
  streamPosition: number;
492
+ streamId: string;
493
+ eventId: string;
491
494
  schemaVersion: string;
492
495
  transactionId: string;
493
- eventId: string;
494
496
  metadata?: Record<string, unknown> | undefined;
495
497
  }[];
496
498
  currentStreamVersion: number;
497
499
  }, {
498
500
  events: {
499
501
  type: string;
500
- streamId: string;
501
- data: Record<string, unknown>;
502
502
  createdAt: string;
503
+ data: Record<string, unknown>;
503
504
  globalPosition: number;
504
505
  streamPosition: number;
506
+ streamId: string;
507
+ eventId: string;
505
508
  schemaVersion: string;
506
509
  transactionId: string;
507
- eventId: string;
508
510
  metadata?: Record<string, unknown> | undefined;
509
511
  }[];
510
512
  currentStreamVersion: number;
@@ -527,12 +529,12 @@ declare namespace EventStoreAPI {
527
529
  includeCount: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, boolean, string>, z.ZodBoolean>>;
528
530
  }, "strip", z.ZodTypeAny, {
529
531
  type?: string | string[] | undefined;
530
- streamId?: string | undefined;
531
532
  limit?: number | undefined;
532
533
  offset?: number | undefined;
533
- transactionId?: string | undefined;
534
+ streamId?: string | undefined;
534
535
  phase?: number | undefined;
535
536
  eventId?: string | undefined;
537
+ transactionId?: string | undefined;
536
538
  fromPosition?: number | undefined;
537
539
  toPosition?: number | undefined;
538
540
  fromDate?: string | undefined;
@@ -543,12 +545,12 @@ declare namespace EventStoreAPI {
543
545
  includeCount?: boolean | undefined;
544
546
  }, {
545
547
  type?: string | string[] | undefined;
546
- streamId?: string | undefined;
547
548
  limit?: string | undefined;
548
549
  offset?: string | undefined;
549
- transactionId?: string | undefined;
550
+ streamId?: string | undefined;
550
551
  phase?: string | undefined;
551
552
  eventId?: string | undefined;
553
+ transactionId?: string | undefined;
552
554
  fromPosition?: string | undefined;
553
555
  toPosition?: string | undefined;
554
556
  fromDate?: string | undefined;
@@ -574,13 +576,13 @@ declare namespace EventStoreAPI {
574
576
  sortDirection: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
575
577
  includeCount: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, boolean, string>, z.ZodBoolean>>;
576
578
  }, "strip", z.ZodTypeAny, {
577
- streamId?: string | undefined;
578
579
  limit?: number | undefined;
579
580
  offset?: number | undefined;
581
+ streamId?: string | undefined;
580
582
  fromDate?: string | undefined;
581
583
  toDate?: string | undefined;
582
584
  includeArchived?: boolean | undefined;
583
- sortBy?: "streamId" | "createdAt" | "updatedAt" | "streamPosition" | undefined;
585
+ sortBy?: "createdAt" | "updatedAt" | "streamPosition" | "streamId" | undefined;
584
586
  sortDirection?: "asc" | "desc" | undefined;
585
587
  includeCount?: boolean | undefined;
586
588
  streamType?: string | string[] | undefined;
@@ -589,13 +591,13 @@ declare namespace EventStoreAPI {
589
591
  maxPosition?: number | undefined;
590
592
  includeMetadata?: boolean | undefined;
591
593
  }, {
592
- streamId?: string | undefined;
593
594
  limit?: string | undefined;
594
595
  offset?: string | undefined;
596
+ streamId?: string | undefined;
595
597
  fromDate?: string | undefined;
596
598
  toDate?: string | undefined;
597
599
  includeArchived?: string | undefined;
598
- sortBy?: "streamId" | "createdAt" | "updatedAt" | "streamPosition" | undefined;
600
+ sortBy?: "createdAt" | "updatedAt" | "streamPosition" | "streamId" | undefined;
599
601
  sortDirection?: "asc" | "desc" | undefined;
600
602
  includeCount?: string | undefined;
601
603
  streamType?: string | string[] | undefined;
@@ -634,25 +636,25 @@ declare namespace EventStoreAPI {
634
636
  createdAt: z.ZodString;
635
637
  }, "strip", z.ZodTypeAny, {
636
638
  type: string;
637
- streamId: string;
638
- data: Record<string, unknown>;
639
639
  createdAt: string;
640
+ data: Record<string, unknown>;
640
641
  globalPosition: number;
641
642
  streamPosition: number;
643
+ streamId: string;
644
+ eventId: string;
642
645
  schemaVersion: string;
643
646
  transactionId: string;
644
- eventId: string;
645
647
  metadata?: Record<string, unknown> | undefined;
646
648
  }, {
647
649
  type: string;
648
- streamId: string;
649
- data: Record<string, unknown>;
650
650
  createdAt: string;
651
+ data: Record<string, unknown>;
651
652
  globalPosition: number;
652
653
  streamPosition: number;
654
+ streamId: string;
655
+ eventId: string;
653
656
  schemaVersion: string;
654
657
  transactionId: string;
655
- eventId: string;
656
658
  metadata?: Record<string, unknown> | undefined;
657
659
  }>, "many">;
658
660
  pagination: z.ZodObject<{
@@ -674,14 +676,14 @@ declare namespace EventStoreAPI {
674
676
  }, "strip", z.ZodTypeAny, {
675
677
  events: {
676
678
  type: string;
677
- streamId: string;
678
- data: Record<string, unknown>;
679
679
  createdAt: string;
680
+ data: Record<string, unknown>;
680
681
  globalPosition: number;
681
682
  streamPosition: number;
683
+ streamId: string;
684
+ eventId: string;
682
685
  schemaVersion: string;
683
686
  transactionId: string;
684
- eventId: string;
685
687
  metadata?: Record<string, unknown> | undefined;
686
688
  }[];
687
689
  pagination: {
@@ -693,14 +695,14 @@ declare namespace EventStoreAPI {
693
695
  }, {
694
696
  events: {
695
697
  type: string;
696
- streamId: string;
697
- data: Record<string, unknown>;
698
698
  createdAt: string;
699
+ data: Record<string, unknown>;
699
700
  globalPosition: number;
700
701
  streamPosition: number;
702
+ streamId: string;
703
+ eventId: string;
701
704
  schemaVersion: string;
702
705
  transactionId: string;
703
- eventId: string;
704
706
  metadata?: Record<string, unknown> | undefined;
705
707
  }[];
706
708
  pagination: {
@@ -720,19 +722,19 @@ declare namespace EventStoreAPI {
720
722
  createdAt: z.ZodString;
721
723
  updatedAt: z.ZodString;
722
724
  }, "strip", z.ZodTypeAny, {
723
- streamId: string;
724
725
  createdAt: string;
725
726
  updatedAt: string;
726
727
  streamPosition: number;
728
+ streamId: string;
727
729
  streamType: string;
728
730
  isArchived: boolean;
729
731
  lastArchivedPosition: number;
730
732
  streamMetadata?: Record<string, unknown> | undefined;
731
733
  }, {
732
- streamId: string;
733
734
  createdAt: string;
734
735
  updatedAt: string;
735
736
  streamPosition: number;
737
+ streamId: string;
736
738
  streamType: string;
737
739
  isArchived: boolean;
738
740
  lastArchivedPosition: number;
@@ -749,19 +751,19 @@ declare namespace EventStoreAPI {
749
751
  createdAt: z.ZodString;
750
752
  updatedAt: z.ZodString;
751
753
  }, "strip", z.ZodTypeAny, {
752
- streamId: string;
753
754
  createdAt: string;
754
755
  updatedAt: string;
755
756
  streamPosition: number;
757
+ streamId: string;
756
758
  streamType: string;
757
759
  isArchived: boolean;
758
760
  lastArchivedPosition: number;
759
761
  streamMetadata?: Record<string, unknown> | undefined;
760
762
  }, {
761
- streamId: string;
762
763
  createdAt: string;
763
764
  updatedAt: string;
764
765
  streamPosition: number;
766
+ streamId: string;
765
767
  streamType: string;
766
768
  isArchived: boolean;
767
769
  lastArchivedPosition: number;
@@ -791,10 +793,10 @@ declare namespace EventStoreAPI {
791
793
  total?: number | undefined;
792
794
  };
793
795
  streams: {
794
- streamId: string;
795
796
  createdAt: string;
796
797
  updatedAt: string;
797
798
  streamPosition: number;
799
+ streamId: string;
798
800
  streamType: string;
799
801
  isArchived: boolean;
800
802
  lastArchivedPosition: number;
@@ -808,10 +810,10 @@ declare namespace EventStoreAPI {
808
810
  total?: number | undefined;
809
811
  };
810
812
  streams: {
811
- streamId: string;
812
813
  createdAt: string;
813
814
  updatedAt: string;
814
815
  streamPosition: number;
816
+ streamId: string;
815
817
  streamType: string;
816
818
  isArchived: boolean;
817
819
  lastArchivedPosition: number;
@@ -859,15 +861,15 @@ declare namespace EventBusAPI {
859
861
  namespace: z.ZodString;
860
862
  id: z.ZodString;
861
863
  }, "strip", z.ZodTypeAny, {
862
- id: string;
863
864
  namespace: string;
865
+ id: string;
864
866
  retryPolicy?: {
865
867
  maxAttempts: number;
866
868
  backoffMinutes: number;
867
869
  } | undefined;
868
870
  }, {
869
- id: string;
870
871
  namespace: string;
872
+ id: string;
871
873
  retryPolicy?: {
872
874
  maxAttempts: number;
873
875
  backoffMinutes: number;
@@ -876,8 +878,8 @@ declare namespace EventBusAPI {
876
878
  }, "strip", z.ZodTypeAny, {
877
879
  type: "durable_object";
878
880
  config: {
879
- id: string;
880
881
  namespace: string;
882
+ id: string;
881
883
  retryPolicy?: {
882
884
  maxAttempts: number;
883
885
  backoffMinutes: number;
@@ -886,8 +888,8 @@ declare namespace EventBusAPI {
886
888
  }, {
887
889
  type: "durable_object";
888
890
  config: {
889
- id: string;
890
891
  namespace: string;
892
+ id: string;
891
893
  retryPolicy?: {
892
894
  maxAttempts: number;
893
895
  backoffMinutes: number;
@@ -913,41 +915,41 @@ declare namespace EventBusAPI {
913
915
  }, "strip", z.ZodTypeAny, {
914
916
  url: string;
915
917
  headers?: Record<string, string> | undefined;
916
- timeoutMs?: number | undefined;
917
918
  retryPolicy?: {
918
919
  maxAttempts: number;
919
920
  backoffMinutes: number;
920
921
  } | undefined;
922
+ timeoutMs?: number | undefined;
921
923
  }, {
922
924
  url: string;
923
925
  headers?: Record<string, string> | undefined;
924
- timeoutMs?: number | undefined;
925
926
  retryPolicy?: {
926
927
  maxAttempts: number;
927
928
  backoffMinutes: number;
928
929
  } | undefined;
930
+ timeoutMs?: number | undefined;
929
931
  }>;
930
932
  }, "strip", z.ZodTypeAny, {
931
933
  type: "webhook";
932
934
  config: {
933
935
  url: string;
934
936
  headers?: Record<string, string> | undefined;
935
- timeoutMs?: number | undefined;
936
937
  retryPolicy?: {
937
938
  maxAttempts: number;
938
939
  backoffMinutes: number;
939
940
  } | undefined;
941
+ timeoutMs?: number | undefined;
940
942
  };
941
943
  }, {
942
944
  type: "webhook";
943
945
  config: {
944
946
  url: string;
945
947
  headers?: Record<string, string> | undefined;
946
- timeoutMs?: number | undefined;
947
948
  retryPolicy?: {
948
949
  maxAttempts: number;
949
950
  backoffMinutes: number;
950
951
  } | undefined;
952
+ timeoutMs?: number | undefined;
951
953
  };
952
954
  }>, z.ZodObject<{
953
955
  type: z.ZodLiteral<"queue">;
@@ -1104,8 +1106,8 @@ declare namespace EventBusAPI {
1104
1106
  subscriber: {
1105
1107
  type: "durable_object";
1106
1108
  config: {
1107
- id: string;
1108
1109
  namespace: string;
1110
+ id: string;
1109
1111
  retryPolicy?: {
1110
1112
  maxAttempts: number;
1111
1113
  backoffMinutes: number;
@@ -1116,11 +1118,11 @@ declare namespace EventBusAPI {
1116
1118
  config: {
1117
1119
  url: string;
1118
1120
  headers?: Record<string, string> | undefined;
1119
- timeoutMs?: number | undefined;
1120
1121
  retryPolicy?: {
1121
1122
  maxAttempts: number;
1122
1123
  backoffMinutes: number;
1123
1124
  } | undefined;
1125
+ timeoutMs?: number | undefined;
1124
1126
  };
1125
1127
  } | {
1126
1128
  type: "queue";
@@ -1159,8 +1161,8 @@ declare namespace EventBusAPI {
1159
1161
  subscriber: {
1160
1162
  type: "durable_object";
1161
1163
  config: {
1162
- id: string;
1163
1164
  namespace: string;
1165
+ id: string;
1164
1166
  retryPolicy?: {
1165
1167
  maxAttempts: number;
1166
1168
  backoffMinutes: number;
@@ -1171,11 +1173,11 @@ declare namespace EventBusAPI {
1171
1173
  config: {
1172
1174
  url: string;
1173
1175
  headers?: Record<string, string> | undefined;
1174
- timeoutMs?: number | undefined;
1175
1176
  retryPolicy?: {
1176
1177
  maxAttempts: number;
1177
1178
  backoffMinutes: number;
1178
1179
  } | undefined;
1180
+ timeoutMs?: number | undefined;
1179
1181
  };
1180
1182
  } | {
1181
1183
  type: "queue";
@@ -1239,12 +1241,12 @@ declare namespace EventBusAPI {
1239
1241
  }, "strip", z.ZodTypeAny, {
1240
1242
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1241
1243
  eventStoreId: string;
1242
- subscriptionId: string;
1243
1244
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1244
1245
  eventFilter: string;
1245
1246
  subscriberId: string;
1246
1247
  createdAt: string;
1247
1248
  updatedAt: string;
1249
+ subscriptionId: string;
1248
1250
  statusDetails?: {
1249
1251
  lastError?: string | undefined;
1250
1252
  retryCount?: number | undefined;
@@ -1255,12 +1257,12 @@ declare namespace EventBusAPI {
1255
1257
  }, {
1256
1258
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1257
1259
  eventStoreId: string;
1258
- subscriptionId: string;
1259
1260
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1260
1261
  eventFilter: string;
1261
1262
  subscriberId: string;
1262
1263
  createdAt: string;
1263
1264
  updatedAt: string;
1265
+ subscriptionId: string;
1264
1266
  statusDetails?: {
1265
1267
  lastError?: string | undefined;
1266
1268
  retryCount?: number | undefined;
@@ -1299,12 +1301,12 @@ declare namespace EventBusAPI {
1299
1301
  }, "strip", z.ZodTypeAny, {
1300
1302
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1301
1303
  eventStoreId: string;
1302
- subscriptionId: string;
1303
1304
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1304
1305
  eventFilter: string;
1305
1306
  subscriberId: string;
1306
1307
  createdAt: string;
1307
1308
  updatedAt: string;
1309
+ subscriptionId: string;
1308
1310
  statusDetails?: {
1309
1311
  lastError?: string | undefined;
1310
1312
  retryCount?: number | undefined;
@@ -1315,12 +1317,12 @@ declare namespace EventBusAPI {
1315
1317
  }, {
1316
1318
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1317
1319
  eventStoreId: string;
1318
- subscriptionId: string;
1319
1320
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1320
1321
  eventFilter: string;
1321
1322
  subscriberId: string;
1322
1323
  createdAt: string;
1323
1324
  updatedAt: string;
1325
+ subscriptionId: string;
1324
1326
  statusDetails?: {
1325
1327
  lastError?: string | undefined;
1326
1328
  retryCount?: number | undefined;
@@ -1335,12 +1337,12 @@ declare namespace EventBusAPI {
1335
1337
  subscriptions: {
1336
1338
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1337
1339
  eventStoreId: string;
1338
- subscriptionId: string;
1339
1340
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1340
1341
  eventFilter: string;
1341
1342
  subscriberId: string;
1342
1343
  createdAt: string;
1343
1344
  updatedAt: string;
1345
+ subscriptionId: string;
1344
1346
  statusDetails?: {
1345
1347
  lastError?: string | undefined;
1346
1348
  retryCount?: number | undefined;
@@ -1354,12 +1356,12 @@ declare namespace EventBusAPI {
1354
1356
  subscriptions: {
1355
1357
  status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
1356
1358
  eventStoreId: string;
1357
- subscriptionId: string;
1358
1359
  subscriberType: "websocket" | "durable_object" | "webhook" | "queue" | "cloudflare_workflow";
1359
1360
  eventFilter: string;
1360
1361
  subscriberId: string;
1361
1362
  createdAt: string;
1362
1363
  updatedAt: string;
1364
+ subscriptionId: string;
1363
1365
  statusDetails?: {
1364
1366
  lastError?: string | undefined;
1365
1367
  retryCount?: number | undefined;
@@ -1433,7 +1435,6 @@ declare namespace WebSocketsAPI {
1433
1435
  totalCount: z.ZodNumber;
1434
1436
  eventStoreId: z.ZodString;
1435
1437
  }, "strip", z.ZodTypeAny, {
1436
- eventStoreId: string;
1437
1438
  connections: {
1438
1439
  clientId: string;
1439
1440
  connectionId: string;
@@ -1443,8 +1444,8 @@ declare namespace WebSocketsAPI {
1443
1444
  userAgent?: string | undefined;
1444
1445
  }[];
1445
1446
  totalCount: number;
1446
- }, {
1447
1447
  eventStoreId: string;
1448
+ }, {
1448
1449
  connections: {
1449
1450
  clientId: string;
1450
1451
  connectionId: string;
@@ -1454,6 +1455,7 @@ declare namespace WebSocketsAPI {
1454
1455
  userAgent?: string | undefined;
1455
1456
  }[];
1456
1457
  totalCount: number;
1458
+ eventStoreId: string;
1457
1459
  }>;
1458
1460
  const ErrorResponseSchema: z.ZodObject<{
1459
1461
  error: z.ZodString;
@@ -1618,50 +1620,6 @@ declare class EventBusDurableObject extends DurableObject<Env$1> {
1618
1620
  private validateEventFilter;
1619
1621
  }
1620
1622
 
1621
- type Flavour<K, T> = K & {
1622
- readonly __brand?: T;
1623
- };
1624
- type DefaultRecord = Record<string, unknown>;
1625
- type Event<EventType extends string = string, EventData extends DefaultRecord = DefaultRecord, EventMetaData extends DefaultRecord = DefaultRecord> = Flavour<Readonly<{
1626
- type: EventType;
1627
- data: EventData;
1628
- metadata?: EventMetaData;
1629
- }>, 'Event'>;
1630
- type EventTypeOf<T extends Event> = T['type'];
1631
- type EventDataOf<T extends Event> = T['data'];
1632
- type EventMetaDataOf<T extends Event> = T['metadata'];
1633
- type ReadEvent<EventType extends Event = Event> = {
1634
- type: EventTypeOf<EventType>;
1635
- data: EventDataOf<EventType>;
1636
- streamId: string;
1637
- streamPosition: number;
1638
- globalPosition: number;
1639
- eventId: string;
1640
- schemaVersion: string;
1641
- transactionId: string;
1642
- createdAt: string;
1643
- metadata?: EventMetaDataOf<EventType>;
1644
- };
1645
- type ExpectedStreamVersion<VersionType = DefaultStreamVersionType> = ExpectedStreamVersionWithValue<VersionType> | ExpectedStreamVersionGeneral;
1646
- type ExpectedStreamVersionWithValue<VersionType = DefaultStreamVersionType> = Flavour<VersionType, 'StreamVersion'>;
1647
- type ExpectedStreamVersionGeneral = Flavour<'stream_exists' | 'no_stream' | 'any', 'StreamVersion'>;
1648
- type DefaultStreamVersionType = number;
1649
- type ReadStreamOptions<StreamVersion = DefaultStreamVersionType> = ({
1650
- from: StreamVersion;
1651
- } | {
1652
- to: StreamVersion;
1653
- } | {
1654
- from: StreamVersion;
1655
- maxCount?: DefaultStreamVersionType;
1656
- } | {
1657
- expectedStreamVersion: ExpectedStreamVersion<StreamVersion>;
1658
- }) & {
1659
- expectedStreamVersion?: ExpectedStreamVersion<StreamVersion>;
1660
- };
1661
- type AppendToStreamOptions<StreamVersion = DefaultStreamVersionType> = {
1662
- expectedStreamVersion?: ExpectedStreamVersion<StreamVersion>;
1663
- };
1664
-
1665
1623
  /**
1666
1624
  * Query parameters for filtering events
1667
1625
  */
@@ -1789,7 +1747,18 @@ declare class EventStoreDurableObject extends DurableObject<Env> {
1789
1747
  */
1790
1748
  readStream(streamId: string, options?: ReadStreamOptions): Promise<{
1791
1749
  currentStreamVersion: number;
1792
- events: ReadEvent[];
1750
+ events: {
1751
+ type: string;
1752
+ data: _delta_base_toolkit.DefaultRecord;
1753
+ streamId: _delta_base_toolkit.StreamId;
1754
+ streamPosition: _delta_base_toolkit.StreamPosition;
1755
+ globalPosition: _delta_base_toolkit.GlobalPosition;
1756
+ eventId: string;
1757
+ schemaVersion: string;
1758
+ transactionId: string;
1759
+ createdAt: string;
1760
+ metadata?: undefined;
1761
+ }[];
1793
1762
  streamExists: boolean;
1794
1763
  }>;
1795
1764
  /**