Skip to content

Commit 77de334

Browse files
committed
refactor: update sdk types and client
1 parent fc614e7 commit 77de334

File tree

5 files changed

+7
-23
lines changed

5 files changed

+7
-23
lines changed

src/api.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
*
55
* The version of the OpenAPI document: 1.0.0
66
* Contact: [email protected]
7-
*
8-
97
10-
*
118
*/
129

1310
import type { AxiosInstance, AxiosPromise, RawAxiosRequestConfig } from 'axios';

src/base.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
*
55
* The version of the OpenAPI document: 1.0.0
66
* Contact: [email protected]
7-
*
8-
97
10-
*
118
*/
129

1310
// Some imports not used depending on template conditions

src/common.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
*
55
* The version of the OpenAPI document: 1.0.0
66
* Contact: [email protected]
7-
*
8-
97
10-
*
118
*/
129

1310
import type { AxiosInstance, AxiosResponse } from 'axios';
@@ -31,38 +28,37 @@ export const assertParamExists = (functionName: string, paramName: string, param
3128
};
3229

3330
export const setApiKeyToObject = async (object: any, keyParamName: string, configuration?: Configuration) => {
34-
if (configuration && configuration.apiKey) {
35-
const localVarApiKeyValue =
31+
if (configuration?.apiKey) {
32+
object[keyParamName] =
3633
typeof configuration.apiKey === 'function'
3734
? await configuration.apiKey(keyParamName)
3835
: await configuration.apiKey;
39-
object[keyParamName] = localVarApiKeyValue;
4036
}
4137
};
4238

4339
export const setBasicAuthToObject = (object: any, configuration?: Configuration) => {
4440
if (configuration && (configuration.username || configuration.password)) {
45-
object['auth'] = { username: configuration.username, password: configuration.password };
41+
object.auth = { username: configuration.username, password: configuration.password };
4642
}
4743
};
4844

4945
export const setBearerAuthToObject = async (object: any, configuration?: Configuration) => {
50-
if (configuration && configuration.accessToken) {
46+
if (configuration?.accessToken) {
5147
const accessToken =
5248
typeof configuration.accessToken === 'function'
5349
? await configuration.accessToken()
5450
: await configuration.accessToken;
55-
object['Authorization'] = 'Bearer ' + accessToken;
51+
object.Authorization = `Bearer ${accessToken}`;
5652
}
5753
};
5854

5955
export const setOAuthToObject = async (object: any, name: string, scopes: string[], configuration?: Configuration) => {
60-
if (configuration && configuration.accessToken) {
56+
if (configuration?.accessToken) {
6157
const localVarAccessTokenValue =
6258
typeof configuration.accessToken === 'function'
6359
? await configuration.accessToken(name, scopes)
6460
: await configuration.accessToken;
65-
object['Authorization'] = 'Bearer ' + localVarAccessTokenValue;
61+
object.Authorization = `Bearer ${localVarAccessTokenValue}`;
6662
}
6763
};
6864

src/configuration.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
*
55
* The version of the OpenAPI document: 1.0.0
66
* Contact: [email protected]
7-
*
8-
97
10-
*
118
*/
129

1310
export interface ConfigurationParameters {

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
*
55
* The version of the OpenAPI document: 1.0.0
66
* Contact: [email protected]
7-
*
8-
97
10-
*
118
*/
129

1310
export * from './api';

0 commit comments

Comments
 (0)