@@ -54,6 +54,11 @@ import {
54
54
AppPortalAccessOut ,
55
55
AppPortalAccessIn ,
56
56
Ordering ,
57
+ BackgroundTaskStatus ,
58
+ BackgroundTaskType ,
59
+ BackgroundTaskOut ,
60
+ ListResponseBackgroundTaskOut ,
61
+ BackgroundTasksApi ,
57
62
} from "./openapi/index" ;
58
63
export * from "./openapi/models/all" ;
59
64
export * from "./openapi/apis/exception" ;
@@ -95,6 +100,7 @@ export class Svix {
95
100
public readonly integration : Integration ;
96
101
public readonly message : Message ;
97
102
public readonly messageAttempt : MessageAttempt ;
103
+ public readonly backgroundTask : BackgroundTask ;
98
104
99
105
public constructor ( token : string , options : SvixOptions = { } ) {
100
106
const regionalUrl = REGIONS . find ( ( x ) => x . region === token . split ( "." ) [ 1 ] ) ?. url ;
@@ -123,6 +129,7 @@ export class Svix {
123
129
this . integration = new Integration ( config ) ;
124
130
this . message = new Message ( config ) ;
125
131
this . messageAttempt = new MessageAttempt ( config ) ;
132
+ this . backgroundTask = new BackgroundTask ( config ) ;
126
133
}
127
134
}
128
135
export interface PostOptions {
@@ -198,6 +205,11 @@ export interface MessageAttemptListOptions extends ListOptions {
198
205
channel ?: string ;
199
206
}
200
207
208
+ export interface BackgroundTaskListOptions extends ListOptions {
209
+ status ?: BackgroundTaskStatus ;
210
+ task ?: BackgroundTaskType ;
211
+ }
212
+
201
213
class Application {
202
214
private readonly api : ApplicationApi ;
203
215
@@ -659,6 +671,31 @@ class MessageAttempt {
659
671
}
660
672
}
661
673
674
+ class BackgroundTask {
675
+ private readonly api : BackgroundTasksApi ;
676
+
677
+ public constructor ( config : Configuration ) {
678
+ this . api = new BackgroundTasksApi ( config ) ;
679
+ }
680
+
681
+ public listByEndpoint (
682
+ options ?: BackgroundTaskListOptions
683
+ ) : Promise < ListResponseBackgroundTaskOut > {
684
+ return this . api . listBackgroundTasks ( {
685
+ ...options ,
686
+ } ) ;
687
+ }
688
+
689
+ public get (
690
+ taskId : string ,
691
+ ) : Promise < BackgroundTaskOut > {
692
+ return this . api . getBackgroundTask ( {
693
+ taskId
694
+ } ) ;
695
+ }
696
+
697
+ }
698
+
662
699
class ExtendableError extends Error {
663
700
constructor ( message : any ) {
664
701
super ( message ) ;
0 commit comments