@delta-base/core 1.3.6 → 1.4.0
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 +1087 -125
- package/dist/index.js +1 -1
- package/dist/openapi.json +6447 -0
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -81,8 +81,28 @@ declare namespace EventBusAPI {
|
|
|
81
81
|
earliest: "earliest";
|
|
82
82
|
}>>>;
|
|
83
83
|
}, z.core.$strip>;
|
|
84
|
+
const UpdateSubscriptionRequestSchema: z.ZodObject<{
|
|
85
|
+
eventFilter: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodString, z.ZodString, z.ZodString]>, z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodString, z.ZodString, z.ZodString]>>]>>;
|
|
86
|
+
subscriberConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
strategy: z.ZodEnum<{
|
|
89
|
+
fixed: "fixed";
|
|
90
|
+
exponential: "exponential";
|
|
91
|
+
linear: "linear";
|
|
92
|
+
}>;
|
|
93
|
+
maxAttempts: z.ZodNumber;
|
|
94
|
+
initialDelayMs: z.ZodNumber;
|
|
95
|
+
maxDelayMs: z.ZodNumber;
|
|
96
|
+
multiplier: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
jitterPercent: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
100
|
+
ACTIVE: "ACTIVE";
|
|
101
|
+
SUSPENDED: "SUSPENDED";
|
|
102
|
+
}>>;
|
|
103
|
+
}, z.core.$strip>;
|
|
84
104
|
const SubscriptionResponseSchema: z.ZodObject<{
|
|
85
|
-
|
|
105
|
+
subscriberId: z.ZodString;
|
|
86
106
|
status: z.ZodEnum<{
|
|
87
107
|
ACTIVE: "ACTIVE";
|
|
88
108
|
SUSPENDED: "SUSPENDED";
|
|
@@ -98,7 +118,6 @@ declare namespace EventBusAPI {
|
|
|
98
118
|
}, z.core.$strip>>;
|
|
99
119
|
eventStoreName: z.ZodString;
|
|
100
120
|
eventFilter: z.ZodString;
|
|
101
|
-
subscriberId: z.ZodString;
|
|
102
121
|
subscriberType: z.ZodEnum<{
|
|
103
122
|
durable_object: "durable_object";
|
|
104
123
|
webhook: "webhook";
|
|
@@ -106,6 +125,7 @@ declare namespace EventBusAPI {
|
|
|
106
125
|
cloudflare_workflow: "cloudflare_workflow";
|
|
107
126
|
websocket: "websocket";
|
|
108
127
|
}>;
|
|
128
|
+
subscriberConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
109
129
|
createdAt: z.ZodString;
|
|
110
130
|
updatedAt: z.ZodString;
|
|
111
131
|
lastProcessedEventGlobalPosition: z.ZodOptional<z.ZodNumber>;
|
|
@@ -114,7 +134,7 @@ declare namespace EventBusAPI {
|
|
|
114
134
|
}, z.core.$strip>;
|
|
115
135
|
const SubscriptionListResponseSchema: z.ZodObject<{
|
|
116
136
|
subscriptions: z.ZodArray<z.ZodObject<{
|
|
117
|
-
|
|
137
|
+
subscriberId: z.ZodString;
|
|
118
138
|
status: z.ZodEnum<{
|
|
119
139
|
ACTIVE: "ACTIVE";
|
|
120
140
|
SUSPENDED: "SUSPENDED";
|
|
@@ -130,7 +150,6 @@ declare namespace EventBusAPI {
|
|
|
130
150
|
}, z.core.$strip>>;
|
|
131
151
|
eventStoreName: z.ZodString;
|
|
132
152
|
eventFilter: z.ZodString;
|
|
133
|
-
subscriberId: z.ZodString;
|
|
134
153
|
subscriberType: z.ZodEnum<{
|
|
135
154
|
durable_object: "durable_object";
|
|
136
155
|
webhook: "webhook";
|
|
@@ -138,6 +157,7 @@ declare namespace EventBusAPI {
|
|
|
138
157
|
cloudflare_workflow: "cloudflare_workflow";
|
|
139
158
|
websocket: "websocket";
|
|
140
159
|
}>;
|
|
160
|
+
subscriberConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
141
161
|
createdAt: z.ZodString;
|
|
142
162
|
updatedAt: z.ZodString;
|
|
143
163
|
lastProcessedEventGlobalPosition: z.ZodOptional<z.ZodNumber>;
|
|
@@ -222,11 +242,10 @@ declare namespace EventBusAPI {
|
|
|
222
242
|
};
|
|
223
243
|
};
|
|
224
244
|
output: {
|
|
225
|
-
|
|
245
|
+
subscriberId: string;
|
|
226
246
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
227
247
|
eventStoreName: string;
|
|
228
248
|
eventFilter: string;
|
|
229
|
-
subscriberId: string;
|
|
230
249
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
231
250
|
createdAt: string;
|
|
232
251
|
updatedAt: string;
|
|
@@ -236,6 +255,9 @@ declare namespace EventBusAPI {
|
|
|
236
255
|
retryCount?: number | undefined;
|
|
237
256
|
nextRetryAt?: string | undefined;
|
|
238
257
|
} | undefined;
|
|
258
|
+
subscriberConfig?: {
|
|
259
|
+
[x: string]: any;
|
|
260
|
+
} | undefined;
|
|
239
261
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
240
262
|
isExistingSubscription?: boolean | undefined;
|
|
241
263
|
message?: string | undefined;
|
|
@@ -533,12 +555,12 @@ declare namespace EventBusAPI {
|
|
|
533
555
|
};
|
|
534
556
|
};
|
|
535
557
|
} & {
|
|
536
|
-
"/event-stores/:eventStoreName/subscriptions/:
|
|
558
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
537
559
|
$delete: {
|
|
538
560
|
input: {
|
|
539
561
|
param: {
|
|
540
562
|
eventStoreName: string;
|
|
541
|
-
|
|
563
|
+
subscriberId: string;
|
|
542
564
|
};
|
|
543
565
|
};
|
|
544
566
|
output: {
|
|
@@ -554,7 +576,7 @@ declare namespace EventBusAPI {
|
|
|
554
576
|
input: {
|
|
555
577
|
param: {
|
|
556
578
|
eventStoreName: string;
|
|
557
|
-
|
|
579
|
+
subscriberId: string;
|
|
558
580
|
};
|
|
559
581
|
};
|
|
560
582
|
output: {
|
|
@@ -570,7 +592,7 @@ declare namespace EventBusAPI {
|
|
|
570
592
|
input: {
|
|
571
593
|
param: {
|
|
572
594
|
eventStoreName: string;
|
|
573
|
-
|
|
595
|
+
subscriberId: string;
|
|
574
596
|
};
|
|
575
597
|
};
|
|
576
598
|
output: {
|
|
@@ -586,7 +608,7 @@ declare namespace EventBusAPI {
|
|
|
586
608
|
input: {
|
|
587
609
|
param: {
|
|
588
610
|
eventStoreName: string;
|
|
589
|
-
|
|
611
|
+
subscriberId: string;
|
|
590
612
|
};
|
|
591
613
|
};
|
|
592
614
|
output: {
|
|
@@ -680,11 +702,10 @@ declare namespace EventBusAPI {
|
|
|
680
702
|
};
|
|
681
703
|
output: {
|
|
682
704
|
subscriptions: {
|
|
683
|
-
|
|
705
|
+
subscriberId: string;
|
|
684
706
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
685
707
|
eventStoreName: string;
|
|
686
708
|
eventFilter: string;
|
|
687
|
-
subscriberId: string;
|
|
688
709
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
689
710
|
createdAt: string;
|
|
690
711
|
updatedAt: string;
|
|
@@ -694,6 +715,9 @@ declare namespace EventBusAPI {
|
|
|
694
715
|
retryCount?: number | undefined;
|
|
695
716
|
nextRetryAt?: string | undefined;
|
|
696
717
|
} | undefined;
|
|
718
|
+
subscriberConfig?: {
|
|
719
|
+
[x: string]: any;
|
|
720
|
+
} | undefined;
|
|
697
721
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
698
722
|
isExistingSubscription?: boolean | undefined;
|
|
699
723
|
message?: string | undefined;
|
|
@@ -705,20 +729,115 @@ declare namespace EventBusAPI {
|
|
|
705
729
|
};
|
|
706
730
|
};
|
|
707
731
|
} & {
|
|
708
|
-
"/event-stores/:eventStoreName/subscriptions/:
|
|
732
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
709
733
|
$get: {
|
|
710
734
|
input: {
|
|
711
735
|
param: {
|
|
712
736
|
eventStoreName: string;
|
|
713
|
-
|
|
737
|
+
subscriberId: string;
|
|
714
738
|
};
|
|
715
739
|
};
|
|
716
740
|
output: {
|
|
717
|
-
|
|
741
|
+
subscriberId: string;
|
|
718
742
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
719
743
|
eventStoreName: string;
|
|
720
744
|
eventFilter: string;
|
|
745
|
+
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
746
|
+
createdAt: string;
|
|
747
|
+
updatedAt: string;
|
|
748
|
+
statusDetails?: {
|
|
749
|
+
lastError?: string | undefined;
|
|
750
|
+
lastErrorAt?: string | undefined;
|
|
751
|
+
retryCount?: number | undefined;
|
|
752
|
+
nextRetryAt?: string | undefined;
|
|
753
|
+
} | undefined;
|
|
754
|
+
subscriberConfig?: {
|
|
755
|
+
[x: string]: any;
|
|
756
|
+
} | undefined;
|
|
757
|
+
lastProcessedEventGlobalPosition?: number | undefined;
|
|
758
|
+
isExistingSubscription?: boolean | undefined;
|
|
759
|
+
message?: string | undefined;
|
|
760
|
+
};
|
|
761
|
+
outputFormat: "json";
|
|
762
|
+
status: 200;
|
|
763
|
+
} | {
|
|
764
|
+
input: {
|
|
765
|
+
param: {
|
|
766
|
+
eventStoreName: string;
|
|
767
|
+
subscriberId: string;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
output: {
|
|
771
|
+
error: string;
|
|
772
|
+
message: string;
|
|
773
|
+
details?: {
|
|
774
|
+
[x: string]: any;
|
|
775
|
+
} | undefined;
|
|
776
|
+
};
|
|
777
|
+
outputFormat: "json";
|
|
778
|
+
status: 401;
|
|
779
|
+
} | {
|
|
780
|
+
input: {
|
|
781
|
+
param: {
|
|
782
|
+
eventStoreName: string;
|
|
783
|
+
subscriberId: string;
|
|
784
|
+
};
|
|
785
|
+
};
|
|
786
|
+
output: {
|
|
787
|
+
error: string;
|
|
788
|
+
message: string;
|
|
789
|
+
details?: {
|
|
790
|
+
[x: string]: any;
|
|
791
|
+
} | undefined;
|
|
792
|
+
};
|
|
793
|
+
outputFormat: "json";
|
|
794
|
+
status: 404;
|
|
795
|
+
} | {
|
|
796
|
+
input: {
|
|
797
|
+
param: {
|
|
798
|
+
eventStoreName: string;
|
|
799
|
+
subscriberId: string;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
output: {
|
|
803
|
+
error: string;
|
|
804
|
+
message: string;
|
|
805
|
+
details?: {
|
|
806
|
+
[x: string]: any;
|
|
807
|
+
} | undefined;
|
|
808
|
+
};
|
|
809
|
+
outputFormat: "json";
|
|
810
|
+
status: 500;
|
|
811
|
+
};
|
|
812
|
+
};
|
|
813
|
+
} & {
|
|
814
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
815
|
+
$patch: {
|
|
816
|
+
input: {
|
|
817
|
+
param: {
|
|
818
|
+
eventStoreName: string;
|
|
819
|
+
subscriberId: string;
|
|
820
|
+
};
|
|
821
|
+
} & {
|
|
822
|
+
json: {
|
|
823
|
+
eventFilter?: string | string[] | undefined;
|
|
824
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
825
|
+
retryPolicy?: {
|
|
826
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
827
|
+
maxAttempts: number;
|
|
828
|
+
initialDelayMs: number;
|
|
829
|
+
maxDelayMs: number;
|
|
830
|
+
multiplier?: number | undefined;
|
|
831
|
+
jitterPercent?: number | undefined;
|
|
832
|
+
} | undefined;
|
|
833
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
834
|
+
};
|
|
835
|
+
};
|
|
836
|
+
output: {
|
|
721
837
|
subscriberId: string;
|
|
838
|
+
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
839
|
+
eventStoreName: string;
|
|
840
|
+
eventFilter: string;
|
|
722
841
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
723
842
|
createdAt: string;
|
|
724
843
|
updatedAt: string;
|
|
@@ -728,6 +847,9 @@ declare namespace EventBusAPI {
|
|
|
728
847
|
retryCount?: number | undefined;
|
|
729
848
|
nextRetryAt?: string | undefined;
|
|
730
849
|
} | undefined;
|
|
850
|
+
subscriberConfig?: {
|
|
851
|
+
[x: string]: any;
|
|
852
|
+
} | undefined;
|
|
731
853
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
732
854
|
isExistingSubscription?: boolean | undefined;
|
|
733
855
|
message?: string | undefined;
|
|
@@ -738,7 +860,51 @@ declare namespace EventBusAPI {
|
|
|
738
860
|
input: {
|
|
739
861
|
param: {
|
|
740
862
|
eventStoreName: string;
|
|
741
|
-
|
|
863
|
+
subscriberId: string;
|
|
864
|
+
};
|
|
865
|
+
} & {
|
|
866
|
+
json: {
|
|
867
|
+
eventFilter?: string | string[] | undefined;
|
|
868
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
869
|
+
retryPolicy?: {
|
|
870
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
871
|
+
maxAttempts: number;
|
|
872
|
+
initialDelayMs: number;
|
|
873
|
+
maxDelayMs: number;
|
|
874
|
+
multiplier?: number | undefined;
|
|
875
|
+
jitterPercent?: number | undefined;
|
|
876
|
+
} | undefined;
|
|
877
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
878
|
+
};
|
|
879
|
+
};
|
|
880
|
+
output: {
|
|
881
|
+
error: string;
|
|
882
|
+
message: string;
|
|
883
|
+
details?: {
|
|
884
|
+
[x: string]: any;
|
|
885
|
+
} | undefined;
|
|
886
|
+
};
|
|
887
|
+
outputFormat: "json";
|
|
888
|
+
status: 400;
|
|
889
|
+
} | {
|
|
890
|
+
input: {
|
|
891
|
+
param: {
|
|
892
|
+
eventStoreName: string;
|
|
893
|
+
subscriberId: string;
|
|
894
|
+
};
|
|
895
|
+
} & {
|
|
896
|
+
json: {
|
|
897
|
+
eventFilter?: string | string[] | undefined;
|
|
898
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
899
|
+
retryPolicy?: {
|
|
900
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
901
|
+
maxAttempts: number;
|
|
902
|
+
initialDelayMs: number;
|
|
903
|
+
maxDelayMs: number;
|
|
904
|
+
multiplier?: number | undefined;
|
|
905
|
+
jitterPercent?: number | undefined;
|
|
906
|
+
} | undefined;
|
|
907
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
742
908
|
};
|
|
743
909
|
};
|
|
744
910
|
output: {
|
|
@@ -754,7 +920,21 @@ declare namespace EventBusAPI {
|
|
|
754
920
|
input: {
|
|
755
921
|
param: {
|
|
756
922
|
eventStoreName: string;
|
|
757
|
-
|
|
923
|
+
subscriberId: string;
|
|
924
|
+
};
|
|
925
|
+
} & {
|
|
926
|
+
json: {
|
|
927
|
+
eventFilter?: string | string[] | undefined;
|
|
928
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
929
|
+
retryPolicy?: {
|
|
930
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
931
|
+
maxAttempts: number;
|
|
932
|
+
initialDelayMs: number;
|
|
933
|
+
maxDelayMs: number;
|
|
934
|
+
multiplier?: number | undefined;
|
|
935
|
+
jitterPercent?: number | undefined;
|
|
936
|
+
} | undefined;
|
|
937
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
758
938
|
};
|
|
759
939
|
};
|
|
760
940
|
output: {
|
|
@@ -770,7 +950,21 @@ declare namespace EventBusAPI {
|
|
|
770
950
|
input: {
|
|
771
951
|
param: {
|
|
772
952
|
eventStoreName: string;
|
|
773
|
-
|
|
953
|
+
subscriberId: string;
|
|
954
|
+
};
|
|
955
|
+
} & {
|
|
956
|
+
json: {
|
|
957
|
+
eventFilter?: string | string[] | undefined;
|
|
958
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
959
|
+
retryPolicy?: {
|
|
960
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
961
|
+
maxAttempts: number;
|
|
962
|
+
initialDelayMs: number;
|
|
963
|
+
maxDelayMs: number;
|
|
964
|
+
multiplier?: number | undefined;
|
|
965
|
+
jitterPercent?: number | undefined;
|
|
966
|
+
} | undefined;
|
|
967
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
774
968
|
};
|
|
775
969
|
};
|
|
776
970
|
output: {
|
|
@@ -782,6 +976,36 @@ declare namespace EventBusAPI {
|
|
|
782
976
|
};
|
|
783
977
|
outputFormat: "json";
|
|
784
978
|
status: 500;
|
|
979
|
+
} | {
|
|
980
|
+
input: {
|
|
981
|
+
param: {
|
|
982
|
+
eventStoreName: string;
|
|
983
|
+
subscriberId: string;
|
|
984
|
+
};
|
|
985
|
+
} & {
|
|
986
|
+
json: {
|
|
987
|
+
eventFilter?: string | string[] | undefined;
|
|
988
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
989
|
+
retryPolicy?: {
|
|
990
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
991
|
+
maxAttempts: number;
|
|
992
|
+
initialDelayMs: number;
|
|
993
|
+
maxDelayMs: number;
|
|
994
|
+
multiplier?: number | undefined;
|
|
995
|
+
jitterPercent?: number | undefined;
|
|
996
|
+
} | undefined;
|
|
997
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
998
|
+
};
|
|
999
|
+
};
|
|
1000
|
+
output: {
|
|
1001
|
+
error: string;
|
|
1002
|
+
message: string;
|
|
1003
|
+
details?: {
|
|
1004
|
+
[x: string]: any;
|
|
1005
|
+
} | undefined;
|
|
1006
|
+
};
|
|
1007
|
+
outputFormat: "json";
|
|
1008
|
+
status: 409;
|
|
785
1009
|
};
|
|
786
1010
|
};
|
|
787
1011
|
}, "/">;
|
|
@@ -966,6 +1190,58 @@ declare namespace EventStoreAPI {
|
|
|
966
1190
|
hasMore: z.ZodBoolean;
|
|
967
1191
|
}, z.core.$strip>;
|
|
968
1192
|
}, z.core.$strip>;
|
|
1193
|
+
export const OutboxDlqEntrySchema: z.ZodObject<{
|
|
1194
|
+
id: z.ZodNumber;
|
|
1195
|
+
streamId: z.ZodString;
|
|
1196
|
+
streamPosition: z.ZodNumber;
|
|
1197
|
+
globalPosition: z.ZodNumber;
|
|
1198
|
+
messageId: z.ZodString;
|
|
1199
|
+
messageType: z.ZodString;
|
|
1200
|
+
messageData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1201
|
+
messageMetadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1202
|
+
messageSchemaVersion: z.ZodString;
|
|
1203
|
+
transactionId: z.ZodString;
|
|
1204
|
+
totalAttempts: z.ZodNumber;
|
|
1205
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
1206
|
+
dlqReason: z.ZodEnum<{
|
|
1207
|
+
max_publish_retries: "max_publish_retries";
|
|
1208
|
+
eventbus_unreachable: "eventbus_unreachable";
|
|
1209
|
+
manual: "manual";
|
|
1210
|
+
subscriber_deleted: "subscriber_deleted";
|
|
1211
|
+
}>;
|
|
1212
|
+
originalCreatedAt: z.ZodString;
|
|
1213
|
+
movedToDlqAt: z.ZodString;
|
|
1214
|
+
}, z.core.$strip>;
|
|
1215
|
+
export const OutboxDlqListResponseSchema: z.ZodObject<{
|
|
1216
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
1217
|
+
id: z.ZodNumber;
|
|
1218
|
+
streamId: z.ZodString;
|
|
1219
|
+
streamPosition: z.ZodNumber;
|
|
1220
|
+
globalPosition: z.ZodNumber;
|
|
1221
|
+
messageId: z.ZodString;
|
|
1222
|
+
messageType: z.ZodString;
|
|
1223
|
+
messageData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1224
|
+
messageMetadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1225
|
+
messageSchemaVersion: z.ZodString;
|
|
1226
|
+
transactionId: z.ZodString;
|
|
1227
|
+
totalAttempts: z.ZodNumber;
|
|
1228
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
1229
|
+
dlqReason: z.ZodEnum<{
|
|
1230
|
+
max_publish_retries: "max_publish_retries";
|
|
1231
|
+
eventbus_unreachable: "eventbus_unreachable";
|
|
1232
|
+
manual: "manual";
|
|
1233
|
+
subscriber_deleted: "subscriber_deleted";
|
|
1234
|
+
}>;
|
|
1235
|
+
originalCreatedAt: z.ZodString;
|
|
1236
|
+
movedToDlqAt: z.ZodString;
|
|
1237
|
+
}, z.core.$strip>>;
|
|
1238
|
+
pagination: z.ZodObject<{
|
|
1239
|
+
limit: z.ZodNumber;
|
|
1240
|
+
offset: z.ZodNumber;
|
|
1241
|
+
total: z.ZodOptional<z.ZodNumber>;
|
|
1242
|
+
hasMore: z.ZodBoolean;
|
|
1243
|
+
}, z.core.$strip>;
|
|
1244
|
+
}, z.core.$strip>;
|
|
969
1245
|
export type QueryEventsParams = z.infer<typeof QueryEventsParamsSchema>;
|
|
970
1246
|
export type QueryStreamsParams = z.infer<typeof QueryStreamsParamsSchema>;
|
|
971
1247
|
export type QueryEventsResponse = {
|
|
@@ -975,6 +1251,7 @@ declare namespace EventStoreAPI {
|
|
|
975
1251
|
export type QueryStreamsResponse = z.infer<typeof QueryStreamsResponseSchema>;
|
|
976
1252
|
export type Stream = z.infer<typeof StreamSchema>;
|
|
977
1253
|
export type ReadEvent = z.infer<typeof EventSchema>;
|
|
1254
|
+
export type OutboxDlqListResponse = z.infer<typeof OutboxDlqListResponseSchema>;
|
|
978
1255
|
export const routes: OpenAPIHono<{
|
|
979
1256
|
Bindings: Env;
|
|
980
1257
|
Variables: {
|
|
@@ -1617,80 +1894,252 @@ declare namespace EventStoreAPI {
|
|
|
1617
1894
|
status: 200;
|
|
1618
1895
|
};
|
|
1619
1896
|
};
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1897
|
+
} & {
|
|
1898
|
+
"/event-stores/:eventStoreName/outbox-dlq": {
|
|
1899
|
+
$get: {
|
|
1900
|
+
input: {
|
|
1901
|
+
param: {
|
|
1902
|
+
eventStoreName: string;
|
|
1903
|
+
};
|
|
1904
|
+
} & {
|
|
1905
|
+
query: {
|
|
1906
|
+
limit?: string | undefined;
|
|
1907
|
+
offset?: string | undefined;
|
|
1908
|
+
};
|
|
1909
|
+
};
|
|
1910
|
+
output: {
|
|
1911
|
+
error: "UNAUTHORIZED";
|
|
1912
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
1913
|
+
};
|
|
1914
|
+
outputFormat: "json";
|
|
1915
|
+
status: 401;
|
|
1916
|
+
} | {
|
|
1917
|
+
input: {
|
|
1918
|
+
param: {
|
|
1919
|
+
eventStoreName: string;
|
|
1920
|
+
};
|
|
1921
|
+
} & {
|
|
1922
|
+
query: {
|
|
1923
|
+
limit?: string | undefined;
|
|
1924
|
+
offset?: string | undefined;
|
|
1925
|
+
};
|
|
1926
|
+
};
|
|
1927
|
+
output: {
|
|
1928
|
+
entries: {
|
|
1929
|
+
id: number;
|
|
1930
|
+
streamId: string;
|
|
1931
|
+
streamPosition: number;
|
|
1932
|
+
globalPosition: number;
|
|
1933
|
+
messageId: string;
|
|
1934
|
+
messageType: string;
|
|
1935
|
+
messageData: {
|
|
1936
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
1937
|
+
};
|
|
1938
|
+
messageMetadata: {
|
|
1939
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
1940
|
+
};
|
|
1941
|
+
messageSchemaVersion: string;
|
|
1942
|
+
transactionId: string;
|
|
1943
|
+
totalAttempts: number;
|
|
1944
|
+
lastError: string | null;
|
|
1945
|
+
dlqReason: "max_publish_retries" | "eventbus_unreachable" | "manual" | "subscriber_deleted";
|
|
1946
|
+
originalCreatedAt: string;
|
|
1947
|
+
movedToDlqAt: string;
|
|
1948
|
+
}[];
|
|
1949
|
+
pagination: {
|
|
1950
|
+
limit: number;
|
|
1951
|
+
offset: number;
|
|
1952
|
+
hasMore: boolean;
|
|
1953
|
+
total?: number | undefined;
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
outputFormat: "json";
|
|
1957
|
+
status: 200;
|
|
1958
|
+
};
|
|
1959
|
+
};
|
|
1960
|
+
} & {
|
|
1961
|
+
"/event-stores/:eventStoreName/outbox-dlq/:entryId/retry": {
|
|
1962
|
+
$post: {
|
|
1963
|
+
input: {
|
|
1964
|
+
param: {
|
|
1965
|
+
eventStoreName: string;
|
|
1966
|
+
entryId: string;
|
|
1967
|
+
};
|
|
1968
|
+
};
|
|
1969
|
+
output: {
|
|
1970
|
+
error: "UNAUTHORIZED";
|
|
1971
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
1972
|
+
};
|
|
1973
|
+
outputFormat: "json";
|
|
1974
|
+
status: 401;
|
|
1975
|
+
} | {
|
|
1976
|
+
input: {
|
|
1977
|
+
param: {
|
|
1978
|
+
eventStoreName: string;
|
|
1979
|
+
entryId: string;
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
output: {
|
|
1983
|
+
success: boolean;
|
|
1984
|
+
entryId: number;
|
|
1985
|
+
};
|
|
1986
|
+
outputFormat: "json";
|
|
1987
|
+
status: 200;
|
|
1988
|
+
} | {
|
|
1989
|
+
input: {
|
|
1990
|
+
param: {
|
|
1991
|
+
eventStoreName: string;
|
|
1992
|
+
entryId: string;
|
|
1993
|
+
};
|
|
1994
|
+
};
|
|
1995
|
+
output: {
|
|
1996
|
+
error: "Not found";
|
|
1997
|
+
};
|
|
1998
|
+
outputFormat: "json";
|
|
1999
|
+
status: 404;
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
} & {
|
|
2003
|
+
"/event-stores/:eventStoreName/outbox-dlq/retry-all": {
|
|
2004
|
+
$post: {
|
|
2005
|
+
input: {
|
|
2006
|
+
param: {
|
|
2007
|
+
eventStoreName: string;
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
output: {
|
|
2011
|
+
error: "UNAUTHORIZED";
|
|
2012
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
2013
|
+
};
|
|
2014
|
+
outputFormat: "json";
|
|
2015
|
+
status: 401;
|
|
2016
|
+
} | {
|
|
2017
|
+
input: {
|
|
2018
|
+
param: {
|
|
2019
|
+
eventStoreName: string;
|
|
2020
|
+
};
|
|
2021
|
+
};
|
|
2022
|
+
output: {
|
|
2023
|
+
success: boolean;
|
|
2024
|
+
count: number;
|
|
2025
|
+
};
|
|
2026
|
+
outputFormat: "json";
|
|
2027
|
+
status: 200;
|
|
2028
|
+
};
|
|
2029
|
+
};
|
|
2030
|
+
} & {
|
|
2031
|
+
"/event-stores/:eventStoreName/outbox-dlq/:entryId": {
|
|
2032
|
+
$delete: {
|
|
2033
|
+
input: {
|
|
2034
|
+
param: {
|
|
2035
|
+
eventStoreName: string;
|
|
2036
|
+
entryId: string;
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
output: {};
|
|
2040
|
+
outputFormat: string;
|
|
2041
|
+
status: 204;
|
|
2042
|
+
} | {
|
|
2043
|
+
input: {
|
|
2044
|
+
param: {
|
|
2045
|
+
eventStoreName: string;
|
|
2046
|
+
entryId: string;
|
|
2047
|
+
};
|
|
2048
|
+
};
|
|
2049
|
+
output: {
|
|
2050
|
+
error: "UNAUTHORIZED";
|
|
2051
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
2052
|
+
};
|
|
2053
|
+
outputFormat: "json";
|
|
2054
|
+
status: 401;
|
|
2055
|
+
} | {
|
|
2056
|
+
input: {
|
|
2057
|
+
param: {
|
|
2058
|
+
eventStoreName: string;
|
|
2059
|
+
entryId: string;
|
|
2060
|
+
};
|
|
2061
|
+
};
|
|
2062
|
+
output: {
|
|
2063
|
+
error: "Not found";
|
|
2064
|
+
};
|
|
2065
|
+
outputFormat: "json";
|
|
2066
|
+
status: 404;
|
|
2067
|
+
};
|
|
2068
|
+
};
|
|
2069
|
+
}, "/">;
|
|
2070
|
+
export { };
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
declare namespace ManagementAPI {
|
|
2074
|
+
const EventStoreSchema: z.ZodObject<{
|
|
2075
|
+
eventStoreId: z.ZodString;
|
|
2076
|
+
eventStoreName: z.ZodString;
|
|
2077
|
+
eventStoreDurableObjectId: z.ZodString;
|
|
2078
|
+
eventBusDurableObjectId: z.ZodString;
|
|
2079
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2080
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
2081
|
+
retentionPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
2082
|
+
maxStreamSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
2083
|
+
}, z.core.$strip>>;
|
|
2084
|
+
created: z.ZodString;
|
|
2085
|
+
}, z.core.$strip>;
|
|
2086
|
+
const CreateEventStoreRequestSchema: z.ZodObject<{
|
|
2087
|
+
name: z.ZodString;
|
|
2088
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2089
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
2090
|
+
retentionPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
2091
|
+
maxStreamSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
2092
|
+
}, z.core.$strip>>;
|
|
2093
|
+
}, z.core.$strip>;
|
|
2094
|
+
const EventStoreListResponseSchema: z.ZodObject<{
|
|
2095
|
+
eventStores: z.ZodArray<z.ZodObject<{
|
|
2096
|
+
eventStoreId: z.ZodString;
|
|
2097
|
+
eventStoreName: z.ZodString;
|
|
2098
|
+
eventStoreDurableObjectId: z.ZodString;
|
|
2099
|
+
eventBusDurableObjectId: z.ZodString;
|
|
2100
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2101
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
2102
|
+
retentionPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
2103
|
+
maxStreamSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
2104
|
+
}, z.core.$strip>>;
|
|
2105
|
+
created: z.ZodString;
|
|
2106
|
+
}, z.core.$strip>>;
|
|
2107
|
+
totalCount: z.ZodNumber;
|
|
2108
|
+
}, z.core.$strip>;
|
|
2109
|
+
const EventStoreDatabaseSizesSchema: z.ZodObject<{
|
|
2110
|
+
eventStoreDatabaseSize: z.ZodNumber;
|
|
2111
|
+
eventBusDatabaseSize: z.ZodNumber;
|
|
2112
|
+
totalSize: z.ZodNumber;
|
|
2113
|
+
}, z.core.$strip>;
|
|
2114
|
+
const EventStoreDetailsResponseSchema: z.ZodObject<{
|
|
2115
|
+
eventStoreId: z.ZodString;
|
|
2116
|
+
eventStoreName: z.ZodString;
|
|
2117
|
+
eventStoreDurableObjectId: z.ZodString;
|
|
2118
|
+
eventBusDurableObjectId: z.ZodString;
|
|
2119
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2120
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
2121
|
+
retentionPeriodDays: z.ZodOptional<z.ZodNumber>;
|
|
2122
|
+
maxStreamSizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
2123
|
+
}, z.core.$strip>>;
|
|
2124
|
+
created: z.ZodString;
|
|
2125
|
+
streams: z.ZodOptional<z.ZodObject<{
|
|
2126
|
+
count: z.ZodNumber;
|
|
2127
|
+
totalEvents: z.ZodNumber;
|
|
2128
|
+
}, z.core.$strip>>;
|
|
2129
|
+
databaseSizes: z.ZodOptional<z.ZodObject<{
|
|
2130
|
+
eventStoreDatabaseSize: z.ZodNumber;
|
|
2131
|
+
eventBusDatabaseSize: z.ZodNumber;
|
|
2132
|
+
totalSize: z.ZodNumber;
|
|
2133
|
+
}, z.core.$strip>>;
|
|
2134
|
+
}, z.core.$strip>;
|
|
2135
|
+
const ErrorResponseSchema: z.ZodObject<{
|
|
2136
|
+
error: z.ZodString;
|
|
2137
|
+
message: z.ZodString;
|
|
2138
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
2139
|
+
}, z.core.$strip>;
|
|
2140
|
+
const routes: OpenAPIHono<{
|
|
2141
|
+
Bindings: Env;
|
|
2142
|
+
Variables: {
|
|
1694
2143
|
orgId: string;
|
|
1695
2144
|
};
|
|
1696
2145
|
}, {
|
|
@@ -2340,6 +2789,16 @@ declare namespace WebSocketsAPI {
|
|
|
2340
2789
|
}, "/">;
|
|
2341
2790
|
}
|
|
2342
2791
|
|
|
2792
|
+
type RetryStrategy = 'exponential' | 'linear' | 'fixed';
|
|
2793
|
+
interface RetryPolicy {
|
|
2794
|
+
strategy: RetryStrategy;
|
|
2795
|
+
maxAttempts: number;
|
|
2796
|
+
initialDelayMs: number;
|
|
2797
|
+
maxDelayMs: number;
|
|
2798
|
+
multiplier?: number;
|
|
2799
|
+
jitterPercent?: number;
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2343
2802
|
type WildcardPattern = '*' | `${string}.*` | `*.${string}` | `${string}.*${string}`;
|
|
2344
2803
|
type EventType = string;
|
|
2345
2804
|
type EventFilter = EventType | EventType[] | WildcardPattern;
|
|
@@ -2396,9 +2855,6 @@ type SubscriberTypeConfig = {
|
|
|
2396
2855
|
type: SubscriberType.WebSocket;
|
|
2397
2856
|
config: WebSocketConfig;
|
|
2398
2857
|
};
|
|
2399
|
-
interface Env$1 {
|
|
2400
|
-
[key: string]: DurableObjectNamespace | Workflow;
|
|
2401
|
-
}
|
|
2402
2858
|
interface EventMessage {
|
|
2403
2859
|
event_id: string;
|
|
2404
2860
|
event_type: string;
|
|
@@ -2416,6 +2872,8 @@ interface SubscriptionListOptions {
|
|
|
2416
2872
|
eventFilter?: string;
|
|
2417
2873
|
limit?: number;
|
|
2418
2874
|
offset?: number;
|
|
2875
|
+
/** When true (default), hides platform-internal subscriptions (e.g. ws-manager). */
|
|
2876
|
+
hideInternal?: boolean;
|
|
2419
2877
|
}
|
|
2420
2878
|
declare enum SubscriptionStatus {
|
|
2421
2879
|
ACTIVE = "ACTIVE",
|
|
@@ -2440,11 +2898,11 @@ interface StatusDetails {
|
|
|
2440
2898
|
};
|
|
2441
2899
|
}
|
|
2442
2900
|
interface Subscription {
|
|
2443
|
-
id: string;
|
|
2444
|
-
eventFilter: string;
|
|
2445
2901
|
subscriberId: string;
|
|
2902
|
+
eventFilter: string;
|
|
2446
2903
|
subscriberType: SubscriberType;
|
|
2447
2904
|
subscriberConfig: string;
|
|
2905
|
+
subscriberDoId?: string | null;
|
|
2448
2906
|
status: SubscriptionStatus;
|
|
2449
2907
|
statusDetails?: StatusDetails;
|
|
2450
2908
|
lastProcessedEventGlobalPosition: number;
|
|
@@ -2456,7 +2914,7 @@ interface SubscriptionResult {
|
|
|
2456
2914
|
isExistingSubscription: boolean;
|
|
2457
2915
|
message: string;
|
|
2458
2916
|
}
|
|
2459
|
-
declare class EventBusDurableObject extends DurableObject<Env
|
|
2917
|
+
declare class EventBusDurableObject extends DurableObject<Env> {
|
|
2460
2918
|
private readonly BATCH_SIZE;
|
|
2461
2919
|
private readonly RETRY_DELAY_HOURS;
|
|
2462
2920
|
/** Maximum messages to process per subscriber per batch (for round-robin fairness) */
|
|
@@ -2477,16 +2935,18 @@ declare class EventBusDurableObject extends DurableObject<Env$1> {
|
|
|
2477
2935
|
* @private
|
|
2478
2936
|
*/
|
|
2479
2937
|
private formatDateToISO;
|
|
2938
|
+
constructor(state: DurableObjectState, env: Env);
|
|
2939
|
+
private initializeTables;
|
|
2940
|
+
private ensureSubscriberDoColumn;
|
|
2480
2941
|
/**
|
|
2481
|
-
*
|
|
2482
|
-
*
|
|
2483
|
-
*
|
|
2484
|
-
*
|
|
2485
|
-
*
|
|
2942
|
+
* Migrates old subscriptions table schema (id INTEGER PK + UNIQUE(event_filter, subscriber_id))
|
|
2943
|
+
* to new schema (subscriber_id TEXT PK). This is needed because ON CONFLICT(subscriber_id)
|
|
2944
|
+
* requires subscriber_id to be a PK or have a UNIQUE constraint on its own.
|
|
2945
|
+
*
|
|
2946
|
+
* Old DOs created before this migration have the old schema due to CREATE TABLE IF NOT EXISTS
|
|
2947
|
+
* being a no-op when the table already exists.
|
|
2486
2948
|
*/
|
|
2487
|
-
private
|
|
2488
|
-
constructor(state: DurableObjectState, env: Env$1);
|
|
2489
|
-
private initializeTables;
|
|
2949
|
+
private migrateSubscriptionsPrimaryKey;
|
|
2490
2950
|
initialize(eventStoreID: string): void;
|
|
2491
2951
|
/**
|
|
2492
2952
|
* Ensures the event bus has been initialized
|
|
@@ -2494,6 +2954,7 @@ declare class EventBusDurableObject extends DurableObject<Env$1> {
|
|
|
2494
2954
|
* @private
|
|
2495
2955
|
*/
|
|
2496
2956
|
private ensureInitialized;
|
|
2957
|
+
private getEventStoreId;
|
|
2497
2958
|
/**
|
|
2498
2959
|
* Check if a webhook subscription with the same configuration already exists
|
|
2499
2960
|
* @param eventFilter - The event filter pattern to match
|
|
@@ -2513,10 +2974,17 @@ declare class EventBusDurableObject extends DurableObject<Env$1> {
|
|
|
2513
2974
|
subscribe(eventFilter: EventFilter, subscriberId: string, subscription: SubscriberTypeConfig, initialPosition?: InitialPosition): Promise<SubscriptionResult>;
|
|
2514
2975
|
private validateSubscriberConfig;
|
|
2515
2976
|
private updateSubscriptionStatus;
|
|
2977
|
+
private initializeSubscriberDurableObject;
|
|
2516
2978
|
unsubscribe(subscriberId: string): Promise<void>;
|
|
2979
|
+
updateSubscription(subscriberId: string, updates: {
|
|
2980
|
+
eventFilter?: string;
|
|
2981
|
+
subscriberConfig?: Record<string, unknown>;
|
|
2982
|
+
retryPolicy?: RetryPolicy;
|
|
2983
|
+
status?: 'ACTIVE' | 'SUSPENDED';
|
|
2984
|
+
}): Promise<Subscription>;
|
|
2517
2985
|
getSubscriptions(options?: SubscriptionListOptions): Promise<Subscription[]>;
|
|
2518
2986
|
getSubscriptionsCount(options?: Omit<SubscriptionListOptions, 'limit' | 'offset'>): Promise<number>;
|
|
2519
|
-
getSubscription(
|
|
2987
|
+
getSubscription(subscriberId: string): Promise<Subscription | null>;
|
|
2520
2988
|
publish(events: {
|
|
2521
2989
|
event_id: string;
|
|
2522
2990
|
event_type: string;
|
|
@@ -2578,6 +3046,48 @@ declare class EventBusDurableObject extends DurableObject<Env$1> {
|
|
|
2578
3046
|
pending_messages: number;
|
|
2579
3047
|
};
|
|
2580
3048
|
private validateEventFilter;
|
|
3049
|
+
/**
|
|
3050
|
+
* Validates the subscriber ID format.
|
|
3051
|
+
* Must be 1-128 characters, alphanumeric with hyphens and underscores only.
|
|
3052
|
+
* This is compatible with nanoid() default output (A-Za-z0-9_-) and
|
|
3053
|
+
* is URL-safe (no percent-encoding needed in path segments).
|
|
3054
|
+
* @param subscriberId - The subscriber ID to validate
|
|
3055
|
+
* @throws ValidationError if the subscriber ID is invalid
|
|
3056
|
+
* @private
|
|
3057
|
+
*/
|
|
3058
|
+
private validateSubscriberId;
|
|
3059
|
+
/**
|
|
3060
|
+
* Checks that the subscriber ID is not already in use with a different event filter.
|
|
3061
|
+
* Enforces subscriber ID uniqueness within an event bus — each subscriber ID
|
|
3062
|
+
* maps to exactly one subscription. Re-subscribing with the same (subscriberId, eventFilter)
|
|
3063
|
+
* pair is allowed (idempotent upsert).
|
|
3064
|
+
* @param subscriberId - The subscriber ID to check
|
|
3065
|
+
* @param eventFilter - The event filter for the new subscription
|
|
3066
|
+
* @throws ValidationError if the subscriber ID is already in use with a different event filter
|
|
3067
|
+
* @private
|
|
3068
|
+
*/
|
|
3069
|
+
private ensureSubscriberIdUnique;
|
|
3070
|
+
/**
|
|
3071
|
+
* Migrates all unmigrated subscriptions to SubscriberDOs.
|
|
3072
|
+
* This method is idempotent - running it multiple times is safe.
|
|
3073
|
+
*/
|
|
3074
|
+
migrateAllSubscriptions(): Promise<{
|
|
3075
|
+
subscriptionsMigrated: number;
|
|
3076
|
+
outboxEntriesMoved: number;
|
|
3077
|
+
}>;
|
|
3078
|
+
/**
|
|
3079
|
+
* Gets migration status for this EventBusDO
|
|
3080
|
+
*/
|
|
3081
|
+
getMigrationStatus(): Promise<{
|
|
3082
|
+
totalSubscriptions: number;
|
|
3083
|
+
migratedCount: number;
|
|
3084
|
+
legacyCount: number;
|
|
3085
|
+
legacyOutboxCount: number;
|
|
3086
|
+
}>;
|
|
3087
|
+
/**
|
|
3088
|
+
* Reconstructs an EventMessage from a subscriptions_outbox row
|
|
3089
|
+
*/
|
|
3090
|
+
private reconstructEventFromOutbox;
|
|
2581
3091
|
}
|
|
2582
3092
|
|
|
2583
3093
|
/**
|
|
@@ -2652,6 +3162,32 @@ type QueryStreamsResult = {
|
|
|
2652
3162
|
hasMore: boolean;
|
|
2653
3163
|
};
|
|
2654
3164
|
};
|
|
3165
|
+
type OutboxDlqEntry = {
|
|
3166
|
+
id: number;
|
|
3167
|
+
streamId: string;
|
|
3168
|
+
streamPosition: number;
|
|
3169
|
+
globalPosition: number;
|
|
3170
|
+
messageId: string;
|
|
3171
|
+
messageType: string;
|
|
3172
|
+
messageData: Record<string, unknown>;
|
|
3173
|
+
messageMetadata: Record<string, unknown>;
|
|
3174
|
+
messageSchemaVersion: string;
|
|
3175
|
+
transactionId: string;
|
|
3176
|
+
totalAttempts: number;
|
|
3177
|
+
lastError: string | null;
|
|
3178
|
+
dlqReason: 'max_publish_retries' | 'eventbus_unreachable' | 'manual' | 'subscriber_deleted';
|
|
3179
|
+
originalCreatedAt: string;
|
|
3180
|
+
movedToDlqAt: string;
|
|
3181
|
+
};
|
|
3182
|
+
type OutboxDlqResult = {
|
|
3183
|
+
entries: OutboxDlqEntry[];
|
|
3184
|
+
pagination: {
|
|
3185
|
+
limit: number;
|
|
3186
|
+
offset: number;
|
|
3187
|
+
total: number;
|
|
3188
|
+
hasMore: boolean;
|
|
3189
|
+
};
|
|
3190
|
+
};
|
|
2655
3191
|
/**
|
|
2656
3192
|
* A durable object implementation of an event store.
|
|
2657
3193
|
* Handles event persistence, archiving, and event bus integration.
|
|
@@ -2775,6 +3311,7 @@ declare class EventStoreDurableObject extends DurableObject<Env> {
|
|
|
2775
3311
|
* @private
|
|
2776
3312
|
*/
|
|
2777
3313
|
private mapRowToEvent;
|
|
3314
|
+
private mapRowToOutboxDlqEntry;
|
|
2778
3315
|
/**
|
|
2779
3316
|
* Gets the current version of a stream
|
|
2780
3317
|
* @param streamId - The stream to get the version for
|
|
@@ -2836,6 +3373,13 @@ declare class EventStoreDurableObject extends DurableObject<Env> {
|
|
|
2836
3373
|
* @private
|
|
2837
3374
|
*/
|
|
2838
3375
|
private processPendingEventBusMessages;
|
|
3376
|
+
listOutboxDlq(options?: {
|
|
3377
|
+
limit?: number;
|
|
3378
|
+
offset?: number;
|
|
3379
|
+
}): Promise<OutboxDlqResult>;
|
|
3380
|
+
retryOutboxDlqEntry(entryId: number): Promise<boolean>;
|
|
3381
|
+
retryAllOutboxDlq(): Promise<number>;
|
|
3382
|
+
deleteOutboxDlqEntry(entryId: number): Promise<boolean>;
|
|
2839
3383
|
/**
|
|
2840
3384
|
* Gets the current database size in bytes (consistent with EventBusDO)
|
|
2841
3385
|
* @returns Database size in bytes
|
|
@@ -3088,6 +3632,42 @@ declare class EventStoreManagerDurableObject extends DurableObject<Env> {
|
|
|
3088
3632
|
}>;
|
|
3089
3633
|
}
|
|
3090
3634
|
|
|
3635
|
+
interface SubscriberInitConfig {
|
|
3636
|
+
subscriberId: string;
|
|
3637
|
+
subscriberType: SubscriberType;
|
|
3638
|
+
subscriberConfig: SubscriberTypeConfig['config'];
|
|
3639
|
+
eventFilter: string;
|
|
3640
|
+
retryPolicy: RetryPolicy;
|
|
3641
|
+
}
|
|
3642
|
+
type SubscriberStatus = 'ACTIVE' | 'PAUSED' | 'ERROR';
|
|
3643
|
+
declare class SubscriberDurableObject extends DurableObject<Env> {
|
|
3644
|
+
private readonly BATCH_SIZE;
|
|
3645
|
+
private readonly MAX_BATCHES_PER_ALARM;
|
|
3646
|
+
private isAlarmActive;
|
|
3647
|
+
private isSchedulingAlarm;
|
|
3648
|
+
sql: SqlStorage;
|
|
3649
|
+
constructor(state: DurableObjectState, env: Env);
|
|
3650
|
+
private initializeTables;
|
|
3651
|
+
initialize(config: SubscriberInitConfig): void;
|
|
3652
|
+
setCursor(position: number): void;
|
|
3653
|
+
enqueue(events: EventMessage[]): Promise<void>;
|
|
3654
|
+
private requestAlarm;
|
|
3655
|
+
private getConfigRow;
|
|
3656
|
+
private getSubscriberStatus;
|
|
3657
|
+
private getRetryPolicy;
|
|
3658
|
+
private getSubscriberConfig;
|
|
3659
|
+
updateStatus(status: SubscriberStatus, _error?: string): void;
|
|
3660
|
+
private getReadyOutboxBatch;
|
|
3661
|
+
private getNextAlarmTime;
|
|
3662
|
+
private scheduleNextAlarm;
|
|
3663
|
+
private reconstructEvent;
|
|
3664
|
+
private markEventDelivered;
|
|
3665
|
+
private moveToDlq;
|
|
3666
|
+
private updateRetryState;
|
|
3667
|
+
private deliverEvent;
|
|
3668
|
+
alarm(): Promise<void>;
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3091
3671
|
interface ConnectionListOptions {
|
|
3092
3672
|
limit?: number;
|
|
3093
3673
|
offset?: number;
|
|
@@ -4204,6 +4784,178 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4204
4784
|
status: 200;
|
|
4205
4785
|
};
|
|
4206
4786
|
};
|
|
4787
|
+
} & {
|
|
4788
|
+
"/event-stores/:eventStoreName/outbox-dlq": {
|
|
4789
|
+
$get: {
|
|
4790
|
+
input: {
|
|
4791
|
+
param: {
|
|
4792
|
+
eventStoreName: string;
|
|
4793
|
+
};
|
|
4794
|
+
} & {
|
|
4795
|
+
query: {
|
|
4796
|
+
limit?: string | undefined;
|
|
4797
|
+
offset?: string | undefined;
|
|
4798
|
+
};
|
|
4799
|
+
};
|
|
4800
|
+
output: {
|
|
4801
|
+
error: "UNAUTHORIZED";
|
|
4802
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
4803
|
+
};
|
|
4804
|
+
outputFormat: "json";
|
|
4805
|
+
status: 401;
|
|
4806
|
+
} | {
|
|
4807
|
+
input: {
|
|
4808
|
+
param: {
|
|
4809
|
+
eventStoreName: string;
|
|
4810
|
+
};
|
|
4811
|
+
} & {
|
|
4812
|
+
query: {
|
|
4813
|
+
limit?: string | undefined;
|
|
4814
|
+
offset?: string | undefined;
|
|
4815
|
+
};
|
|
4816
|
+
};
|
|
4817
|
+
output: {
|
|
4818
|
+
entries: {
|
|
4819
|
+
id: number;
|
|
4820
|
+
streamId: string;
|
|
4821
|
+
streamPosition: number;
|
|
4822
|
+
globalPosition: number;
|
|
4823
|
+
messageId: string;
|
|
4824
|
+
messageType: string;
|
|
4825
|
+
messageData: {
|
|
4826
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
4827
|
+
};
|
|
4828
|
+
messageMetadata: {
|
|
4829
|
+
[x: string]: hono_utils_types.JSONValue;
|
|
4830
|
+
};
|
|
4831
|
+
messageSchemaVersion: string;
|
|
4832
|
+
transactionId: string;
|
|
4833
|
+
totalAttempts: number;
|
|
4834
|
+
lastError: string | null;
|
|
4835
|
+
dlqReason: "max_publish_retries" | "eventbus_unreachable" | "manual" | "subscriber_deleted";
|
|
4836
|
+
originalCreatedAt: string;
|
|
4837
|
+
movedToDlqAt: string;
|
|
4838
|
+
}[];
|
|
4839
|
+
pagination: {
|
|
4840
|
+
limit: number;
|
|
4841
|
+
offset: number;
|
|
4842
|
+
hasMore: boolean;
|
|
4843
|
+
total?: number | undefined;
|
|
4844
|
+
};
|
|
4845
|
+
};
|
|
4846
|
+
outputFormat: "json";
|
|
4847
|
+
status: 200;
|
|
4848
|
+
};
|
|
4849
|
+
};
|
|
4850
|
+
} & {
|
|
4851
|
+
"/event-stores/:eventStoreName/outbox-dlq/:entryId/retry": {
|
|
4852
|
+
$post: {
|
|
4853
|
+
input: {
|
|
4854
|
+
param: {
|
|
4855
|
+
eventStoreName: string;
|
|
4856
|
+
entryId: string;
|
|
4857
|
+
};
|
|
4858
|
+
};
|
|
4859
|
+
output: {
|
|
4860
|
+
error: "UNAUTHORIZED";
|
|
4861
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
4862
|
+
};
|
|
4863
|
+
outputFormat: "json";
|
|
4864
|
+
status: 401;
|
|
4865
|
+
} | {
|
|
4866
|
+
input: {
|
|
4867
|
+
param: {
|
|
4868
|
+
eventStoreName: string;
|
|
4869
|
+
entryId: string;
|
|
4870
|
+
};
|
|
4871
|
+
};
|
|
4872
|
+
output: {
|
|
4873
|
+
success: boolean;
|
|
4874
|
+
entryId: number;
|
|
4875
|
+
};
|
|
4876
|
+
outputFormat: "json";
|
|
4877
|
+
status: 200;
|
|
4878
|
+
} | {
|
|
4879
|
+
input: {
|
|
4880
|
+
param: {
|
|
4881
|
+
eventStoreName: string;
|
|
4882
|
+
entryId: string;
|
|
4883
|
+
};
|
|
4884
|
+
};
|
|
4885
|
+
output: {
|
|
4886
|
+
error: "Not found";
|
|
4887
|
+
};
|
|
4888
|
+
outputFormat: "json";
|
|
4889
|
+
status: 404;
|
|
4890
|
+
};
|
|
4891
|
+
};
|
|
4892
|
+
} & {
|
|
4893
|
+
"/event-stores/:eventStoreName/outbox-dlq/retry-all": {
|
|
4894
|
+
$post: {
|
|
4895
|
+
input: {
|
|
4896
|
+
param: {
|
|
4897
|
+
eventStoreName: string;
|
|
4898
|
+
};
|
|
4899
|
+
};
|
|
4900
|
+
output: {
|
|
4901
|
+
error: "UNAUTHORIZED";
|
|
4902
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
4903
|
+
};
|
|
4904
|
+
outputFormat: "json";
|
|
4905
|
+
status: 401;
|
|
4906
|
+
} | {
|
|
4907
|
+
input: {
|
|
4908
|
+
param: {
|
|
4909
|
+
eventStoreName: string;
|
|
4910
|
+
};
|
|
4911
|
+
};
|
|
4912
|
+
output: {
|
|
4913
|
+
success: boolean;
|
|
4914
|
+
count: number;
|
|
4915
|
+
};
|
|
4916
|
+
outputFormat: "json";
|
|
4917
|
+
status: 200;
|
|
4918
|
+
};
|
|
4919
|
+
};
|
|
4920
|
+
} & {
|
|
4921
|
+
"/event-stores/:eventStoreName/outbox-dlq/:entryId": {
|
|
4922
|
+
$delete: {
|
|
4923
|
+
input: {
|
|
4924
|
+
param: {
|
|
4925
|
+
eventStoreName: string;
|
|
4926
|
+
entryId: string;
|
|
4927
|
+
};
|
|
4928
|
+
};
|
|
4929
|
+
output: {};
|
|
4930
|
+
outputFormat: string;
|
|
4931
|
+
status: 204;
|
|
4932
|
+
} | {
|
|
4933
|
+
input: {
|
|
4934
|
+
param: {
|
|
4935
|
+
eventStoreName: string;
|
|
4936
|
+
entryId: string;
|
|
4937
|
+
};
|
|
4938
|
+
};
|
|
4939
|
+
output: {
|
|
4940
|
+
error: "UNAUTHORIZED";
|
|
4941
|
+
message: "Unauthorized: Organization ID not found in authentication context";
|
|
4942
|
+
};
|
|
4943
|
+
outputFormat: "json";
|
|
4944
|
+
status: 401;
|
|
4945
|
+
} | {
|
|
4946
|
+
input: {
|
|
4947
|
+
param: {
|
|
4948
|
+
eventStoreName: string;
|
|
4949
|
+
entryId: string;
|
|
4950
|
+
};
|
|
4951
|
+
};
|
|
4952
|
+
output: {
|
|
4953
|
+
error: "Not found";
|
|
4954
|
+
};
|
|
4955
|
+
outputFormat: "json";
|
|
4956
|
+
status: 404;
|
|
4957
|
+
};
|
|
4958
|
+
};
|
|
4207
4959
|
}, "/api"> | hono_types.MergeSchemaPath<{
|
|
4208
4960
|
"/event-stores/:eventStoreName/subscribe": {
|
|
4209
4961
|
$post: {
|
|
@@ -4270,11 +5022,10 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4270
5022
|
};
|
|
4271
5023
|
};
|
|
4272
5024
|
output: {
|
|
4273
|
-
|
|
5025
|
+
subscriberId: string;
|
|
4274
5026
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
4275
5027
|
eventStoreName: string;
|
|
4276
5028
|
eventFilter: string;
|
|
4277
|
-
subscriberId: string;
|
|
4278
5029
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
4279
5030
|
createdAt: string;
|
|
4280
5031
|
updatedAt: string;
|
|
@@ -4284,6 +5035,9 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4284
5035
|
retryCount?: number | undefined;
|
|
4285
5036
|
nextRetryAt?: string | undefined;
|
|
4286
5037
|
} | undefined;
|
|
5038
|
+
subscriberConfig?: {
|
|
5039
|
+
[x: string]: any;
|
|
5040
|
+
} | undefined;
|
|
4287
5041
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
4288
5042
|
isExistingSubscription?: boolean | undefined;
|
|
4289
5043
|
message?: string | undefined;
|
|
@@ -4581,12 +5335,12 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4581
5335
|
};
|
|
4582
5336
|
};
|
|
4583
5337
|
} & {
|
|
4584
|
-
"/event-stores/:eventStoreName/subscriptions/:
|
|
5338
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
4585
5339
|
$delete: {
|
|
4586
5340
|
input: {
|
|
4587
5341
|
param: {
|
|
4588
5342
|
eventStoreName: string;
|
|
4589
|
-
|
|
5343
|
+
subscriberId: string;
|
|
4590
5344
|
};
|
|
4591
5345
|
};
|
|
4592
5346
|
output: {
|
|
@@ -4602,7 +5356,7 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4602
5356
|
input: {
|
|
4603
5357
|
param: {
|
|
4604
5358
|
eventStoreName: string;
|
|
4605
|
-
|
|
5359
|
+
subscriberId: string;
|
|
4606
5360
|
};
|
|
4607
5361
|
};
|
|
4608
5362
|
output: {
|
|
@@ -4618,7 +5372,7 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4618
5372
|
input: {
|
|
4619
5373
|
param: {
|
|
4620
5374
|
eventStoreName: string;
|
|
4621
|
-
|
|
5375
|
+
subscriberId: string;
|
|
4622
5376
|
};
|
|
4623
5377
|
};
|
|
4624
5378
|
output: {
|
|
@@ -4634,7 +5388,7 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4634
5388
|
input: {
|
|
4635
5389
|
param: {
|
|
4636
5390
|
eventStoreName: string;
|
|
4637
|
-
|
|
5391
|
+
subscriberId: string;
|
|
4638
5392
|
};
|
|
4639
5393
|
};
|
|
4640
5394
|
output: {
|
|
@@ -4728,11 +5482,10 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4728
5482
|
};
|
|
4729
5483
|
output: {
|
|
4730
5484
|
subscriptions: {
|
|
4731
|
-
|
|
5485
|
+
subscriberId: string;
|
|
4732
5486
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
4733
5487
|
eventStoreName: string;
|
|
4734
5488
|
eventFilter: string;
|
|
4735
|
-
subscriberId: string;
|
|
4736
5489
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
4737
5490
|
createdAt: string;
|
|
4738
5491
|
updatedAt: string;
|
|
@@ -4742,6 +5495,9 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4742
5495
|
retryCount?: number | undefined;
|
|
4743
5496
|
nextRetryAt?: string | undefined;
|
|
4744
5497
|
} | undefined;
|
|
5498
|
+
subscriberConfig?: {
|
|
5499
|
+
[x: string]: any;
|
|
5500
|
+
} | undefined;
|
|
4745
5501
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
4746
5502
|
isExistingSubscription?: boolean | undefined;
|
|
4747
5503
|
message?: string | undefined;
|
|
@@ -4753,20 +5509,115 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4753
5509
|
};
|
|
4754
5510
|
};
|
|
4755
5511
|
} & {
|
|
4756
|
-
"/event-stores/:eventStoreName/subscriptions/:
|
|
5512
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
4757
5513
|
$get: {
|
|
4758
5514
|
input: {
|
|
4759
5515
|
param: {
|
|
4760
5516
|
eventStoreName: string;
|
|
4761
|
-
|
|
5517
|
+
subscriberId: string;
|
|
4762
5518
|
};
|
|
4763
5519
|
};
|
|
4764
5520
|
output: {
|
|
4765
|
-
|
|
5521
|
+
subscriberId: string;
|
|
4766
5522
|
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
4767
5523
|
eventStoreName: string;
|
|
4768
5524
|
eventFilter: string;
|
|
5525
|
+
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
5526
|
+
createdAt: string;
|
|
5527
|
+
updatedAt: string;
|
|
5528
|
+
statusDetails?: {
|
|
5529
|
+
lastError?: string | undefined;
|
|
5530
|
+
lastErrorAt?: string | undefined;
|
|
5531
|
+
retryCount?: number | undefined;
|
|
5532
|
+
nextRetryAt?: string | undefined;
|
|
5533
|
+
} | undefined;
|
|
5534
|
+
subscriberConfig?: {
|
|
5535
|
+
[x: string]: any;
|
|
5536
|
+
} | undefined;
|
|
5537
|
+
lastProcessedEventGlobalPosition?: number | undefined;
|
|
5538
|
+
isExistingSubscription?: boolean | undefined;
|
|
5539
|
+
message?: string | undefined;
|
|
5540
|
+
};
|
|
5541
|
+
outputFormat: "json";
|
|
5542
|
+
status: 200;
|
|
5543
|
+
} | {
|
|
5544
|
+
input: {
|
|
5545
|
+
param: {
|
|
5546
|
+
eventStoreName: string;
|
|
5547
|
+
subscriberId: string;
|
|
5548
|
+
};
|
|
5549
|
+
};
|
|
5550
|
+
output: {
|
|
5551
|
+
error: string;
|
|
5552
|
+
message: string;
|
|
5553
|
+
details?: {
|
|
5554
|
+
[x: string]: any;
|
|
5555
|
+
} | undefined;
|
|
5556
|
+
};
|
|
5557
|
+
outputFormat: "json";
|
|
5558
|
+
status: 401;
|
|
5559
|
+
} | {
|
|
5560
|
+
input: {
|
|
5561
|
+
param: {
|
|
5562
|
+
eventStoreName: string;
|
|
5563
|
+
subscriberId: string;
|
|
5564
|
+
};
|
|
5565
|
+
};
|
|
5566
|
+
output: {
|
|
5567
|
+
error: string;
|
|
5568
|
+
message: string;
|
|
5569
|
+
details?: {
|
|
5570
|
+
[x: string]: any;
|
|
5571
|
+
} | undefined;
|
|
5572
|
+
};
|
|
5573
|
+
outputFormat: "json";
|
|
5574
|
+
status: 404;
|
|
5575
|
+
} | {
|
|
5576
|
+
input: {
|
|
5577
|
+
param: {
|
|
5578
|
+
eventStoreName: string;
|
|
5579
|
+
subscriberId: string;
|
|
5580
|
+
};
|
|
5581
|
+
};
|
|
5582
|
+
output: {
|
|
5583
|
+
error: string;
|
|
5584
|
+
message: string;
|
|
5585
|
+
details?: {
|
|
5586
|
+
[x: string]: any;
|
|
5587
|
+
} | undefined;
|
|
5588
|
+
};
|
|
5589
|
+
outputFormat: "json";
|
|
5590
|
+
status: 500;
|
|
5591
|
+
};
|
|
5592
|
+
};
|
|
5593
|
+
} & {
|
|
5594
|
+
"/event-stores/:eventStoreName/subscriptions/:subscriberId": {
|
|
5595
|
+
$patch: {
|
|
5596
|
+
input: {
|
|
5597
|
+
param: {
|
|
5598
|
+
eventStoreName: string;
|
|
5599
|
+
subscriberId: string;
|
|
5600
|
+
};
|
|
5601
|
+
} & {
|
|
5602
|
+
json: {
|
|
5603
|
+
eventFilter?: string | string[] | undefined;
|
|
5604
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5605
|
+
retryPolicy?: {
|
|
5606
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5607
|
+
maxAttempts: number;
|
|
5608
|
+
initialDelayMs: number;
|
|
5609
|
+
maxDelayMs: number;
|
|
5610
|
+
multiplier?: number | undefined;
|
|
5611
|
+
jitterPercent?: number | undefined;
|
|
5612
|
+
} | undefined;
|
|
5613
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
5614
|
+
};
|
|
5615
|
+
};
|
|
5616
|
+
output: {
|
|
4769
5617
|
subscriberId: string;
|
|
5618
|
+
status: "ACTIVE" | "SUSPENDED" | "ERROR" | "INITIALIZING" | "DELETED";
|
|
5619
|
+
eventStoreName: string;
|
|
5620
|
+
eventFilter: string;
|
|
4770
5621
|
subscriberType: "durable_object" | "webhook" | "queue" | "cloudflare_workflow" | "websocket";
|
|
4771
5622
|
createdAt: string;
|
|
4772
5623
|
updatedAt: string;
|
|
@@ -4776,6 +5627,9 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4776
5627
|
retryCount?: number | undefined;
|
|
4777
5628
|
nextRetryAt?: string | undefined;
|
|
4778
5629
|
} | undefined;
|
|
5630
|
+
subscriberConfig?: {
|
|
5631
|
+
[x: string]: any;
|
|
5632
|
+
} | undefined;
|
|
4779
5633
|
lastProcessedEventGlobalPosition?: number | undefined;
|
|
4780
5634
|
isExistingSubscription?: boolean | undefined;
|
|
4781
5635
|
message?: string | undefined;
|
|
@@ -4786,7 +5640,51 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4786
5640
|
input: {
|
|
4787
5641
|
param: {
|
|
4788
5642
|
eventStoreName: string;
|
|
4789
|
-
|
|
5643
|
+
subscriberId: string;
|
|
5644
|
+
};
|
|
5645
|
+
} & {
|
|
5646
|
+
json: {
|
|
5647
|
+
eventFilter?: string | string[] | undefined;
|
|
5648
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5649
|
+
retryPolicy?: {
|
|
5650
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5651
|
+
maxAttempts: number;
|
|
5652
|
+
initialDelayMs: number;
|
|
5653
|
+
maxDelayMs: number;
|
|
5654
|
+
multiplier?: number | undefined;
|
|
5655
|
+
jitterPercent?: number | undefined;
|
|
5656
|
+
} | undefined;
|
|
5657
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
5658
|
+
};
|
|
5659
|
+
};
|
|
5660
|
+
output: {
|
|
5661
|
+
error: string;
|
|
5662
|
+
message: string;
|
|
5663
|
+
details?: {
|
|
5664
|
+
[x: string]: any;
|
|
5665
|
+
} | undefined;
|
|
5666
|
+
};
|
|
5667
|
+
outputFormat: "json";
|
|
5668
|
+
status: 400;
|
|
5669
|
+
} | {
|
|
5670
|
+
input: {
|
|
5671
|
+
param: {
|
|
5672
|
+
eventStoreName: string;
|
|
5673
|
+
subscriberId: string;
|
|
5674
|
+
};
|
|
5675
|
+
} & {
|
|
5676
|
+
json: {
|
|
5677
|
+
eventFilter?: string | string[] | undefined;
|
|
5678
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5679
|
+
retryPolicy?: {
|
|
5680
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5681
|
+
maxAttempts: number;
|
|
5682
|
+
initialDelayMs: number;
|
|
5683
|
+
maxDelayMs: number;
|
|
5684
|
+
multiplier?: number | undefined;
|
|
5685
|
+
jitterPercent?: number | undefined;
|
|
5686
|
+
} | undefined;
|
|
5687
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
4790
5688
|
};
|
|
4791
5689
|
};
|
|
4792
5690
|
output: {
|
|
@@ -4802,7 +5700,21 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4802
5700
|
input: {
|
|
4803
5701
|
param: {
|
|
4804
5702
|
eventStoreName: string;
|
|
4805
|
-
|
|
5703
|
+
subscriberId: string;
|
|
5704
|
+
};
|
|
5705
|
+
} & {
|
|
5706
|
+
json: {
|
|
5707
|
+
eventFilter?: string | string[] | undefined;
|
|
5708
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5709
|
+
retryPolicy?: {
|
|
5710
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5711
|
+
maxAttempts: number;
|
|
5712
|
+
initialDelayMs: number;
|
|
5713
|
+
maxDelayMs: number;
|
|
5714
|
+
multiplier?: number | undefined;
|
|
5715
|
+
jitterPercent?: number | undefined;
|
|
5716
|
+
} | undefined;
|
|
5717
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
4806
5718
|
};
|
|
4807
5719
|
};
|
|
4808
5720
|
output: {
|
|
@@ -4818,7 +5730,21 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4818
5730
|
input: {
|
|
4819
5731
|
param: {
|
|
4820
5732
|
eventStoreName: string;
|
|
4821
|
-
|
|
5733
|
+
subscriberId: string;
|
|
5734
|
+
};
|
|
5735
|
+
} & {
|
|
5736
|
+
json: {
|
|
5737
|
+
eventFilter?: string | string[] | undefined;
|
|
5738
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5739
|
+
retryPolicy?: {
|
|
5740
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5741
|
+
maxAttempts: number;
|
|
5742
|
+
initialDelayMs: number;
|
|
5743
|
+
maxDelayMs: number;
|
|
5744
|
+
multiplier?: number | undefined;
|
|
5745
|
+
jitterPercent?: number | undefined;
|
|
5746
|
+
} | undefined;
|
|
5747
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
4822
5748
|
};
|
|
4823
5749
|
};
|
|
4824
5750
|
output: {
|
|
@@ -4830,6 +5756,36 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
4830
5756
|
};
|
|
4831
5757
|
outputFormat: "json";
|
|
4832
5758
|
status: 500;
|
|
5759
|
+
} | {
|
|
5760
|
+
input: {
|
|
5761
|
+
param: {
|
|
5762
|
+
eventStoreName: string;
|
|
5763
|
+
subscriberId: string;
|
|
5764
|
+
};
|
|
5765
|
+
} & {
|
|
5766
|
+
json: {
|
|
5767
|
+
eventFilter?: string | string[] | undefined;
|
|
5768
|
+
subscriberConfig?: Record<string, unknown> | undefined;
|
|
5769
|
+
retryPolicy?: {
|
|
5770
|
+
strategy: "fixed" | "exponential" | "linear";
|
|
5771
|
+
maxAttempts: number;
|
|
5772
|
+
initialDelayMs: number;
|
|
5773
|
+
maxDelayMs: number;
|
|
5774
|
+
multiplier?: number | undefined;
|
|
5775
|
+
jitterPercent?: number | undefined;
|
|
5776
|
+
} | undefined;
|
|
5777
|
+
status?: "ACTIVE" | "SUSPENDED" | undefined;
|
|
5778
|
+
};
|
|
5779
|
+
};
|
|
5780
|
+
output: {
|
|
5781
|
+
error: string;
|
|
5782
|
+
message: string;
|
|
5783
|
+
details?: {
|
|
5784
|
+
[x: string]: any;
|
|
5785
|
+
} | undefined;
|
|
5786
|
+
};
|
|
5787
|
+
outputFormat: "json";
|
|
5788
|
+
status: 409;
|
|
4833
5789
|
};
|
|
4834
5790
|
};
|
|
4835
5791
|
}, "/api"> | hono_types.MergeSchemaPath<{
|
|
@@ -5011,7 +5967,7 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
5011
5967
|
status: 200;
|
|
5012
5968
|
};
|
|
5013
5969
|
};
|
|
5014
|
-
}, "/api">) & {
|
|
5970
|
+
}, "/api"> | hono_types.MergeSchemaPath<{}, "/">) & {
|
|
5015
5971
|
"/api/reference": {
|
|
5016
5972
|
$get: {
|
|
5017
5973
|
input: {};
|
|
@@ -5021,7 +5977,13 @@ declare const routes: hono_hono_base.HonoBase<{
|
|
|
5021
5977
|
};
|
|
5022
5978
|
};
|
|
5023
5979
|
}, "/">;
|
|
5980
|
+
/**
|
|
5981
|
+
* Get the OpenAPI specification for the platform API.
|
|
5982
|
+
* This is used by documentation generators to extract the API schema at build time.
|
|
5983
|
+
* @returns The OpenAPI 3.0 specification object
|
|
5984
|
+
*/
|
|
5985
|
+
declare function getOpenAPISpec(): Record<string, unknown>;
|
|
5024
5986
|
|
|
5025
5987
|
type AppType = typeof routes;
|
|
5026
5988
|
|
|
5027
|
-
export { type AppType, type BaseSubscriberConfig, type CloudflareWorkflowConfig, type DurableObjectConfig, EventBusAPI, EventBusDurableObject, type EventFilter, EventStoreAPI, EventStoreDurableObject, EventStoreManagerDurableObject, type EventType, ManagementAPI, type QueueConfig, SubscriberType, WebSocketManagerDurableObject, WebSocketsAPI, type WebhookConfig, type WildcardPattern, routes as default };
|
|
5989
|
+
export { type AppType, type BaseSubscriberConfig, type CloudflareWorkflowConfig, type DurableObjectConfig, EventBusAPI, EventBusDurableObject, type EventFilter, EventStoreAPI, EventStoreDurableObject, EventStoreManagerDurableObject, type EventType, ManagementAPI, type QueueConfig, SubscriberDurableObject, SubscriberType, WebSocketManagerDurableObject, WebSocketsAPI, type WebhookConfig, type WildcardPattern, routes as default, getOpenAPISpec };
|