mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat: shared link login (#25678)
This commit is contained in:
@@ -11239,6 +11239,78 @@
|
||||
"x-immich-state": "Stable"
|
||||
}
|
||||
},
|
||||
"/shared-links/login": {
|
||||
"post": {
|
||||
"description": "Login to a password protected shared link",
|
||||
"operationId": "sharedLinkLogin",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "key",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "slug",
|
||||
"required": false,
|
||||
"in": "query",
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SharedLinkLoginDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"201": {
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/SharedLinkResponseDto"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": ""
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"bearer": []
|
||||
},
|
||||
{
|
||||
"cookie": []
|
||||
},
|
||||
{
|
||||
"api_key": []
|
||||
}
|
||||
],
|
||||
"summary": "Shared link login",
|
||||
"tags": [
|
||||
"Shared links"
|
||||
],
|
||||
"x-immich-history": [
|
||||
{
|
||||
"version": "v2.6.0",
|
||||
"state": "Added"
|
||||
},
|
||||
{
|
||||
"version": "v2.6.0",
|
||||
"state": "Beta"
|
||||
}
|
||||
],
|
||||
"x-immich-state": "Beta"
|
||||
}
|
||||
},
|
||||
"/shared-links/me": {
|
||||
"get": {
|
||||
"description": "Retrieve the current shared link associated with authentication method.",
|
||||
@@ -21686,6 +21758,19 @@
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"SharedLinkLoginDto": {
|
||||
"properties": {
|
||||
"password": {
|
||||
"description": "Shared link password",
|
||||
"example": "password",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"password"
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"SharedLinkResponseDto": {
|
||||
"properties": {
|
||||
"album": {
|
||||
@@ -21744,9 +21829,25 @@
|
||||
"type": "string"
|
||||
},
|
||||
"token": {
|
||||
"deprecated": true,
|
||||
"description": "Access token",
|
||||
"nullable": true,
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"x-immich-history": [
|
||||
{
|
||||
"version": "v1",
|
||||
"state": "Added"
|
||||
},
|
||||
{
|
||||
"version": "v2",
|
||||
"state": "Stable"
|
||||
},
|
||||
{
|
||||
"version": "v2.6.0",
|
||||
"state": "Deprecated"
|
||||
}
|
||||
],
|
||||
"x-immich-state": "Deprecated"
|
||||
},
|
||||
"type": {
|
||||
"allOf": [
|
||||
|
||||
@@ -2287,6 +2287,10 @@ export type SharedLinkCreateDto = {
|
||||
/** Shared link type */
|
||||
"type": SharedLinkType;
|
||||
};
|
||||
export type SharedLinkLoginDto = {
|
||||
/** Shared link password */
|
||||
password: string;
|
||||
};
|
||||
export type SharedLinkEditDto = {
|
||||
/** Allow downloads */
|
||||
allowDownload?: boolean;
|
||||
@@ -5861,6 +5865,26 @@ export function createSharedLink({ sharedLinkCreateDto }: {
|
||||
body: sharedLinkCreateDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* Shared link login
|
||||
*/
|
||||
export function sharedLinkLogin({ key, slug, sharedLinkLoginDto }: {
|
||||
key?: string;
|
||||
slug?: string;
|
||||
sharedLinkLoginDto: SharedLinkLoginDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 201;
|
||||
data: SharedLinkResponseDto;
|
||||
}>(`/shared-links/login${QS.query(QS.explode({
|
||||
key,
|
||||
slug
|
||||
}))}`, oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: sharedLinkLoginDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* Retrieve current shared link
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user