mirror of
https://github.com/immich-app/immich.git
synced 2025-12-12 15:50:43 -08:00
feat: add partner create endpoint (#21625)
This commit is contained in:
@@ -4994,6 +4994,48 @@
|
||||
],
|
||||
"x-immich-permission": "partner.read",
|
||||
"description": "This endpoint requires the `partner.read` permission."
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createPartner",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PartnerCreateDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/PartnerResponseDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Partners"
|
||||
],
|
||||
"x-immich-permission": "partner.create",
|
||||
"description": "This endpoint requires the `partner.create` permission."
|
||||
}
|
||||
},
|
||||
"/partners/{id}": {
|
||||
@@ -5033,7 +5075,9 @@
|
||||
"description": "This endpoint requires the `partner.delete` permission."
|
||||
},
|
||||
"post": {
|
||||
"operationId": "createPartner",
|
||||
"deprecated": true,
|
||||
"description": "This property was deprecated in v1.141.0. This endpoint requires the `partner.create` permission.",
|
||||
"operationId": "createPartnerDeprecated",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
@@ -5069,10 +5113,13 @@
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Partners"
|
||||
"Partners",
|
||||
"Deprecated"
|
||||
],
|
||||
"x-immich-permission": "partner.create",
|
||||
"description": "This endpoint requires the `partner.create` permission."
|
||||
"x-immich-lifecycle": {
|
||||
"deprecatedAt": "v1.141.0"
|
||||
},
|
||||
"x-immich-permission": "partner.create"
|
||||
},
|
||||
"put": {
|
||||
"operationId": "updatePartner",
|
||||
@@ -5091,7 +5138,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/UpdatePartnerDto"
|
||||
"$ref": "#/components/schemas/PartnerUpdateDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -12853,6 +12900,18 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PartnerCreateDto": {
|
||||
"properties": {
|
||||
"sharedWithId": {
|
||||
"format": "uuid",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"sharedWithId"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PartnerDirection": {
|
||||
"enum": [
|
||||
"shared-by",
|
||||
@@ -12899,6 +12958,17 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PartnerUpdateDto": {
|
||||
"properties": {
|
||||
"inTimeline": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"inTimeline"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"PeopleResponse": {
|
||||
"properties": {
|
||||
"enabled": {
|
||||
@@ -17241,17 +17311,6 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"UpdatePartnerDto": {
|
||||
"properties": {
|
||||
"inTimeline": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"inTimeline"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"UsageByUserDto": {
|
||||
"properties": {
|
||||
"photos": {
|
||||
|
||||
@@ -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
|
||||
})));
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user