mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat: add partner create endpoint (#21625)
This commit is contained in:
parent
db0ea0f3a8
commit
5a7042364b
18 changed files with 477 additions and 75 deletions
|
|
@ -811,7 +811,10 @@ export type PartnerResponseDto = {
|
|||
profileChangedAt: string;
|
||||
profileImagePath: string;
|
||||
};
|
||||
export type UpdatePartnerDto = {
|
||||
export type PartnerCreateDto = {
|
||||
sharedWithId: string;
|
||||
};
|
||||
export type PartnerUpdateDto = {
|
||||
inTimeline: boolean;
|
||||
};
|
||||
export type PeopleResponseDto = {
|
||||
|
|
@ -3122,6 +3125,21 @@ export function getPartners({ direction }: {
|
|||
...opts
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.create` permission.
|
||||
*/
|
||||
export function createPartner({ partnerCreateDto }: {
|
||||
partnerCreateDto: PartnerCreateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 201;
|
||||
data: PartnerResponseDto;
|
||||
}>("/partners", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: partnerCreateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.delete` permission.
|
||||
*/
|
||||
|
|
@ -3134,9 +3152,9 @@ export function removePartner({ id }: {
|
|||
}));
|
||||
}
|
||||
/**
|
||||
* This endpoint requires the `partner.create` permission.
|
||||
* This property was deprecated in v1.141.0. This endpoint requires the `partner.create` permission.
|
||||
*/
|
||||
export function createPartner({ id }: {
|
||||
export function createPartnerDeprecated({ id }: {
|
||||
id: string;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
|
|
@ -3150,9 +3168,9 @@ export function createPartner({ id }: {
|
|||
/**
|
||||
* This endpoint requires the `partner.update` permission.
|
||||
*/
|
||||
export function updatePartner({ id, updatePartnerDto }: {
|
||||
export function updatePartner({ id, partnerUpdateDto }: {
|
||||
id: string;
|
||||
updatePartnerDto: UpdatePartnerDto;
|
||||
partnerUpdateDto: PartnerUpdateDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
|
|
@ -3160,7 +3178,7 @@ export function updatePartner({ id, updatePartnerDto }: {
|
|||
}>(`/partners/${encodeURIComponent(id)}`, oazapfts.json({
|
||||
...opts,
|
||||
method: "PUT",
|
||||
body: updatePartnerDto
|
||||
body: partnerUpdateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue