chore: remove axios dependency from CLI (#6888)

This commit is contained in:
Ben McCann
2024-02-05 11:29:00 -08:00
committed by GitHub
parent c29976cd6f
commit 6ed33da2a4
218 changed files with 22789 additions and 237 deletions

View File

@@ -10,7 +10,6 @@ import {
SystemConfigApi,
UserApi,
} from '@immich/sdk';
import FormData from 'form-data';
export class ImmichApi {
public userApi: UserApi;
@@ -31,12 +30,9 @@ export class ImmichApi {
) {
this.config = new Configuration({
basePath: instanceUrl,
baseOptions: {
headers: {
'x-api-key': apiKey,
},
headers: {
'x-api-key': apiKey,
},
formDataCtor: FormData,
});
this.userApi = new UserApi(this.config);
@@ -52,6 +48,9 @@ export class ImmichApi {
setApiKey(apiKey: string) {
this.apiKey = apiKey;
this.config.baseOptions.headers['x-api-key'] = apiKey;
if (!this.config.headers) {
throw new Error('missing headers');
}
this.config.headers['x-api-key'] = apiKey;
}
}