mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Bump ts-rest
This commit is contained in:
parent
f58552be84
commit
5295c69f46
6 changed files with 19 additions and 12 deletions
|
|
@ -23,6 +23,9 @@ export const contract = c.router({
|
|||
},
|
||||
authenticate: {
|
||||
body: jfType._parameters.authenticate,
|
||||
headers: z.object({
|
||||
'X-Emby-Authorization': z.string(),
|
||||
}),
|
||||
method: 'POST',
|
||||
path: 'users/authenticatebyname',
|
||||
responses: {
|
||||
|
|
@ -324,6 +327,7 @@ export const jfApiClient = (args: {
|
|||
});
|
||||
return {
|
||||
body: result.data,
|
||||
headers: result.headers as any,
|
||||
status: result.status,
|
||||
};
|
||||
} catch (e: Error | AxiosError | any) {
|
||||
|
|
@ -331,7 +335,8 @@ export const jfApiClient = (args: {
|
|||
const error = e as AxiosError;
|
||||
const response = error.response as AxiosResponse;
|
||||
return {
|
||||
body: response.data,
|
||||
body: response?.data,
|
||||
headers: response?.headers as any,
|
||||
status: response.status,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ const authenticate = async (
|
|||
Username: body.username,
|
||||
},
|
||||
headers: {
|
||||
'X-Emby-Authorization': `MediaBrowser Client="Feishin", Device="PC", DeviceId="Feishin", Version="${packageJson.version}"`,
|
||||
'x-emby-authorization': `MediaBrowser Client="Feishin", Device="PC", DeviceId="Feishin", Version="${packageJson.version}"`,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -266,6 +266,7 @@ export const ndApiClient = (args: {
|
|||
});
|
||||
return {
|
||||
body: { data: result.data, headers: result.headers },
|
||||
headers: result.headers as any,
|
||||
status: result.status,
|
||||
};
|
||||
} catch (e: Error | AxiosError | any) {
|
||||
|
|
@ -274,6 +275,7 @@ export const ndApiClient = (args: {
|
|||
const response = error.response as AxiosResponse;
|
||||
return {
|
||||
body: { data: response.data, headers: response.headers },
|
||||
headers: response.headers as any,
|
||||
status: response.status,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ export const ssApiClient = (args: {
|
|||
|
||||
return {
|
||||
body: result.data['subsonic-response'],
|
||||
headers: result.headers as any,
|
||||
status: result.status,
|
||||
};
|
||||
} catch (e: Error | AxiosError | any) {
|
||||
|
|
@ -187,10 +188,9 @@ export const ssApiClient = (args: {
|
|||
const error = e as AxiosError;
|
||||
const response = error.response as AxiosResponse;
|
||||
|
||||
console.log(response, 'response');
|
||||
|
||||
return {
|
||||
body: response?.data,
|
||||
headers: response.headers as any,
|
||||
status: response?.status,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue