@@ -91,7 +91,7 @@ export class ApiClient {
91
91
throw new Error ( "Not authenticated. Please run the auth tool first." ) ;
92
92
}
93
93
94
- const url = new URL ( `api/atlas/v2${ endpoint } ` , `${ config . apiBaseURL } ` ) ;
94
+ const url = new URL ( `api/atlas/v2${ endpoint } ` , `${ config . apiBaseUrl } ` ) ;
95
95
96
96
if ( ! this . checkTokenExpiry ( ) ) {
97
97
await this . refreshToken ( ) ;
@@ -119,7 +119,7 @@ export class ApiClient {
119
119
async authenticate ( ) : Promise < OauthDeviceCode > {
120
120
const endpoint = "api/private/unauth/account/device/authorize" ;
121
121
122
- const authUrl = new URL ( endpoint , config . apiBaseURL ) ;
122
+ const authUrl = new URL ( endpoint , config . apiBaseUrl ) ;
123
123
124
124
const response = await fetch ( authUrl , {
125
125
method : "POST" ,
@@ -128,7 +128,7 @@ export class ApiClient {
128
128
Accept : "application/json" ,
129
129
} ,
130
130
body : new URLSearchParams ( {
131
- client_id : config . clientID ,
131
+ client_id : config . clientId ,
132
132
scope : "openid profile offline_access" ,
133
133
grant_type : "urn:ietf:params:oauth:grant-type:device_code" ,
134
134
} ) . toString ( ) ,
@@ -143,14 +143,14 @@ export class ApiClient {
143
143
144
144
async retrieveToken ( device_code : string ) : Promise < OAuthToken > {
145
145
const endpoint = "api/private/unauth/account/device/token" ;
146
- const url = new URL ( endpoint , config . apiBaseURL ) ;
146
+ const url = new URL ( endpoint , config . apiBaseUrl ) ;
147
147
const response = await fetch ( url , {
148
148
method : "POST" ,
149
149
headers : {
150
150
"Content-Type" : "application/x-www-form-urlencoded" ,
151
151
} ,
152
152
body : new URLSearchParams ( {
153
- client_id : config . clientID ,
153
+ client_id : config . clientId ,
154
154
device_code : device_code ,
155
155
grant_type : "urn:ietf:params:oauth:grant-type:device_code" ,
156
156
} ) . toString ( ) ,
@@ -179,15 +179,15 @@ export class ApiClient {
179
179
180
180
async refreshToken ( token ?: OAuthToken ) : Promise < OAuthToken | null > {
181
181
const endpoint = "api/private/unauth/account/device/token" ;
182
- const url = new URL ( endpoint , config . apiBaseURL ) ;
182
+ const url = new URL ( endpoint , config . apiBaseUrl ) ;
183
183
const response = await fetch ( url , {
184
184
method : "POST" ,
185
185
headers : {
186
186
"Content-Type" : "application/x-www-form-urlencoded" ,
187
187
Accept : "application/json" ,
188
188
} ,
189
189
body : new URLSearchParams ( {
190
- client_id : config . clientID ,
190
+ client_id : config . clientId ,
191
191
refresh_token : ( token || this . token ) ?. refresh_token || "" ,
192
192
grant_type : "refresh_token" ,
193
193
scope : "openid profile offline_access" ,
@@ -213,7 +213,7 @@ export class ApiClient {
213
213
214
214
async revokeToken ( token ?: OAuthToken ) : Promise < void > {
215
215
const endpoint = "api/private/unauth/account/device/token" ;
216
- const url = new URL ( endpoint , config . apiBaseURL ) ;
216
+ const url = new URL ( endpoint , config . apiBaseUrl ) ;
217
217
const response = await fetch ( url , {
218
218
method : "POST" ,
219
219
headers : {
@@ -222,7 +222,7 @@ export class ApiClient {
222
222
"User-Agent" : config . userAgent ,
223
223
} ,
224
224
body : new URLSearchParams ( {
225
- client_id : config . clientID ,
225
+ client_id : config . clientId ,
226
226
token : ( token || this . token ) ?. access_token || "" ,
227
227
token_type_hint : "refresh_token" ,
228
228
} ) . toString ( ) ,
0 commit comments