@@ -43,7 +43,7 @@ export class Connection {
43
43
headers : {
44
44
"X-Fern-Language" : "JavaScript" ,
45
45
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
46
- "X-Fern-SDK-Version" : "0.0.744 " ,
46
+ "X-Fern-SDK-Version" : "0.0.774 " ,
47
47
"x-revert-api-token" : xRevertApiToken ,
48
48
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
49
49
"x-revert-t-id" : xRevertTId ,
@@ -133,7 +133,7 @@ export class Connection {
133
133
headers : {
134
134
"X-Fern-Language" : "JavaScript" ,
135
135
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
136
- "X-Fern-SDK-Version" : "0.0.744 " ,
136
+ "X-Fern-SDK-Version" : "0.0.774 " ,
137
137
"x-revert-api-token" : xRevertApiToken ,
138
138
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
139
139
"x-revert-t-id" : xRevertTId ,
@@ -223,7 +223,7 @@ export class Connection {
223
223
headers : {
224
224
"X-Fern-Language" : "JavaScript" ,
225
225
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
226
- "X-Fern-SDK-Version" : "0.0.744 " ,
226
+ "X-Fern-SDK-Version" : "0.0.774 " ,
227
227
"x-revert-api-token" : xRevertApiToken ,
228
228
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
229
229
} ,
@@ -312,7 +312,7 @@ export class Connection {
312
312
headers : {
313
313
"X-Fern-Language" : "JavaScript" ,
314
314
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
315
- "X-Fern-SDK-Version" : "0.0.744 " ,
315
+ "X-Fern-SDK-Version" : "0.0.774 " ,
316
316
"x-revert-api-token" : xRevertApiToken ,
317
317
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
318
318
"x-revert-t-id" : xRevertTId ,
@@ -405,7 +405,7 @@ export class Connection {
405
405
headers : {
406
406
"X-Fern-Language" : "JavaScript" ,
407
407
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
408
- "X-Fern-SDK-Version" : "0.0.744 " ,
408
+ "X-Fern-SDK-Version" : "0.0.774 " ,
409
409
"x-revert-api-token" : xRevertApiToken ,
410
410
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
411
411
"x-revert-t-id" : xRevertTId ,
@@ -495,7 +495,7 @@ export class Connection {
495
495
headers : {
496
496
"X-Fern-Language" : "JavaScript" ,
497
497
"X-Fern-SDK-Name" : "@revertdotdev/node" ,
498
- "X-Fern-SDK-Version" : "0.0.744 " ,
498
+ "X-Fern-SDK-Version" : "0.0.774 " ,
499
499
"x-revert-api-token" : xRevertApiToken ,
500
500
"x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
501
501
"x-revert-t-id" : xRevertTId ,
@@ -564,4 +564,87 @@ export class Connection {
564
564
} ) ;
565
565
}
566
566
}
567
+
568
+ /**
569
+ * Get the OAuth connection event status. This endpoint responds with a `http.ServerResponse` instead of `json`.
570
+ * @throws {@link Revert.common.UnAuthorizedError }
571
+ * @throws {@link Revert.common.InternalServerError }
572
+ */
573
+ public async getIntegrationStatus (
574
+ revertPublicToken : string ,
575
+ request : Revert . GetConnectStatusRequest ,
576
+ requestOptions ?: Connection . RequestOptions
577
+ ) : Promise < Revert . GetConnectStatusResponse > {
578
+ const { tenantId, xRevertApiToken, xApiVersion } = request ;
579
+ const _queryParams : Record < string , string | string [ ] > = { } ;
580
+ _queryParams [ "tenantId" ] = tenantId ;
581
+ const _response = await core . fetcher ( {
582
+ url : urlJoin (
583
+ ( await core . Supplier . get ( this . _options . environment ) ) ?? environments . RevertEnvironment . Production ,
584
+ `connection/integration-status/${ revertPublicToken } `
585
+ ) ,
586
+ method : "GET" ,
587
+ headers : {
588
+ "X-Fern-Language" : "JavaScript" ,
589
+ "X-Fern-SDK-Name" : "@revertdotdev/node" ,
590
+ "X-Fern-SDK-Version" : "0.0.774" ,
591
+ "x-revert-api-token" : xRevertApiToken ,
592
+ "x-api-version" : xApiVersion != null ? xApiVersion : undefined ,
593
+ } ,
594
+ contentType : "application/json" ,
595
+ queryParameters : _queryParams ,
596
+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : undefined ,
597
+ maxRetries : requestOptions ?. maxRetries ,
598
+ } ) ;
599
+ if ( _response . ok ) {
600
+ return await serializers . GetConnectStatusResponse . parseOrThrow ( _response . body , {
601
+ unrecognizedObjectKeys : "passthrough" ,
602
+ allowUnrecognizedUnionMembers : true ,
603
+ allowUnrecognizedEnumValues : true ,
604
+ breadcrumbsPrefix : [ "response" ] ,
605
+ } ) ;
606
+ }
607
+
608
+ if ( _response . error . reason === "status-code" ) {
609
+ switch ( _response . error . statusCode ) {
610
+ case 401 :
611
+ throw new Revert . common . UnAuthorizedError (
612
+ await serializers . common . BaseError . parseOrThrow ( _response . error . body , {
613
+ unrecognizedObjectKeys : "passthrough" ,
614
+ allowUnrecognizedUnionMembers : true ,
615
+ allowUnrecognizedEnumValues : true ,
616
+ breadcrumbsPrefix : [ "response" ] ,
617
+ } )
618
+ ) ;
619
+ case 500 :
620
+ throw new Revert . common . InternalServerError (
621
+ await serializers . common . BaseError . parseOrThrow ( _response . error . body , {
622
+ unrecognizedObjectKeys : "passthrough" ,
623
+ allowUnrecognizedUnionMembers : true ,
624
+ allowUnrecognizedEnumValues : true ,
625
+ breadcrumbsPrefix : [ "response" ] ,
626
+ } )
627
+ ) ;
628
+ default :
629
+ throw new errors . RevertError ( {
630
+ statusCode : _response . error . statusCode ,
631
+ body : _response . error . body ,
632
+ } ) ;
633
+ }
634
+ }
635
+
636
+ switch ( _response . error . reason ) {
637
+ case "non-json" :
638
+ throw new errors . RevertError ( {
639
+ statusCode : _response . error . statusCode ,
640
+ body : _response . error . rawBody ,
641
+ } ) ;
642
+ case "timeout" :
643
+ throw new errors . RevertTimeoutError ( ) ;
644
+ case "unknown" :
645
+ throw new errors . RevertError ( {
646
+ message : _response . error . errorMessage ,
647
+ } ) ;
648
+ }
649
+ }
567
650
}
0 commit comments