mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Add a route to get the item preview
This is the first available preview of an attachment wrt position. If all attachments have a preview image, the preview of the first attachment is returned.
This commit is contained in:
@ -1847,6 +1847,47 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/ItemProposals"
|
||||
/sec/item/{id}/preview:
|
||||
head:
|
||||
tags: [ Attachment ]
|
||||
summary: Get a preview image of an attachment file.
|
||||
description: |
|
||||
Checks if an image file showing a preview of the item is
|
||||
available. If not available, a 404 is returned. The preview is
|
||||
currently the an image of the first page of the first
|
||||
attachment.
|
||||
security:
|
||||
- authTokenHeader: []
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/id"
|
||||
responses:
|
||||
200:
|
||||
description: Ok
|
||||
404:
|
||||
description: NotFound
|
||||
get:
|
||||
tags: [ Attachment ]
|
||||
summary: Get a preview image of an attachment file.
|
||||
description: |
|
||||
Gets a image file showing a preview of the item. Usually it is
|
||||
a small image of the first page of the first attachment. If
|
||||
not available, a 404 is returned. However, if the query
|
||||
parameter `withFallback` is `true`, a fallback preview image
|
||||
is returned. You can also use the `HEAD` method to check for
|
||||
existence.
|
||||
security:
|
||||
- authTokenHeader: []
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/id"
|
||||
- $ref: "#/components/parameters/withFallback"
|
||||
responses:
|
||||
200:
|
||||
description: Ok
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
|
||||
/sec/item/{itemId}/reprocess:
|
||||
post:
|
||||
|
Reference in New Issue
Block a user