docs(project): document the import progress NDJSON stream
deploy / deploy (push) Successful in 1m3s

Describe /files/import's application/x-ndjson response and the start/file/
done/error event schema.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 21:15:50 +03:00
parent c8bd8512ce
commit ca3bca59e7
+36 -9
View File
@@ -654,6 +654,13 @@ paths:
not recursed. A successfully imported file is removed from the import not recursed. A successfully imported file is removed from the import
folder. For files without an EXIF date, the source file's modified time folder. For files without an EXIF date, the source file's modified time
is used as content_datetime. is used as content_datetime.
Progress is streamed as newline-delimited JSON (`application/x-ndjson`):
a single `start` event, one `file` event per directory entry as it is
processed, and a final `done` event with the tallies. A validation error
raised before any file is touched (e.g. import disabled, bad path) is
instead returned as a normal JSON error with a 4xx/5xx status.
requestBody: requestBody:
required: true required: true
content: content:
@@ -666,25 +673,45 @@ paths:
description: Server directory path (uses user's configured import path if omitted) description: Server directory path (uses user's configured import path if omitted)
responses: responses:
'200': '200':
description: Import result description: >
A stream of newline-delimited JSON import progress events. The
schema below describes a single event line; the response body is one
such object per line.
content: content:
application/json: application/x-ndjson:
schema: schema:
type: object type: object
required: [type]
properties: properties:
imported: type:
type: string
enum: [start, file, done, error]
description: Event discriminator.
total:
type: integer type: integer
skipped: description: Entries to process (start) or processed (done).
index:
type: integer type: integer
errors: description: 1-based position of this entry (file events).
type: array
items:
type: object
properties:
filename: filename:
type: string type: string
description: Entry name (file events).
status:
type: string
enum: [imported, skipped, error]
description: Outcome for this entry (file events).
reason: reason:
type: string type: string
description: Detail for a skipped/error/warning entry.
imported:
type: integer
description: Total imported (done event).
skipped:
type: integer
description: Total skipped (done event).
errors:
type: integer
description: Total errors (done event).
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Tags # Tags