File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44
5+ ### v0.4.0 (2022-11-24)
6+
7+ ** Breaking Change**
8+
9+ - API key desensitization is no longer processed when an error occurs.
10+
511### v0.3.0 (2022-11-24)
612
713** Breaking Change**
Original file line number Diff line number Diff line change 11{
22 "name" : " mongodb-data-api" ,
3- "version" : " 0.3 .0" ,
3+ "version" : " 0.4 .0" ,
44 "description" : " MongoDB atlas data API SDK for Node.js" ,
55 "author" : " Surmon" ,
66 "license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -134,8 +134,6 @@ export class MongoDBDataAPI<InnerDoc = Document> {
134134 return `${ endpoint } /action/${ action } `
135135 }
136136
137- const API_KEY_FIELD = 'api-key'
138-
139137 return this . #axios( {
140138 method : 'post' ,
141139 data : JSON . stringify ( mergedParams ) ,
@@ -148,7 +146,7 @@ export class MongoDBDataAPI<InnerDoc = Document> {
148146 headers : {
149147 'Content-Type' : 'application/json' ,
150148 'Access-Control-Request-Headers' : '*' ,
151- [ API_KEY_FIELD ] : this . #config. apiKey
149+ 'api-key' : this . #config. apiKey
152150 } ,
153151 ...axiosConfig
154152 } )
@@ -157,13 +155,7 @@ export class MongoDBDataAPI<InnerDoc = Document> {
157155 } )
158156 . catch ( ( error ) => {
159157 // https://www.mongodb.com/docs/atlas/api/data-api-resources/#error-codes
160- if ( _axios . isAxiosError ( error ) ) {
161- const errorJSON : any = error . toJSON ( )
162- errorJSON . config . headers [ API_KEY_FIELD ] = '*****'
163- return Promise . reject ( errorJSON )
164- } else {
165- return Promise . reject ( error )
166- }
158+ return Promise . reject ( _axios . isAxiosError ( error ) ? error . toJSON ( ) : error )
167159 } )
168160 }
169161
You can’t perform that action at this time.
0 commit comments