File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 11{
2- "version" : " 0.7 .0" ,
2+ "version" : " 0.8 .0" ,
33 "name" : " @meshcloud/notion-markdown-cms" ,
44 "engines" : {
55 "node" : " >=14"
Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ export class NotionApiFacade {
2626 }
2727
2828 async retrieveDatabase ( databaseId : string ) {
29- return await this . withRetry ( async ( ) =>
30- this . client . databases . retrieve ( {
29+ return await this . withRetry ( async ( ) => {
30+ return this . client . databases . retrieve ( {
3131 database_id : databaseId ,
32- } )
33- ) ;
32+ } ) ;
33+ } ) ;
3434 }
3535
3636 async queryDatabase ( query : DatabasesQueryParameters ) {
@@ -82,7 +82,7 @@ export class NotionApiFacade {
8282 APIErrorCode . RateLimited ,
8383 ] ,
8484 retriableUnknownHTTPStatusCodes : number [ ] = [ 502 ]
85- ) {
85+ ) : Promise < T > {
8686 let lastError : any ;
8787
8888 for ( let i = 1 ; i <= maxRetries ; i ++ ) {
@@ -99,8 +99,9 @@ export class NotionApiFacade {
9999 RequestTimeoutError . isRequestTimeoutError ( error ) && error ;
100100
101101 const isRetriable =
102- ( apiError && error . code in retriableApiErrorCodes ) ||
103- ( unknownError && error . status in retriableUnknownHTTPStatusCodes ) ||
102+ ( apiError && retriableApiErrorCodes . includes ( error . code ) ) ||
103+ ( unknownError &&
104+ retriableUnknownHTTPStatusCodes . includes ( error . status ) ) ||
104105 timeoutError ;
105106
106107 if ( ! isRetriable ) {
You can’t perform that action at this time.
0 commit comments