@@ -69,6 +69,13 @@ import {
69
69
AppUsageStatsOut ,
70
70
AggregateEventTypesOut ,
71
71
EndpointOauthConfigIn ,
72
+ WebhookEndpointApi ,
73
+ OperationalWebhookEndpointIn ,
74
+ OperationalWebhookEndpointOut ,
75
+ OperationalWebhookEndpointSecretIn ,
76
+ OperationalWebhookEndpointSecretOut ,
77
+ OperationalWebhookEndpointUpdate ,
78
+ ListResponseOperationalWebhookEndpointOut ,
72
79
} from "./openapi/index" ;
73
80
export * from "./openapi/models/all" ;
74
81
export * from "./openapi/apis/exception" ;
@@ -112,6 +119,7 @@ export class Svix {
112
119
public readonly messageAttempt : MessageAttempt ;
113
120
public readonly backgroundTask : BackgroundTask ;
114
121
public readonly statistics : Statistics ;
122
+ public readonly operationalWebhookEndpoint : OperationalWebhookEndpoint ;
115
123
116
124
public constructor ( token : string , options : SvixOptions = { } ) {
117
125
const regionalUrl = REGIONS . find ( ( x ) => x . region === token . split ( "." ) [ 1 ] ) ?. url ;
@@ -142,6 +150,7 @@ export class Svix {
142
150
this . messageAttempt = new MessageAttempt ( config ) ;
143
151
this . backgroundTask = new BackgroundTask ( config ) ;
144
152
this . statistics = new Statistics ( config ) ;
153
+ this . operationalWebhookEndpoint = new OperationalWebhookEndpoint ( config ) ;
145
154
}
146
155
}
147
156
export interface PostOptions {
@@ -194,6 +203,10 @@ export interface EndpointListOptions extends ListOptions {
194
203
order ?: Ordering ;
195
204
}
196
205
206
+ export interface OperationalWebhookEndpointListOptions extends ListOptions {
207
+ order ?: Ordering ;
208
+ }
209
+
197
210
export interface EndpointStatsOptions {
198
211
since ?: Date ;
199
212
until ?: Date ;
@@ -972,3 +985,61 @@ class Statistics {
972
985
} ) ;
973
986
}
974
987
}
988
+
989
+ class OperationalWebhookEndpoint {
990
+ private readonly api : WebhookEndpointApi ;
991
+
992
+ public constructor ( config : Configuration ) {
993
+ this . api = new WebhookEndpointApi ( config ) ;
994
+ }
995
+
996
+ public list (
997
+ options ?: OperationalWebhookEndpointListOptions ,
998
+ ) : Promise < ListResponseOperationalWebhookEndpointOut > {
999
+ return this . api . listOperationalWebhookEndpoints ( { ...options } ) ;
1000
+ }
1001
+
1002
+ public create (
1003
+ endpointIn : OperationalWebhookEndpointIn ,
1004
+ options ?: PostOptions ,
1005
+ ) : Promise < OperationalWebhookEndpointOut > {
1006
+ return this . api . createOperationalWebhookEndpoint ( {
1007
+ operationalWebhookEndpointIn : endpointIn ,
1008
+ ...options ,
1009
+ } ) ;
1010
+ }
1011
+
1012
+ public get ( endpointId : string ) : Promise < OperationalWebhookEndpointOut > {
1013
+ return this . api . getOperationalWebhookEndpoint ( { endpointId } ) ;
1014
+ }
1015
+
1016
+ public update (
1017
+ endpointId : string ,
1018
+ endpointUpdate : OperationalWebhookEndpointUpdate ,
1019
+ ) : Promise < OperationalWebhookEndpointOut > {
1020
+ return this . api . updateOperationalWebhookEndpoint ( {
1021
+ endpointId,
1022
+ operationalWebhookEndpointUpdate : endpointUpdate ,
1023
+ } ) ;
1024
+ }
1025
+
1026
+ public delete ( endpointId : string ) : Promise < void > {
1027
+ return this . api . deleteOperationalWebhookEndpoint ( { endpointId } ) ;
1028
+ }
1029
+
1030
+ public getSecret ( endpointId : string ) : Promise < OperationalWebhookEndpointSecretOut > {
1031
+ return this . api . getOperationalWebhookEndpointSecret ( { endpointId } ) ;
1032
+ }
1033
+
1034
+ public rotateSecret (
1035
+ endpointId : string ,
1036
+ endpointSecretIn : OperationalWebhookEndpointSecretIn ,
1037
+ options ?: PostOptions ,
1038
+ ) : Promise < void > {
1039
+ return this . api . rotateOperationalWebhookEndpointSecret ( {
1040
+ endpointId,
1041
+ operationalWebhookEndpointSecretIn : endpointSecretIn ,
1042
+ ...options ,
1043
+ } ) ;
1044
+ }
1045
+ }
0 commit comments