File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " 0.7 .0" ,
2
+ "version" : " 0.8 .0" ,
3
3
"name" : " @meshcloud/notion-markdown-cms" ,
4
4
"engines" : {
5
5
"node" : " >=14"
Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ export class NotionApiFacade {
26
26
}
27
27
28
28
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 ( {
31
31
database_id : databaseId ,
32
- } )
33
- ) ;
32
+ } ) ;
33
+ } ) ;
34
34
}
35
35
36
36
async queryDatabase ( query : DatabasesQueryParameters ) {
@@ -82,7 +82,7 @@ export class NotionApiFacade {
82
82
APIErrorCode . RateLimited ,
83
83
] ,
84
84
retriableUnknownHTTPStatusCodes : number [ ] = [ 502 ]
85
- ) {
85
+ ) : Promise < T > {
86
86
let lastError : any ;
87
87
88
88
for ( let i = 1 ; i <= maxRetries ; i ++ ) {
@@ -99,8 +99,9 @@ export class NotionApiFacade {
99
99
RequestTimeoutError . isRequestTimeoutError ( error ) && error ;
100
100
101
101
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 ) ) ||
104
105
timeoutError ;
105
106
106
107
if ( ! isRetriable ) {
You can’t perform that action at this time.
0 commit comments